summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/app.src142
-rw-r--r--sw/source/ui/app/appenv.cxx126
-rw-r--r--sw/source/ui/app/apphdl.cxx80
-rw-r--r--sw/source/ui/app/applab.cxx108
-rw-r--r--sw/source/ui/app/appopt.cxx142
-rw-r--r--sw/source/ui/app/docsh.cxx204
-rwxr-xr-xsw/source/ui/app/docsh2.cxx429
-rw-r--r--sw/source/ui/app/docshdrw.cxx22
-rw-r--r--sw/source/ui/app/docshini.cxx150
-rw-r--r--sw/source/ui/app/docst.cxx225
-rw-r--r--sw/source/ui/app/docstyle.cxx341
-rw-r--r--sw/source/ui/app/error.src20
-rw-r--r--sw/source/ui/app/mainwn.cxx6
-rw-r--r--sw/source/ui/app/mn.src83
-rw-r--r--sw/source/ui/app/swdll.cxx73
-rw-r--r--sw/source/ui/app/swdllimpl.hxx42
-rw-r--r--sw/source/ui/app/swmodul1.cxx231
-rw-r--r--sw/source/ui/app/swmodule.cxx101
-rw-r--r--sw/source/ui/app/swwait.cxx2
-rw-r--r--sw/source/ui/cctrl/actctrl.cxx19
-rw-r--r--sw/source/ui/cctrl/popbox.cxx21
-rw-r--r--sw/source/ui/cctrl/swlbox.cxx78
-rw-r--r--sw/source/ui/chrdlg/break.cxx39
-rw-r--r--sw/source/ui/chrdlg/ccoll.cxx45
-rw-r--r--sw/source/ui/chrdlg/ccoll.src1
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx84
-rw-r--r--sw/source/ui/chrdlg/chrdlg.src1
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx233
-rw-r--r--sw/source/ui/chrdlg/drpcps.src1
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx55
-rw-r--r--sw/source/ui/chrdlg/numpara.src1
-rw-r--r--sw/source/ui/chrdlg/paradlg.src3
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx50
-rw-r--r--sw/source/ui/chrdlg/swbreak.src2
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx74
-rw-r--r--sw/source/ui/chrdlg/tblnumfm.cxx15
-rw-r--r--sw/source/ui/config/barcfg.cxx19
-rw-r--r--sw/source/ui/config/caption.cxx100
-rw-r--r--sw/source/ui/config/cfgitems.cxx109
-rw-r--r--sw/source/ui/config/config.hrc4
-rw-r--r--sw/source/ui/config/dbconfig.cxx20
-rw-r--r--sw/source/ui/config/fontcfg.cxx47
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx61
-rw-r--r--sw/source/ui/config/mailconfigpage.hrc1
-rw-r--r--sw/source/ui/config/mailconfigpage.src7
-rw-r--r--sw/source/ui/config/modcfg.cxx93
-rw-r--r--sw/source/ui/config/optcomp.cxx39
-rw-r--r--sw/source/ui/config/optdlg.hrc8
-rw-r--r--sw/source/ui/config/optdlg.src6
-rw-r--r--sw/source/ui/config/optload.cxx149
-rw-r--r--sw/source/ui/config/optload.hrc1
-rw-r--r--sw/source/ui/config/optload.src11
-rw-r--r--sw/source/ui/config/optpage.cxx294
-rw-r--r--sw/source/ui/config/prtopt.cxx14
-rw-r--r--sw/source/ui/config/uinums.cxx144
-rw-r--r--sw/source/ui/config/usrpref.cxx107
-rw-r--r--sw/source/ui/config/viewopt.cxx148
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx68
-rw-r--r--sw/source/ui/dbui/addresslistdialog.hxx10
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx85
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.hxx13
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.src6
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.cxx30
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.hxx8
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.src5
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx174
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx342
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.cxx28
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.hxx8
-rw-r--r--sw/source/ui/dbui/dbtree.cxx125
-rw-r--r--sw/source/ui/dbui/dbui.cxx18
-rw-r--r--sw/source/ui/dbui/dbui.src2
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx6
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx116
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.hrc2
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.src14
-rw-r--r--sw/source/ui/dbui/mailmergehelper.cxx173
-rw-r--r--sw/source/ui/dbui/mailmergewizard.cxx34
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx170
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx24
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.src9
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx287
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx22
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.hxx6
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx47
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx10
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx49
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx6
-rw-r--r--sw/source/ui/dbui/mmmergepage.cxx17
-rw-r--r--sw/source/ui/dbui/mmmergepage.hxx6
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx183
-rw-r--r--sw/source/ui/dbui/mmoutputpage.hxx9
-rw-r--r--sw/source/ui/dbui/mmoutputpage.src2
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx12
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.hxx6
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.cxx26
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.hxx6
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx16
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.hxx7
-rw-r--r--sw/source/ui/dbui/swdbtoolsclient.cxx30
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx60
-rw-r--r--sw/source/ui/dialog/abstract.cxx17
-rw-r--r--sw/source/ui/dialog/abstract.src5
-rw-r--r--sw/source/ui/dialog/addrdlg.cxx17
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx30
-rw-r--r--sw/source/ui/dialog/dialog.src2
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx47
-rw-r--r--sw/source/ui/dialog/docstdlg.hrc2
-rw-r--r--sw/source/ui/dialog/docstdlg.src33
-rw-r--r--sw/source/ui/dialog/macassgn.cxx24
-rw-r--r--sw/source/ui/dialog/regionsw.cxx36
-rw-r--r--sw/source/ui/dialog/regionsw.hrc6
-rw-r--r--sw/source/ui/dialog/regionsw.src10
-rw-r--r--sw/source/ui/dialog/swabstdlg.cxx8
-rw-r--r--sw/source/ui/dialog/swdialmgr.cxx5
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx224
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx17
-rw-r--r--sw/source/ui/dialog/swuiexp.cxx3
-rw-r--r--sw/source/ui/dialog/swwrtshitem.cxx3
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx361
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx17
-rw-r--r--sw/source/ui/dialog/wordcountdialog.hrc30
-rw-r--r--sw/source/ui/dialog/wordcountdialog.src42
-rw-r--r--[-rwxr-xr-x]sw/source/ui/dochdl/gloshdl.cxx226
-rw-r--r--sw/source/ui/dochdl/selglos.cxx9
-rw-r--r--sw/source/ui/dochdl/selglos.src2
-rwxr-xr-xsw/source/ui/dochdl/swdtflvr.cxx523
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.cxx5
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.hxx7
-rw-r--r--sw/source/ui/docvw/AnnotationMenuButton.cxx7
-rw-r--r--sw/source/ui/docvw/AnnotationMenuButton.hxx7
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx20
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx223
-rw-r--r--sw/source/ui/docvw/ShadowOverlayObject.cxx5
-rw-r--r--sw/source/ui/docvw/ShadowOverlayObject.hxx7
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.cxx6
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.hxx9
-rw-r--r--sw/source/ui/docvw/SidebarTxtControlAcc.cxx15
-rw-r--r--sw/source/ui/docvw/SidebarTxtControlAcc.hxx7
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx151
-rw-r--r--sw/source/ui/docvw/SidebarWinAcc.cxx13
-rw-r--r--sw/source/ui/docvw/SidebarWinAcc.hxx7
-rw-r--r--sw/source/ui/docvw/annotation.hrc3
-rw-r--r--sw/source/ui/docvw/annotation.src3
-rw-r--r--sw/source/ui/docvw/docvw.hrc2
-rw-r--r--sw/source/ui/docvw/docvw.src3
-rw-r--r--sw/source/ui/docvw/edtdd.cxx51
-rw-r--r--sw/source/ui/docvw/edtwin.cxx960
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx92
-rw-r--r--sw/source/ui/docvw/edtwin3.cxx37
-rw-r--r--sw/source/ui/docvw/extedit.cxx150
-rw-r--r--sw/source/ui/docvw/frmsidebarwincontainer.cxx6
-rw-r--r--sw/source/ui/docvw/frmsidebarwincontainer.hxx5
-rwxr-xr-xsw/source/ui/docvw/romenu.cxx96
-rw-r--r--sw/source/ui/docvw/romenu.hxx12
-rw-r--r--sw/source/ui/docvw/srcedtw.cxx232
-rw-r--r--sw/source/ui/envelp/envelp.src1
-rw-r--r--sw/source/ui/envelp/envfmt.cxx245
-rw-r--r--sw/source/ui/envelp/envfmt.hrc10
-rw-r--r--sw/source/ui/envelp/envfmt.hxx8
-rw-r--r--sw/source/ui/envelp/envfmt.src1
-rw-r--r--sw/source/ui/envelp/envimg.cxx50
-rw-r--r--sw/source/ui/envelp/envlop.hrc8
-rw-r--r--sw/source/ui/envelp/envlop.src1
-rw-r--r--sw/source/ui/envelp/envlop1.cxx95
-rw-r--r--sw/source/ui/envelp/envprt.cxx90
-rw-r--r--sw/source/ui/envelp/envprt.hrc27
-rw-r--r--sw/source/ui/envelp/envprt.hxx4
-rw-r--r--sw/source/ui/envelp/envprt.src79
-rw-r--r--sw/source/ui/envelp/label.hrc8
-rw-r--r--sw/source/ui/envelp/label.src1
-rw-r--r--sw/source/ui/envelp/label1.cxx162
-rw-r--r--sw/source/ui/envelp/labelcfg.cxx31
-rw-r--r--sw/source/ui/envelp/labelexp.cxx18
-rw-r--r--sw/source/ui/envelp/labfmt.cxx133
-rw-r--r--sw/source/ui/envelp/labfmt.hrc8
-rw-r--r--sw/source/ui/envelp/labfmt.hxx4
-rw-r--r--sw/source/ui/envelp/labfmt.src1
-rw-r--r--sw/source/ui/envelp/labimg.cxx26
-rw-r--r--sw/source/ui/envelp/labimp.hxx4
-rw-r--r--sw/source/ui/envelp/labprt.cxx55
-rw-r--r--sw/source/ui/envelp/labprt.hrc6
-rw-r--r--sw/source/ui/envelp/labprt.hxx6
-rw-r--r--sw/source/ui/envelp/labprt.src1
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx99
-rw-r--r--sw/source/ui/envelp/mailmrge.hrc4
-rw-r--r--sw/source/ui/envelp/mailmrge.src2
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx9
-rw-r--r--sw/source/ui/envelp/syncbtn.cxx20
-rw-r--r--sw/source/ui/fldui/DropDownFieldDialog.cxx11
-rw-r--r--sw/source/ui/fldui/FldRefTreeListBox.cxx3
-rw-r--r--sw/source/ui/fldui/FldRefTreeListBox.hxx2
-rw-r--r--sw/source/ui/fldui/changedb.cxx77
-rw-r--r--sw/source/ui/fldui/changedb.hrc6
-rw-r--r--sw/source/ui/fldui/flddb.cxx93
-rw-r--r--sw/source/ui/fldui/flddb.hxx8
-rw-r--r--sw/source/ui/fldui/flddinf.cxx80
-rw-r--r--sw/source/ui/fldui/flddinf.hxx5
-rw-r--r--sw/source/ui/fldui/flddok.cxx102
-rw-r--r--sw/source/ui/fldui/flddok.hxx8
-rw-r--r--sw/source/ui/fldui/fldedt.cxx87
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx95
-rw-r--r--sw/source/ui/fldui/fldfunc.hxx9
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx255
-rw-r--r--sw/source/ui/fldui/fldpage.cxx54
-rw-r--r--sw/source/ui/fldui/fldpage.hxx8
-rw-r--r--sw/source/ui/fldui/fldref.cxx190
-rw-r--r--sw/source/ui/fldui/fldref.hxx20
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx60
-rw-r--r--sw/source/ui/fldui/fldtdlg.hrc16
-rw-r--r--sw/source/ui/fldui/fldui.src52
-rw-r--r--sw/source/ui/fldui/fldvar.cxx200
-rw-r--r--sw/source/ui/fldui/fldvar.hxx14
-rw-r--r--sw/source/ui/fldui/fldwrap.cxx70
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx18
-rw-r--r--sw/source/ui/fldui/javaedit.cxx68
-rw-r--r--sw/source/ui/fldui/javaedit.src1
-rw-r--r--sw/source/ui/fldui/xfldui.cxx20
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx213
-rw-r--r--sw/source/ui/fmtui/tmpdlg.src5
-rw-r--r--sw/source/ui/frmdlg/colex.cxx45
-rw-r--r--sw/source/ui/frmdlg/colmgr.cxx76
-rw-r--r--sw/source/ui/frmdlg/column.cxx378
-rw-r--r--sw/source/ui/frmdlg/column.hrc8
-rw-r--r--sw/source/ui/frmdlg/column.src123
-rw-r--r--sw/source/ui/frmdlg/cption.cxx38
-rw-r--r--sw/source/ui/frmdlg/cption.src2
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx25
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx63
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx543
-rw-r--r--sw/source/ui/frmdlg/frmpage.hrc1
-rw-r--r--sw/source/ui/frmdlg/frmpage.src4
-rw-r--r--sw/source/ui/frmdlg/frmui.src12
-rw-r--r--sw/source/ui/frmdlg/pattern.cxx4
-rw-r--r--sw/source/ui/frmdlg/uiborder.cxx6
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx133
-rw-r--r--sw/source/ui/frmdlg/wrap.hrc49
-rw-r--r--sw/source/ui/frmdlg/wrap.src8
-rw-r--r--sw/source/ui/globdoc/globdoc.cxx10
-rw-r--r--sw/source/ui/inc/DropDownFieldDialog.hxx6
-rw-r--r--sw/source/ui/inc/SidebarWindowsConsts.hxx7
-rw-r--r--sw/source/ui/inc/SwSpellDialogChildWindow.hxx4
-rw-r--r--sw/source/ui/inc/SwXFilterOptions.hxx6
-rw-r--r--sw/source/ui/inc/abstract.hxx12
-rw-r--r--sw/source/ui/inc/actctrl.hxx19
-rw-r--r--sw/source/ui/inc/addrdlg.hxx2
-rw-r--r--[-rwxr-xr-x]sw/source/ui/inc/annotsh.hxx6
-rw-r--r--sw/source/ui/inc/app.hrc211
-rw-r--r--sw/source/ui/inc/ascfldlg.hxx4
-rw-r--r--sw/source/ui/inc/autoedit.hxx6
-rw-r--r--sw/source/ui/inc/barcfg.hxx3
-rw-r--r--sw/source/ui/inc/basesh.hxx15
-rw-r--r--sw/source/ui/inc/beziersh.hxx3
-rw-r--r--sw/source/ui/inc/bmpwin.hxx13
-rw-r--r--sw/source/ui/inc/bookctrl.hxx2
-rw-r--r--sw/source/ui/inc/bookmark.hxx13
-rw-r--r--sw/source/ui/inc/break.hxx10
-rw-r--r--sw/source/ui/inc/caption.hxx11
-rw-r--r--sw/source/ui/inc/cfgdesc.hxx4
-rw-r--r--sw/source/ui/inc/cfgid.h3
-rw-r--r--sw/source/ui/inc/cfgitems.hxx24
-rw-r--r--sw/source/ui/inc/changedb.hxx15
-rw-r--r--sw/source/ui/inc/chartins.hxx2
-rw-r--r--sw/source/ui/inc/chldwrap.hxx2
-rw-r--r--sw/source/ui/inc/chrdlg.hxx22
-rw-r--r--sw/source/ui/inc/cnttab.hxx13
-rw-r--r--sw/source/ui/inc/colex.hxx15
-rw-r--r--sw/source/ui/inc/colmgr.hxx23
-rw-r--r--sw/source/ui/inc/column.hxx30
-rw-r--r--sw/source/ui/inc/conarc.hxx6
-rw-r--r--sw/source/ui/inc/concustomshape.hxx6
-rw-r--r--sw/source/ui/inc/condedit.hxx23
-rw-r--r--sw/source/ui/inc/conform.hxx4
-rw-r--r--sw/source/ui/inc/conpoly.hxx6
-rw-r--r--sw/source/ui/inc/conrect.hxx6
-rw-r--r--sw/source/ui/inc/content.hxx37
-rw-r--r--sw/source/ui/inc/conttree.hxx20
-rw-r--r--sw/source/ui/inc/convert.hxx5
-rw-r--r--sw/source/ui/inc/cption.hxx17
-rw-r--r--sw/source/ui/inc/dbconfig.hxx2
-rw-r--r--sw/source/ui/inc/dbinsdlg.hxx13
-rw-r--r--sw/source/ui/inc/dbtree.hxx3
-rw-r--r--sw/source/ui/inc/dbui.hxx4
-rw-r--r--sw/source/ui/inc/dialmgr.hxx3
-rw-r--r--sw/source/ui/inc/docfnote.hxx3
-rw-r--r--sw/source/ui/inc/docstdlg.hxx10
-rw-r--r--sw/source/ui/inc/drawbase.hxx14
-rw-r--r--sw/source/ui/inc/drawsh.hxx3
-rw-r--r--sw/source/ui/inc/drformsh.hxx3
-rw-r--r--sw/source/ui/inc/drpcps.hxx12
-rw-r--r--sw/source/ui/inc/drwbassh.hxx3
-rw-r--r--sw/source/ui/inc/drwtxtsh.hxx6
-rw-r--r--sw/source/ui/inc/dselect.hxx8
-rw-r--r--sw/source/ui/inc/edtwin.hxx69
-rw-r--r--sw/source/ui/inc/envimg.hxx36
-rw-r--r--sw/source/ui/inc/envlop.hxx16
-rw-r--r--sw/source/ui/inc/extedit.hxx50
-rw-r--r--sw/source/ui/inc/fldedt.hxx8
-rw-r--r--sw/source/ui/inc/fldmgr.hxx47
-rw-r--r--sw/source/ui/inc/fldtdlg.hxx7
-rw-r--r--sw/source/ui/inc/fldwrap.hxx6
-rw-r--r--sw/source/ui/inc/fontcfg.hxx5
-rw-r--r--sw/source/ui/inc/formatclipboard.hxx3
-rw-r--r--sw/source/ui/inc/formedt.hxx14
-rw-r--r--sw/source/ui/inc/frmdlg.hxx7
-rw-r--r--sw/source/ui/inc/frmmgr.hxx26
-rw-r--r--sw/source/ui/inc/frmpage.hxx33
-rw-r--r--sw/source/ui/inc/frmsh.hxx3
-rw-r--r--sw/source/ui/inc/globals.h3
-rw-r--r--sw/source/ui/inc/glosbib.hxx12
-rw-r--r--sw/source/ui/inc/glosdoc.hxx3
-rw-r--r--sw/source/ui/inc/gloshdl.hxx9
-rw-r--r--sw/source/ui/inc/gloslst.hxx6
-rw-r--r--sw/source/ui/inc/glossary.hxx18
-rw-r--r--sw/source/ui/inc/glshell.hxx2
-rw-r--r--sw/source/ui/inc/grfsh.hxx3
-rw-r--r--sw/source/ui/inc/hidfunc.h350
-rw-r--r--sw/source/ui/inc/hyp.hxx17
-rw-r--r--sw/source/ui/inc/idxmrk.hxx8
-rw-r--r--sw/source/ui/inc/imaildsplistener.hxx3
-rw-r--r--sw/source/ui/inc/initui.hxx5
-rw-r--r--sw/source/ui/inc/inpdlg.hxx9
-rw-r--r--sw/source/ui/inc/inputwin.hxx6
-rw-r--r--sw/source/ui/inc/insfnote.hxx11
-rw-r--r--sw/source/ui/inc/insrule.hxx11
-rw-r--r--sw/source/ui/inc/instable.hxx11
-rw-r--r--sw/source/ui/inc/javaedit.hxx10
-rw-r--r--sw/source/ui/inc/label.hxx2
-rw-r--r--sw/source/ui/inc/labelcfg.hxx2
-rw-r--r--sw/source/ui/inc/labimg.hxx47
-rw-r--r--[-rwxr-xr-x]sw/source/ui/inc/langhelper.hxx3
-rw-r--r--sw/source/ui/inc/linenum.hxx11
-rw-r--r--sw/source/ui/inc/listsh.hxx3
-rw-r--r--sw/source/ui/inc/macassgn.hxx4
-rw-r--r--sw/source/ui/inc/mailconfigpage.hxx15
-rw-r--r--sw/source/ui/inc/maildispatcher.hxx6
-rw-r--r--sw/source/ui/inc/mailmergechildwindow.hxx9
-rw-r--r--sw/source/ui/inc/mailmergehelper.hxx34
-rw-r--r--sw/source/ui/inc/mailmergewizard.hxx2
-rw-r--r--sw/source/ui/inc/mailmrge.hxx20
-rw-r--r--sw/source/ui/inc/mediash.hxx3
-rw-r--r--sw/source/ui/inc/mergetbl.hxx6
-rw-r--r--sw/source/ui/inc/misc.hrc1
-rw-r--r--sw/source/ui/inc/mmconfigitem.hxx8
-rw-r--r--sw/source/ui/inc/multmrk.hxx14
-rw-r--r--sw/source/ui/inc/navicfg.hxx7
-rw-r--r--sw/source/ui/inc/navicont.hxx15
-rw-r--r--sw/source/ui/inc/navipi.hxx18
-rw-r--r--sw/source/ui/inc/navmgr.hxx74
-rw-r--r--sw/source/ui/inc/navsh.hxx51
-rw-r--r--sw/source/ui/inc/num.hxx36
-rw-r--r--sw/source/ui/inc/numberingtypelistbox.hxx2
-rw-r--r--sw/source/ui/inc/numfmtlb.hxx2
-rw-r--r--sw/source/ui/inc/numpara.hxx9
-rw-r--r--sw/source/ui/inc/numprevw.hxx5
-rw-r--r--sw/source/ui/inc/olesh.hxx2
-rw-r--r--sw/source/ui/inc/olmenu.hxx2
-rw-r--r--sw/source/ui/inc/optcomp.hxx3
-rw-r--r--sw/source/ui/inc/optload.hxx20
-rw-r--r--sw/source/ui/inc/optpage.hxx50
-rw-r--r--sw/source/ui/inc/outline.hxx23
-rw-r--r--sw/source/ui/inc/pardlg.hxx3
-rw-r--r--sw/source/ui/inc/pattern.hxx2
-rw-r--r--sw/source/ui/inc/pgfnote.hxx18
-rw-r--r--sw/source/ui/inc/pggrid.hxx16
-rw-r--r--sw/source/ui/inc/popbox.hxx7
-rw-r--r--sw/source/ui/inc/prcntfld.hxx6
-rw-r--r--sw/source/ui/inc/pview.hxx26
-rw-r--r--sw/source/ui/inc/redlndlg.hxx25
-rw-r--r--sw/source/ui/inc/regionsw.hxx37
-rw-r--r--sw/source/ui/inc/rowht.hxx16
-rw-r--r--sw/source/ui/inc/scroll.hxx19
-rw-r--r--sw/source/ui/inc/selglos.hxx9
-rw-r--r--sw/source/ui/inc/sharedconnection.hxx3
-rw-r--r--sw/source/ui/inc/shdwcrsr.hxx2
-rw-r--r--sw/source/ui/inc/shells.hrc4
-rw-r--r--sw/source/ui/inc/split.hxx11
-rw-r--r--sw/source/ui/inc/splittbl.hxx2
-rw-r--r--sw/source/ui/inc/srcedtw.hxx5
-rw-r--r--sw/source/ui/inc/srcview.hxx29
-rw-r--r--sw/source/ui/inc/srtdlg.hxx10
-rw-r--r--sw/source/ui/inc/stmenu.hxx6
-rw-r--r--sw/source/ui/inc/swcont.hxx15
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx7
-rw-r--r--sw/source/ui/inc/swlbox.hxx14
-rw-r--r--sw/source/ui/inc/swmodalredlineacceptdlg.hxx3
-rw-r--r--sw/source/ui/inc/swrenamexnameddlg.hxx10
-rw-r--r--sw/source/ui/inc/swtablerep.hxx2
-rw-r--r--sw/source/ui/inc/swuiccoll.hxx2
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx41
-rw-r--r--sw/source/ui/inc/swuiidxmrk.hxx30
-rw-r--r--sw/source/ui/inc/swuipardlg.hxx3
-rw-r--r--sw/source/ui/inc/swvset.hxx3
-rw-r--r--sw/source/ui/inc/swwrtshitem.hxx3
-rw-r--r--sw/source/ui/inc/syncbtn.hxx12
-rw-r--r--sw/source/ui/inc/tabledlg.hxx5
-rw-r--r--sw/source/ui/inc/tablemgr.hxx3
-rw-r--r--sw/source/ui/inc/tabsh.hxx5
-rw-r--r--sw/source/ui/inc/tautofmt.hxx12
-rw-r--r--sw/source/ui/inc/tblctrl.hxx2
-rw-r--r--sw/source/ui/inc/tblnumfm.hxx2
-rw-r--r--sw/source/ui/inc/tbxanchr.hxx2
-rw-r--r--sw/source/ui/inc/textcontrolcombo.hxx5
-rw-r--r--sw/source/ui/inc/textsh.hxx10
-rw-r--r--sw/source/ui/inc/titlepage.hxx102
-rw-r--r--sw/source/ui/inc/tmpdlg.hxx7
-rw-r--r--sw/source/ui/inc/tmplctrl.hxx6
-rw-r--r--sw/source/ui/inc/toxmgr.hxx19
-rw-r--r--sw/source/ui/inc/uiborder.hxx2
-rw-r--r--sw/source/ui/inc/uiitems.hxx20
-rw-r--r--sw/source/ui/inc/uinums.hxx17
-rw-r--r--sw/source/ui/inc/uitool.hxx22
-rw-r--r--sw/source/ui/inc/uivwimp.hxx11
-rw-r--r--sw/source/ui/inc/unodispatch.hxx12
-rw-r--r--sw/source/ui/inc/unotools.hxx13
-rw-r--r--sw/source/ui/inc/unotxvw.hxx11
-rw-r--r--sw/source/ui/inc/usrpref.hxx28
-rw-r--r--sw/source/ui/inc/utlui.hrc16
-rwxr-xr-xsw/source/ui/inc/view.hxx100
-rw-r--r--sw/source/ui/inc/viewlayoutctrl.hxx4
-rw-r--r--sw/source/ui/inc/wformsh.hxx2
-rw-r--r--sw/source/ui/inc/wfrmsh.hxx2
-rw-r--r--sw/source/ui/inc/wgrfsh.hxx2
-rw-r--r--sw/source/ui/inc/wlistsh.hxx3
-rw-r--r--sw/source/ui/inc/wolesh.hxx2
-rw-r--r--sw/source/ui/inc/wordcountdialog.hxx9
-rw-r--r--sw/source/ui/inc/workctrl.hxx16
-rw-r--r--sw/source/ui/inc/wrap.hxx12
-rw-r--r--sw/source/ui/inc/wrtsh.hxx184
-rw-r--r--sw/source/ui/inc/wtabsh.hxx3
-rw-r--r--sw/source/ui/inc/wtextsh.hxx2
-rw-r--r--sw/source/ui/inc/wview.hxx7
-rw-r--r--sw/source/ui/inc/zoomctrl.hxx2
-rw-r--r--sw/source/ui/index/cntex.cxx77
-rw-r--r--sw/source/ui/index/cnttab.cxx975
-rw-r--r--sw/source/ui/index/cnttab.hrc2
-rw-r--r--[-rwxr-xr-x]sw/source/ui/index/cnttab.src10
-rw-r--r--sw/source/ui/index/idxmrk.cxx38
-rw-r--r--sw/source/ui/index/idxmrk.src1
-rw-r--r--sw/source/ui/index/multmrk.cxx6
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx237
-rw-r--r--sw/source/ui/index/toxmgr.cxx54
-rw-r--r--[-rwxr-xr-x]sw/source/ui/lingu/hhcwrp.cxx97
-rw-r--r--sw/source/ui/lingu/hyp.cxx10
-rw-r--r--sw/source/ui/lingu/olmenu.cxx96
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx20
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.hxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx66
-rw-r--r--sw/source/ui/misc/bookmark.src2
-rw-r--r--sw/source/ui/misc/docfnote.cxx75
-rw-r--r--sw/source/ui/misc/docfnote.src1
-rw-r--r--sw/source/ui/misc/glosbib.cxx79
-rw-r--r--sw/source/ui/misc/glosbib.src1
-rw-r--r--sw/source/ui/misc/glosdoc.cxx129
-rw-r--r--sw/source/ui/misc/glossary.cxx217
-rw-r--r--sw/source/ui/misc/glossary.hrc8
-rw-r--r--sw/source/ui/misc/glossary.src100
-rw-r--r--sw/source/ui/misc/glshell.cxx83
-rw-r--r--sw/source/ui/misc/impfnote.hxx11
-rw-r--r--sw/source/ui/misc/insfnote.cxx62
-rw-r--r--sw/source/ui/misc/insfnote.src1
-rw-r--r--sw/source/ui/misc/insrule.cxx47
-rw-r--r--sw/source/ui/misc/linenum.cxx105
-rw-r--r--sw/source/ui/misc/num.cxx169
-rw-r--r--sw/source/ui/misc/num.src5
-rw-r--r--sw/source/ui/misc/numberingtypelistbox.cxx26
-rw-r--r--sw/source/ui/misc/numberingtypelistbox.src2
-rw-r--r--sw/source/ui/misc/outline.cxx283
-rw-r--r--sw/source/ui/misc/outline.src1
-rw-r--r--sw/source/ui/misc/pgfnote.cxx201
-rw-r--r--sw/source/ui/misc/pgfnote.hrc9
-rw-r--r--sw/source/ui/misc/pgfnote.src54
-rw-r--r--sw/source/ui/misc/pggrid.cxx107
-rw-r--r--sw/source/ui/misc/pggrid.hrc2
-rw-r--r--sw/source/ui/misc/pggrid.src12
-rw-r--r--sw/source/ui/misc/redlndlg.cxx265
-rw-r--r--sw/source/ui/misc/redlndlg.src1
-rw-r--r--sw/source/ui/misc/srtdlg.cxx31
-rw-r--r--sw/source/ui/misc/srtdlg.src4
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx41
-rw-r--r--sw/source/ui/misc/titlepage.cxx367
-rw-r--r--sw/source/ui/misc/titlepage.hrc50
-rw-r--r--sw/source/ui/misc/titlepage.src244
-rw-r--r--sw/source/ui/ribbar/conarc.cxx7
-rw-r--r--sw/source/ui/ribbar/concustomshape.cxx15
-rw-r--r--sw/source/ui/ribbar/conform.cxx4
-rw-r--r--sw/source/ui/ribbar/conpoly.cxx2
-rw-r--r--sw/source/ui/ribbar/conrect.cxx2
-rw-r--r--sw/source/ui/ribbar/drawbase.cxx26
-rw-r--r--sw/source/ui/ribbar/dselect.cxx2
-rw-r--r--[-rwxr-xr-x]sw/source/ui/ribbar/inputwin.cxx52
-rw-r--r--sw/source/ui/ribbar/inputwin.src10
-rw-r--r--sw/source/ui/ribbar/tblctrl.cxx3
-rw-r--r--sw/source/ui/ribbar/tbxanchr.cxx32
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx184
-rw-r--r--sw/source/ui/ribbar/workctrl.hrc3
-rw-r--r--sw/source/ui/ribbar/workctrl.src58
-rw-r--r--[-rwxr-xr-x]sw/source/ui/shells/annotsh.cxx140
-rw-r--r--sw/source/ui/shells/basesh.cxx217
-rw-r--r--sw/source/ui/shells/beziersh.cxx24
-rw-r--r--sw/source/ui/shells/drawdlg.cxx40
-rw-r--r--sw/source/ui/shells/drawsh.cxx46
-rw-r--r--sw/source/ui/shells/drformsh.cxx8
-rw-r--r--sw/source/ui/shells/drwbassh.cxx67
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx76
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx204
-rw-r--r--sw/source/ui/shells/frmsh.cxx239
-rw-r--r--sw/source/ui/shells/grfsh.cxx68
-rw-r--r--sw/source/ui/shells/grfshex.cxx4
-rw-r--r--[-rwxr-xr-x]sw/source/ui/shells/langhelper.cxx51
-rw-r--r--sw/source/ui/shells/listsh.cxx14
-rw-r--r--sw/source/ui/shells/mediash.cxx17
-rw-r--r--sw/source/ui/shells/navsh.cxx139
-rw-r--r--sw/source/ui/shells/olesh.cxx14
-rw-r--r--sw/source/ui/shells/shells.src1
-rw-r--r--sw/source/ui/shells/slotadd.cxx6
-rw-r--r--sw/source/ui/shells/tabsh.cxx159
-rw-r--r--sw/source/ui/shells/textdrw.cxx11
-rw-r--r--sw/source/ui/shells/textfld.cxx40
-rw-r--r--sw/source/ui/shells/textglos.cxx14
-rw-r--r--sw/source/ui/shells/textidx.cxx29
-rw-r--r--[-rwxr-xr-x]sw/source/ui/shells/textsh.cxx186
-rw-r--r--sw/source/ui/shells/textsh1.cxx193
-rw-r--r--sw/source/ui/shells/textsh2.cxx22
-rw-r--r--sw/source/ui/shells/txtattr.cxx108
-rw-r--r--sw/source/ui/shells/txtcrsr.cxx41
-rw-r--r--sw/source/ui/shells/txtnum.cxx40
-rw-r--r--sw/source/ui/smartmenu/stmenu.cxx9
-rw-r--r--sw/source/ui/table/chartins.cxx28
-rw-r--r--sw/source/ui/table/chartins.src2
-rw-r--r--sw/source/ui/table/colwd.cxx14
-rw-r--r--sw/source/ui/table/convert.cxx7
-rw-r--r--sw/source/ui/table/instable.cxx9
-rw-r--r--sw/source/ui/table/mergetbl.cxx6
-rw-r--r--sw/source/ui/table/rowht.cxx12
-rw-r--r--sw/source/ui/table/rowht.src2
-rw-r--r--sw/source/ui/table/splittbl.cxx7
-rw-r--r--sw/source/ui/table/swtablerep.cxx46
-rw-r--r--sw/source/ui/table/tabledlg.cxx222
-rw-r--r--sw/source/ui/table/tabledlg.src1
-rw-r--r--sw/source/ui/table/tablemgr.cxx26
-rw-r--r--sw/source/ui/table/tablepg.hxx12
-rw-r--r--sw/source/ui/table/tautofmt.cxx50
-rw-r--r--sw/source/ui/table/tautofmt.src2
-rw-r--r--sw/source/ui/uiview/formatclipboard.cxx45
-rw-r--r--sw/source/ui/uiview/pview.cxx424
-rw-r--r--sw/source/ui/uiview/pview.src1
-rw-r--r--sw/source/ui/uiview/scroll.cxx20
-rw-r--r--sw/source/ui/uiview/srcview.cxx112
-rw-r--r--sw/source/ui/uiview/swcli.cxx11
-rw-r--r--sw/source/ui/uiview/uivwimp.cxx41
-rwxr-xr-xsw/source/ui/uiview/view.cxx217
-rw-r--r--sw/source/ui/uiview/view.src1
-rw-r--r--sw/source/ui/uiview/view0.cxx31
-rw-r--r--sw/source/ui/uiview/view1.cxx34
-rw-r--r--sw/source/ui/uiview/view2.cxx213
-rw-r--r--sw/source/ui/uiview/viewcoll.cxx12
-rw-r--r--sw/source/ui/uiview/viewdlg.cxx7
-rw-r--r--sw/source/ui/uiview/viewdlg2.cxx24
-rw-r--r--sw/source/ui/uiview/viewdraw.cxx93
-rw-r--r--sw/source/ui/uiview/viewfunc.hxx3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uiview/viewling.cxx208
-rw-r--r--sw/source/ui/uiview/viewmdi.cxx160
-rw-r--r--sw/source/ui/uiview/viewport.cxx82
-rw-r--r--sw/source/ui/uiview/viewprt.cxx56
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx71
-rw-r--r--sw/source/ui/uiview/viewstat.cxx21
-rw-r--r--sw/source/ui/uiview/viewtab.cxx142
-rw-r--r--sw/source/ui/uno/RefreshListenerContainer.cxx3
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx89
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.hxx7
-rw-r--r--sw/source/ui/uno/SwXFilterOptions.cxx41
-rw-r--r--sw/source/ui/uno/detreg.cxx2
-rw-r--r--sw/source/ui/uno/dlelstnr.cxx44
-rw-r--r--sw/source/ui/uno/swdet2.cxx31
-rw-r--r--sw/source/ui/uno/swdetect.cxx41
-rw-r--r--sw/source/ui/uno/swdetect.hxx5
-rw-r--r--sw/source/ui/uno/unoatxt.cxx293
-rw-r--r--sw/source/ui/uno/unodefaults.cxx14
-rw-r--r--sw/source/ui/uno/unodefaults.hxx2
-rw-r--r--sw/source/ui/uno/unodispatch.cxx64
-rw-r--r--sw/source/ui/uno/unodoc.cxx16
-rw-r--r--sw/source/ui/uno/unofreg.cxx25
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx82
-rw-r--r--sw/source/ui/uno/unomod.cxx75
-rw-r--r--sw/source/ui/uno/unomodule.cxx14
-rw-r--r--sw/source/ui/uno/unomodule.hxx3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uno/unotxdoc.cxx635
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uno/unotxvw.cxx381
-rw-r--r--sw/source/ui/utlui/attrdesc.cxx30
-rw-r--r--sw/source/ui/utlui/attrdesc.src14
-rw-r--r--sw/source/ui/utlui/bookctrl.cxx22
-rw-r--r--sw/source/ui/utlui/condedit.cxx12
-rw-r--r--sw/source/ui/utlui/content.cxx512
-rw-r--r--sw/source/ui/utlui/glbltree.cxx153
-rw-r--r--sw/source/ui/utlui/gloslst.cxx29
-rw-r--r--sw/source/ui/utlui/initui.cxx38
-rw-r--r--sw/source/ui/utlui/initui.src3
-rw-r--r--sw/source/ui/utlui/navicfg.cxx20
-rw-r--r--sw/source/ui/utlui/navipi.cxx155
-rw-r--r--sw/source/ui/utlui/navipi.hrc1
-rw-r--r--sw/source/ui/utlui/navipi.src31
-rw-r--r--sw/source/ui/utlui/numfmtlb.cxx58
-rw-r--r--sw/source/ui/utlui/prcntfld.cxx76
-rw-r--r--sw/source/ui/utlui/shdwcrsr.cxx2
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.cxx15
-rw-r--r--sw/source/ui/utlui/textcontrolcombo.cxx4
-rw-r--r--sw/source/ui/utlui/tmplctrl.cxx22
-rw-r--r--sw/source/ui/utlui/uiitems.cxx85
-rw-r--r--sw/source/ui/utlui/uitool.cxx60
-rw-r--r--sw/source/ui/utlui/unotools.cxx97
-rw-r--r--sw/source/ui/utlui/utlui.src99
-rw-r--r--sw/source/ui/utlui/viewlayoutctrl.cxx48
-rw-r--r--sw/source/ui/utlui/zoomctrl.cxx16
-rw-r--r--sw/source/ui/vba/service.cxx7
-rw-r--r--sw/source/ui/vba/vbaaddin.cxx2
-rw-r--r--sw/source/ui/vba/vbaaddin.hxx3
-rw-r--r--sw/source/ui/vba/vbaaddins.cxx5
-rw-r--r--sw/source/ui/vba/vbaaddins.hxx3
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx20
-rw-r--r--sw/source/ui/vba/vbaapplication.hxx4
-rw-r--r--sw/source/ui/vba/vbaautotextentry.cxx31
-rw-r--r--sw/source/ui/vba/vbaautotextentry.hxx3
-rw-r--r--sw/source/ui/vba/vbabookmark.cxx9
-rw-r--r--sw/source/ui/vba/vbabookmark.hxx3
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx17
-rw-r--r--sw/source/ui/vba/vbabookmarks.hxx5
-rw-r--r--sw/source/ui/vba/vbaborders.cxx14
-rw-r--r--sw/source/ui/vba/vbaborders.hxx2
-rw-r--r--sw/source/ui/vba/vbacell.cxx119
-rw-r--r--sw/source/ui/vba/vbacell.hxx67
-rw-r--r--sw/source/ui/vba/vbacells.cxx223
-rw-r--r--sw/source/ui/vba/vbacells.hxx75
-rw-r--r--sw/source/ui/vba/vbacheckbox.cxx97
-rw-r--r--sw/source/ui/vba/vbacheckbox.hxx58
-rw-r--r--sw/source/ui/vba/vbacolumn.cxx165
-rw-r--r--sw/source/ui/vba/vbacolumn.hxx68
-rw-r--r--sw/source/ui/vba/vbacolumns.cxx160
-rw-r--r--sw/source/ui/vba/vbacolumns.hxx75
-rw-r--r--sw/source/ui/vba/vbadialog.cxx3
-rw-r--r--sw/source/ui/vba/vbadialog.hxx3
-rw-r--r--sw/source/ui/vba/vbadialogs.cxx2
-rw-r--r--sw/source/ui/vba/vbadialogs.hxx3
-rw-r--r--sw/source/ui/vba/vbadocument.cxx165
-rw-r--r--sw/source/ui/vba/vbadocument.hxx23
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.cxx24
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.hxx5
-rw-r--r--sw/source/ui/vba/vbadocuments.cxx5
-rw-r--r--sw/source/ui/vba/vbadocuments.hxx3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/vba/vbaeventshelper.cxx3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/vba/vbaeventshelper.hxx2
-rw-r--r--sw/source/ui/vba/vbafield.cxx121
-rw-r--r--sw/source/ui/vba/vbafield.hxx5
-rw-r--r--sw/source/ui/vba/vbafind.cxx9
-rw-r--r--sw/source/ui/vba/vbafind.hxx6
-rw-r--r--sw/source/ui/vba/vbafont.cxx9
-rw-r--r--sw/source/ui/vba/vbafont.hxx3
-rw-r--r--sw/source/ui/vba/vbaformfield.cxx138
-rw-r--r--sw/source/ui/vba/vbaformfield.hxx61
-rw-r--r--sw/source/ui/vba/vbaformfields.cxx205
-rw-r--r--sw/source/ui/vba/vbaformfields.hxx60
-rw-r--r--sw/source/ui/vba/vbaframe.cxx74
-rw-r--r--sw/source/ui/vba/vbaframe.hxx57
-rw-r--r--sw/source/ui/vba/vbaframes.cxx109
-rw-r--r--sw/source/ui/vba/vbaframes.hxx61
-rw-r--r--sw/source/ui/vba/vbaglobals.cxx14
-rw-r--r--sw/source/ui/vba/vbaglobals.hxx4
-rw-r--r--sw/source/ui/vba/vbaheaderfooter.cxx3
-rw-r--r--sw/source/ui/vba/vbaheaderfooter.hxx3
-rw-r--r--sw/source/ui/vba/vbaheaderfooterhelper.cxx131
-rw-r--r--sw/source/ui/vba/vbaheaderfooterhelper.hxx23
-rw-r--r--sw/source/ui/vba/vbaheadersfooters.cxx150
-rw-r--r--sw/source/ui/vba/vbaheadersfooters.hxx62
-rw-r--r--sw/source/ui/vba/vbainformationhelper.cxx3
-rw-r--r--sw/source/ui/vba/vbainformationhelper.hxx3
-rw-r--r--sw/source/ui/vba/vbalistformat.cxx120
-rw-r--r--sw/source/ui/vba/vbalistformat.hxx60
-rw-r--r--sw/source/ui/vba/vbalistgalleries.cxx115
-rw-r--r--sw/source/ui/vba/vbalistgalleries.hxx61
-rw-r--r--sw/source/ui/vba/vbalistgallery.cxx72
-rw-r--r--sw/source/ui/vba/vbalistgallery.hxx58
-rw-r--r--sw/source/ui/vba/vbalisthelper.cxx705
-rw-r--r--sw/source/ui/vba/vbalisthelper.hxx77
-rw-r--r--sw/source/ui/vba/vbalistlevel.cxx400
-rw-r--r--sw/source/ui/vba/vbalistlevel.hxx81
-rw-r--r--sw/source/ui/vba/vbalistlevels.cxx118
-rw-r--r--sw/source/ui/vba/vbalistlevels.hxx62
-rw-r--r--sw/source/ui/vba/vbalisttemplate.cxx79
-rw-r--r--sw/source/ui/vba/vbalisttemplate.hxx60
-rw-r--r--sw/source/ui/vba/vbalisttemplates.cxx112
-rw-r--r--sw/source/ui/vba/vbalisttemplates.hxx62
-rw-r--r--sw/source/ui/vba/vbaoptions.cxx7
-rw-r--r--sw/source/ui/vba/vbaoptions.hxx3
-rw-r--r--sw/source/ui/vba/vbapagesetup.cxx10
-rw-r--r--sw/source/ui/vba/vbapagesetup.hxx3
-rw-r--r--sw/source/ui/vba/vbapalette.cxx5
-rw-r--r--sw/source/ui/vba/vbapalette.hxx3
-rw-r--r--sw/source/ui/vba/vbapane.cxx2
-rw-r--r--sw/source/ui/vba/vbapane.hxx3
-rw-r--r--sw/source/ui/vba/vbapanes.cxx3
-rw-r--r--sw/source/ui/vba/vbapanes.hxx3
-rw-r--r--sw/source/ui/vba/vbaparagraph.cxx19
-rw-r--r--sw/source/ui/vba/vbaparagraph.hxx5
-rw-r--r--sw/source/ui/vba/vbaparagraphformat.cxx12
-rw-r--r--sw/source/ui/vba/vbaparagraphformat.hxx3
-rw-r--r--sw/source/ui/vba/vbarange.cxx122
-rw-r--r--sw/source/ui/vba/vbarange.hxx23
-rw-r--r--sw/source/ui/vba/vbarangehelper.cxx33
-rw-r--r--sw/source/ui/vba/vbarangehelper.hxx6
-rw-r--r--sw/source/ui/vba/vbareplacement.cxx8
-rw-r--r--sw/source/ui/vba/vbareplacement.hxx6
-rw-r--r--sw/source/ui/vba/vbarevision.cxx104
-rw-r--r--sw/source/ui/vba/vbarevision.hxx60
-rw-r--r--sw/source/ui/vba/vbarevisions.cxx188
-rw-r--r--sw/source/ui/vba/vbarevisions.hxx66
-rw-r--r--sw/source/ui/vba/vbarow.cxx135
-rw-r--r--sw/source/ui/vba/vbarow.hxx69
-rw-r--r--sw/source/ui/vba/vbarows.cxx368
-rw-r--r--sw/source/ui/vba/vbarows.hxx87
-rw-r--r--sw/source/ui/vba/vbasection.cxx17
-rw-r--r--sw/source/ui/vba/vbasection.hxx7
-rw-r--r--sw/source/ui/vba/vbasections.cxx16
-rw-r--r--sw/source/ui/vba/vbasections.hxx5
-rw-r--r--sw/source/ui/vba/vbaselection.cxx804
-rw-r--r--sw/source/ui/vba/vbaselection.hxx38
-rw-r--r--sw/source/ui/vba/vbastyle.cxx146
-rw-r--r--sw/source/ui/vba/vbastyle.hxx23
-rw-r--r--sw/source/ui/vba/vbastyles.cxx163
-rw-r--r--sw/source/ui/vba/vbastyles.hxx3
-rw-r--r--sw/source/ui/vba/vbasystem.cxx141
-rw-r--r--sw/source/ui/vba/vbasystem.hxx3
-rw-r--r--sw/source/ui/vba/vbatable.cxx26
-rw-r--r--sw/source/ui/vba/vbatable.hxx8
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx295
-rw-r--r--sw/source/ui/vba/vbatablehelper.hxx70
-rw-r--r--sw/source/ui/vba/vbatableofcontents.cxx124
-rw-r--r--sw/source/ui/vba/vbatableofcontents.hxx70
-rw-r--r--sw/source/ui/vba/vbatables.cxx103
-rw-r--r--sw/source/ui/vba/vbatables.hxx3
-rw-r--r--sw/source/ui/vba/vbatablesofcontents.cxx195
-rw-r--r--sw/source/ui/vba/vbatablesofcontents.hxx64
-rw-r--r--sw/source/ui/vba/vbatabstop.cxx62
-rw-r--r--sw/source/ui/vba/vbatabstop.hxx54
-rw-r--r--sw/source/ui/vba/vbatabstops.cxx280
-rw-r--r--sw/source/ui/vba/vbatabstops.hxx65
-rw-r--r--sw/source/ui/vba/vbatemplate.cxx63
-rw-r--r--sw/source/ui/vba/vbatemplate.hxx6
-rw-r--r--sw/source/ui/vba/vbavariable.cxx2
-rw-r--r--sw/source/ui/vba/vbavariable.hxx3
-rw-r--r--sw/source/ui/vba/vbavariables.cxx3
-rw-r--r--sw/source/ui/vba/vbavariables.hxx3
-rw-r--r--sw/source/ui/vba/vbaview.cxx49
-rw-r--r--sw/source/ui/vba/vbaview.hxx3
-rw-r--r--sw/source/ui/vba/vbawindow.cxx46
-rw-r--r--sw/source/ui/vba/vbawindow.hxx5
-rw-r--r--sw/source/ui/vba/vbawrapformat.cxx2
-rw-r--r--sw/source/ui/vba/vbawrapformat.hxx3
-rw-r--r--sw/source/ui/vba/wordvbahelper.cxx101
-rw-r--r--sw/source/ui/vba/wordvbahelper.hxx18
-rw-r--r--sw/source/ui/web/wdocsh.cxx14
-rw-r--r--sw/source/ui/web/wformsh.cxx6
-rw-r--r--sw/source/ui/web/wfrmsh.cxx19
-rw-r--r--sw/source/ui/web/wgrfsh.cxx2
-rw-r--r--sw/source/ui/web/wlistsh.cxx4
-rw-r--r--sw/source/ui/web/wolesh.cxx4
-rw-r--r--sw/source/ui/web/wtabsh.cxx4
-rw-r--r--sw/source/ui/web/wtextsh.cxx18
-rw-r--r--sw/source/ui/web/wview.cxx21
-rw-r--r--sw/source/ui/wrtsh/delete.cxx45
-rw-r--r--sw/source/ui/wrtsh/move.cxx97
-rw-r--r--sw/source/ui/wrtsh/navmgr.cxx224
-rw-r--r--sw/source/ui/wrtsh/select.cxx8
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx206
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx26
-rw-r--r--sw/source/ui/wrtsh/wrtsh3.cxx12
-rw-r--r--sw/source/ui/wrtsh/wrtsh4.cxx44
-rw-r--r--sw/source/ui/wrtsh/wrtundo.cxx3
777 files changed, 20031 insertions, 21748 deletions
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index e1a3d314d572..094d38bf372f 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -25,8 +25,6 @@
*
************************************************************************/
-
-
#include <svl/style.hrc>
#include <sfx2/sfx.hrc>
#include <svx/dialogs.hrc>
@@ -55,7 +53,7 @@ String STR_PAGE_COUNT_MACRO
Text [ en-US ] = "Changing the page count" ;
};
- // Image-Liste ----------------------------------------------------------------
+ // Image-list ----------------------------------------------------------------
// Don't use this image list for normal toolbar images. We have now our commandimagelist
// folder in default_images. This list is now only used for special toolboxes that are
// used in floating windows.
@@ -64,7 +62,7 @@ String STR_PAGE_COUNT_MACRO
IdList = { \
FN_FORMULA_CALC ;\
FN_FORMULA_CANCEL ;\
- FN_FORMULA_APPLY ;\
+ FN_FORMULA_APPLY ;\
}; \
IdCount = { \
3; \
@@ -76,6 +74,7 @@ ImageList RID_DEFAULTIMAGELIST_SC
MaskColor = IMAGE_MASK_COLOR ;
IMAGELIST_AND_COUNT
};
+
ImageList RID_DEFAULTIMAGELIST_LC
{
Prefix = "lc";
@@ -83,20 +82,7 @@ ImageList RID_DEFAULTIMAGELIST_LC
IMAGELIST_AND_COUNT
};
-ImageList RID_DEFAULTIMAGELIST_SCH
-{
- Prefix = "sch";
- MaskColor = IMAGE_MASK_COLOR ;
- IMAGELIST_AND_COUNT
-};
-ImageList RID_DEFAULTIMAGELIST_LCH
-{
- Prefix = "lch";
- MaskColor = IMAGE_MASK_COLOR ;
- IMAGELIST_AND_COUNT
-};
-
-// Vorlagen
+// Templates
#define STYLE_IMAGE_LISTEF \
MaskColor = IMAGE_MASK_COLOR ; \
IdList = \
@@ -113,65 +99,65 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
{
Text [ en-US ] = "Paragraph Styles" ;
StyleFamily = SFX_STYLE_FAMILY_PARA ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- < "Automatic" ; SFXSTYLEBIT_AUTO ; > ;
- < "Text Styles" ; SWSTYLEBIT_TEXT ; > ;
- < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ;
- < "List Styles" ; SWSTYLEBIT_LIST ; > ;
- < "Index Styles" ; SWSTYLEBIT_IDX ; > ;
- < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ;
- < "HTML Styles" ; SWSTYLEBIT_HTML ; > ;
- < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ;
+ FilterList [ en-US ] =
+ {
+ < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "Automatic" ; SFXSTYLEBIT_AUTO ; > ;
+ < "Text Styles" ; SWSTYLEBIT_TEXT ; > ;
+ < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ;
+ < "List Styles" ; SWSTYLEBIT_LIST ; > ;
+ < "Index Styles" ; SWSTYLEBIT_IDX ; > ;
+ < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ;
+ < "HTML Styles" ; SWSTYLEBIT_HTML ; > ;
+ < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ;
+ };
};
- };
SfxStyleFamilyItem
{
Text [ en-US ] = "Character Styles" ;
StyleFamily = SFX_STYLE_FAMILY_CHAR ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
- };
+ };
SfxStyleFamilyItem
{
Text [ en-US ] = "Frame Styles" ;
StyleFamily = SFX_STYLE_FAMILY_FRAME ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
- };
+ };
SfxStyleFamilyItem
{
Text [ en-US ] = "Page Styles" ;
StyleFamily = SFX_STYLE_FAMILY_PAGE ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
- };
+ };
SfxStyleFamilyItem
{
StyleFamily = SFX_STYLE_FAMILY_PSEUDO ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
Text [ en-US ] = "List Styles" ;
- };
+ };
};
ImageList 1 // == BMP_COLOR_NORMAL + 1
@@ -179,20 +165,12 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
Prefix = "sf";
STYLE_IMAGE_LISTEF
};
- ImageList 2 // == BMP_COLOR_HIGHCONTRAST + 1
- {
- Prefix = "sfh";
- STYLE_IMAGE_LISTEF
- };
};
- // Default Bitmap fuer Toolbox
-BITMAP BMP_FEHLT { FILE = "x.bmp" ; };
- // Bitmap fuer die NumerierungsVorlagen im Organizer
+// Bitmap for the NumberingTemplates in the Organizer
Bitmap BMP_STYLES_FAMILY_NUM { File = "styfamnu.bmp" ; };
-Bitmap BMP_STYLES_FAMILY_NUM_HC { File = "styfamnu_h.bmp" ; };
String STR_ENV_TITLE
{
@@ -225,18 +203,17 @@ String STR_CANTCREATE
{
Text [ en-US ] = "Can't create document.";
};
+
String STR_DLLNOTFOUND
{
Text [ en-US ] = "Filter not found." ;
};
-
String STR_UNBENANNT
{
Text [ en-US ] = "Untitled" ;
};
-
String STR_LOAD_GLOBAL_DOC
{
Text [ en-US ] = "Name and Path of Master Document" ;
@@ -253,6 +230,7 @@ InfoBox MSG_ERROR_SEND_MAIL
DEFBUTTON = WB_DEF_OK ;
Message [ en-US ] = "Error sending mail." ;
};
+
InfoBox MSG_ERROR_PASSWD
{
BUTTONS = WB_OK ;
@@ -261,8 +239,8 @@ InfoBox MSG_ERROR_PASSWD
};
/*
- * auskommentiert, da die Toolbox z. Zt. nicht aus der Resource
- * geladen werden kann
+ * commented out, because the Toolbox can't be loaded from the resource
+ * at this time.
Window WIN_TOOLBOX {
"Bearbeitung von Text, Rahmen, Grafik, Tabellen oder "
"Numerierungen.";
@@ -286,7 +264,7 @@ String STR_DOC_STAT
};
// ----------------------------
- // Statusleisten-Ueberschriften
+ // Statusbar-titles
// ----------------------------
String STR_STATSTR_W4WREAD
@@ -397,16 +375,6 @@ Bitmap RID_GRAPHIC_ERRORBMP
File = "grafikde.bmp" ;
};
-Bitmap RID_GRAPHIC_REPLACEBMP_HC
-{
- File = "grafikei_h.bmp" ;
-};
-
-Bitmap RID_GRAPHIC_ERRORBMP_HC
-{
- File = "grafikde_h.bmp" ;
-};
-
String STR_TABLE_DEFNAME
{
Text [ en-US ] = "Table" ;
@@ -426,14 +394,17 @@ String STR_FRAME_DEFNAME
{
Text [ en-US ] = "Frame" ;
};
+
String STR_REGION_DEFNAME
{
Text [ en-US ] = "Section" ;
};
+
String STR_NUMRULE_DEFNAME
{
Text [ en-US ] = "Numbering" ;
};
+
String STR_EMPTYPAGE
{
Text [ en-US ] = "blank page" ;
@@ -458,6 +429,7 @@ QueryBox MSG_SAVEAS_HTML_QUERY
DEFBUTTON = WB_DEF_NO ;
Message [ en-US ] = "The source code can only be displayed if the document is saved in HTML format.\nWould you like to save the document as HTML?";
};
+
String STR_ABSTRACT_TITLE
{
Text [ en-US ] = "Abstract: " ;
@@ -470,10 +442,9 @@ String STR_FDLG_TEMPLATE_BUTTON
String STR_FDLG_TEMPLATE_NAME
{
- //Text [ en-US ] = "Styles: " ; //#outline level,removed by zhaojianwei
- Text [ en-US ] = "separated by: " ; //<-end,add by zhaojianwei
+ Text [ en-US ] = "separated by: " ;
};
-//#outline level,add by zhaojianwei
+
String STR_FDLG_OUTLINE_LEVEL
{
Text [ en-US ] = "Outline: Level ";
@@ -483,25 +454,27 @@ String STR_FDLG_STYLE
{
Text [ en-US ] = "Style: ";
};
-//<-end
-
String STR_PAGEOFFSET
{
Text [ en-US ] = "Page number: " ;
};
+
String STR_PAGEBREAK
{
Text [ en-US ] = "Break before new page" ;
};
+
String STR_WESTERN_FONT
{
Text [ en-US ] = "Western text: ";
};
+
String STR_CJK_FONT
{
Text [ en-US ] = "Asian text: ";
};
+
String STR_REDLINE_UNKNOWN_AUTHOR
{
Text [ en-US ] = "Unknown Author";
@@ -513,14 +486,7 @@ WarningBox MSG_DISABLE_UNDO_QUESTION
DEFBUTTON = WB_DEF_YES ;
Message [ en-US ] = "This action deletes the list of actions that can be undone. Previous changes made to the document are still valid, but cannot be undone. Do you want to continue formatting?";
};
-/*QueryBox MSG_INS_MERGE_FIELDS
-{
- HelpId = HID_MAIL_MERGE_INSERT_FIELDS;
- Buttons = WB_OK_CANCEL ;
- DefButton = WB_DEF_YES ;
- Message [ en-US ] = "Do you want to use names and addresses from a database?";
-};
-*/
+
QueryBox MSG_PRINT_AS_MERGE
{
HelpId = HID_PRINT_AS_MERGE;
@@ -528,6 +494,7 @@ QueryBox MSG_PRINT_AS_MERGE
DefButton = WB_DEF_YES ;
Message [ en-US ] = "Your document contains address database fields. Do you want to print a form letter?";
};
+
ModalDialog DLG_MERGE_SOURCE_UNAVAILABLE
{
HelpId = HID_MERGE_SOURCE_UNAVAILABLE;
@@ -560,6 +527,7 @@ ModalDialog DLG_MERGE_SOURCE_UNAVAILABLE
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
+
WarningBox MSG_DATA_SOURCES_UNAVAILABLE
{
HelpId = HID_DATA_SOURCES_UNAVAILABLE;
@@ -571,15 +539,17 @@ String RID_MODULE_TOOLBOX
{
Text [ en-US ] = "Function Bar (viewing mode)" ;
};
+
String STR_DONT_ASK_AGAIN
{
Text [ en-US ] = "~Do not show warning again" ;
};
-// --> OD 2008-04-14 #outlinelevel#
+
String STR_OUTLINE_NUMBERING
{
Text [ en-US ] = "Outline Numbering";
};
+
ToolBox RID_MODULE_TOOLBOX
{
HelpID = HID_MODULE_TOOLBOX ;
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 0a2cf67d62ae..c08bfb5bf6df 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#if STLPORT_VERSION>=321
#include <cstdarg>
-#endif
-
#include <hintids.hxx>
@@ -75,15 +72,9 @@
#include <crsskip.hxx>
#include <cmdid.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _APP_HRC
#include <app.hrc>
-#endif
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include "swabstdlg.hxx"
#include "envelp.hrc"
#include "envimg.hxx"
@@ -93,11 +84,7 @@
#define ENV_CANCEL SHRT_MAX
-// --------------------------------------------------------------------------
-
-
-// Funktion wird fuer Etiketten und Briefumschlaege benutzt!
-// im applab.cxx und appenv.cxx
+// Function used for labels and envelopes in applab.cxx and appenv.cxx
String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
{
String sRet;
@@ -119,7 +106,6 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText
{
sTmpText = aLine.Copy( 0, nPos );
aLine.Erase( 0, nPos );
-// sTmpText = aLine.Cut( 0, nPos );
}
else
{
@@ -128,15 +114,13 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText
{
sTmpText = aLine;
aLine.Erase();
-// sTmpText = aLine.Cut();
}
else
{
sTmpText = aLine.Copy( 0, nPos + 1);
aLine.Erase( 0, nPos + 1);
-// sTmpText = aLine.Cut( 0, nPos + 1 );
- // Datenbankfelder muesen mind. 3 Punkte beinhalten!
+ // Database fields must contain at least 3 points!
String sDBName( sTmpText.Copy( 1, sTmpText.Len() - 2));
sal_uInt16 nCnt = sDBName.GetTokenCount('.');
if (nCnt >= 3)
@@ -154,14 +138,11 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText
}
rSh.InsertLineBreak();
}
- rSh.DelLeft(); // Letzten Linebreak wieder l???schen
+ rSh.DelLeft(); // Again remove last linebreak
return sRet;
}
-// ----------------------------------------------------------------------------
-
-
void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId)
{
sal_uInt16 nCollCnt = pOldSh->GetTxtFmtCollCount();
@@ -171,12 +152,9 @@ void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId
pNewSh->GetTxtCollFromPool(nCollId)->SetFmtAttr(pColl->GetAttrSet());
}
-// ----------------------------------------------------------------------------
-
-
void SwModule::InsertEnv( SfxRequest& rReq )
{
-static sal_uInt16 nTitleNo = 0;
+ static sal_uInt16 nTitleNo = 0;
SwDocShell *pMyDocSh;
SfxViewFrame *pFrame;
@@ -184,34 +162,34 @@ static sal_uInt16 nTitleNo = 0;
SwWrtShell *pOldSh,
*pSh;
- //aktuelle Shell besorgen
+ // Get current shell
pMyDocSh = (SwDocShell*) SfxObjectShell::Current();
pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : 0;
- // Neues Dokument erzeugen (kein Show!)
+ // Create new document (don't show!)
SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xDocSh->DoInitNew( 0 );
pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
pNewView = (SwView*) pFrame->GetViewShell();
- pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird.
+ pNewView->AttrChangedNotify( &pNewView->GetWrtShell() ); // so that SelectShell is being called
pSh = pNewView->GetWrtShellPtr();
String aTmp( SW_RES(STR_ENV_TITLE) );
aTmp += String::CreateFromInt32( ++nTitleNo );
xDocSh->SetTitle( aTmp );
- // Ggf. alte Collections "Absender" und "Empfaenger" in neues
- // Dokument kopieren
+ // if applicable, copy the old Collections "Sender" and "Reciever" to
+ // a new document
if ( pOldSh )
{
::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_JAKETADRESS);
::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_SENDADRESS);
}
- // SwEnvItem aus Config lesen
+ // Read SwEnvItem from config
SwEnvCfgItem aEnvCfg;
- //Haben wir schon einen Briefumschlag.
+ // Check if there's already an envelope.
sal_Bool bEnvChange = sal_False;
SfxItemSet aSet(GetPool(), FN_ENVELOP, FN_ENVELOP, 0);
@@ -245,10 +223,10 @@ static sal_uInt16 nTitleNo = 0;
if ( !pItem )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwEnvDlg( pParent, aSet, pOldSh, pTempPrinter, !bEnvChange, DLG_ENV );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
nMode = pDlg->Execute();
}
else
@@ -262,18 +240,18 @@ static sal_uInt16 nTitleNo = 0;
{
SwWait aWait( (SwDocShell&)*xDocSh, sal_True );
- // Dialog auslesen, Item in Config speichern
+ // Read dialog and save item to config
const SwEnvItem& rItem = pItem ? *pItem : (const SwEnvItem&) pDlg->GetOutputItemSet()->Get(FN_ENVELOP);
aEnvCfg.GetItem() = rItem;
aEnvCfg.Commit();
- //Wenn wir Drucken uebernehmen wir den eingestellten Jobsetup aus
- //dem Dialog. Die Informationen muessen hier vor dem evtl. zerstoeren
- //der neuen Shell gesetzt werden, weil deren Drucker an den Dialog
- //gereicht wurde.
+ // When we print we take the Jobsetup that is set up in the dialog.
+ // Information has to be set here, before a possible destruction of
+ // the new shell because the shell's printer has been handed to the
+ // dialog.
if ( nMode != ENV_NEWDOC )
{
- ASSERT(pOldSh, "Kein Dokument - war 'Einfuegen' nicht disabled???");
+ OSL_ENSURE(pOldSh, "No document - wasn't 'Insert' disabled???");
SvxPaperBinItem aItem( RES_PAPER_BIN );
aItem.SetValue((sal_uInt8)pSh->getIDocumentDeviceAccess()->getPrinter(true)->GetPaperBin());
pOldSh->GetPageDescFromPool(RES_POOLPAGE_JAKET)->GetMaster().SetFmtAttr(aItem);
@@ -289,29 +267,29 @@ static sal_uInt16 nTitleNo = 0;
if (nMode == ENV_INSERT)
{
- SetView(&pOldSh->GetView()); // Pointer auf oberste View restaurieren
+ SetView(&pOldSh->GetView()); // Set pointer to top view
- //Neues Dok wieder loeschen
+ // Delete new document
xDocSh->DoClose();
pSh = pOldSh;
//#i4251# selected text or objects in the document should
//not be deleted on inserting envelopes
pSh->EnterStdMode();
- // Los geht's (Einfuegen)
+ // Here it goes (insert)
pSh->StartUndo(UNDO_UI_INSERT_ENVELOPE, NULL);
pSh->StartAllAction();
pSh->SttEndDoc(sal_True);
if (bEnvChange)
{
- // Folgevorlage: Seite 2
+ // followup template: page 2
pFollow = pSh->GetPageDesc(pSh->GetCurPageDesc()).GetFollow();
- // Text der ersten Seite loeschen
+ // Delete text from the first page
if ( !pSh->SttNxtPg(sal_True) )
pSh->EndPg(sal_True);
pSh->DelRight();
- // Rahmen der ersten Seite loeschen
+ // Delete frame of the first page
if( pSh->GotoFly( rSendMark ) )
{
pSh->EnterSelFrmMode();
@@ -325,10 +303,10 @@ static sal_uInt16 nTitleNo = 0;
pSh->SttEndDoc(sal_True);
}
else
- // Folgevorlage: Seite 1
+ // Followup template: page 1
pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc());
- // Seitenumbruch einfuegen
+ // Insert page break
if ( pSh->IsCrsrInTbl() )
{
pSh->SplitNode();
@@ -344,12 +322,12 @@ static sal_uInt16 nTitleNo = 0;
else
{
pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc());
- // Los geht's (Drucken)
+ // Let's go (print)
pSh->StartAllAction();
pSh->DoUndo(sal_False);
- // Neue Collections "Absender" und "Empfaenger" wieder in neues
- // Dokument kopieren
+ // Again, copy the new collections "Sender" and "Reciever" to
+ // a new document
if ( pOldSh )
{
::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_JAKETADRESS);
@@ -358,21 +336,20 @@ static sal_uInt16 nTitleNo = 0;
}
SET_CURR_SHELL(pSh);
- pSh->SetNewDoc(); // Performanceprobleme vermeiden
+ pSh->SetNewDoc(); // Avoid performance problems
- // Flys dieser Seite merken
+ // Remember Flys of this site
SvPtrarr aFlyArr(0, 5);
if( ENV_NEWDOC != nMode && !bEnvChange )
pSh->GetPageObjs( aFlyArr );
- // Page-Desc ermitteln
+ // Get page description
SwPageDesc* pDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_JAKET);
SwFrmFmt& rFmt = pDesc->GetMaster();
Printer *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( true );
- // Raender (setzen sich zusammen aus Shift-Offset und
- // Ausrichtung)
+ // Borders (are put together by Shift-Offset and alignment)
Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(),
MAP_TWIP);
if ( !aPaperSize.Width() && !aPaperSize.Height() )
@@ -408,25 +385,25 @@ static sal_uInt16 nTitleNo = 0;
rFmt.SetFmtAttr(aLRMargin);
rFmt.SetFmtAttr(aULMargin);
- // Kopf-, Fusszeilen
+ // Header and footer
rFmt.SetFmtAttr(SwFmtHeader(sal_Bool(sal_False)));
pDesc->ChgHeaderShare(sal_False);
rFmt.SetFmtAttr(SwFmtFooter(sal_Bool(sal_False)));
pDesc->ChgFooterShare(sal_False);
- // Seitennumerierung
+ // Page numbering
pDesc->SetUseOn(nsUseOnPage::PD_ALL);
- // Einstellen der Seitengroesse
+ // Page size
rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE,
nPageW + lLeft, nPageH + lUpper));
- // Einstellen der Numerierungsart der Seite
+ // Set type of page numbering
SvxNumberType aType;
aType.SetNumberingType(SVX_NUM_NUMBER_NONE);
pDesc->SetNumType(aType);
- // Folgevorlage
+ // Followup template
if (pFollow)
pDesc->SetFollow(pFollow);
@@ -434,7 +411,7 @@ static sal_uInt16 nTitleNo = 0;
pDesc->SetLandscape( rItem.eAlign >= ENV_VER_LEFT &&
rItem.eAlign <= ENV_VER_RGHT);
- // Page-Desc anwenden
+ // Apply page description
sal_uInt16 nPos;
pSh->FindPageDescByName( pDesc->GetName(),
@@ -445,17 +422,17 @@ static sal_uInt16 nTitleNo = 0;
pSh->ChgPageDesc( nPos, *pDesc);
pSh->ChgCurPageDesc(*pDesc);
- // Rahmen einfuegen
+ // Insert Frame
SwFlyFrmAttrMgr aMgr(sal_False, pSh, FRMMGR_TYPE_ENVELP);
SwFldMgr aFldMgr;
aMgr.SetHeightSizeType(ATT_VAR_SIZE);
- //Defaults ueberschreiben!
+ // Overwrite defaults!
aMgr.GetAttrSet().Put( SvxBoxItem(RES_BOX) );
aMgr.SetULSpace( 0L, 0L );
aMgr.SetLRSpace( 0L, 0L );
- // Absender
+ // Sender
if (rItem.bSend)
{
pSh->SttEndDoc(sal_True);
@@ -472,7 +449,7 @@ static sal_uInt16 nTitleNo = 0;
aMgr.UpdateAttrMgr();
}
- // Empfaenger
+ // Addressee
pSh->SttEndDoc(sal_True);
aMgr.InsertFlyFrm(FLY_AT_PAGE,
@@ -485,11 +462,11 @@ static sal_uInt16 nTitleNo = 0;
pSh->SetTxtFmtColl( pAddr );
InsertLabEnvText(*pSh, aFldMgr, rItem.aAddrText);
- // Flys auf die "alten" Seiten verschieben
+ // Move Flys to the "old" pages
if (aFlyArr.Count())
pSh->SetPageObjsNewPage(aFlyArr, 1);
- // Fertig
+ // Finished
pSh->SttEndDoc(sal_True);
pSh->EndAllAction();
@@ -505,7 +482,7 @@ static sal_uInt16 nTitleNo = 0;
if ( rItem.aAddrText.indexOf('<') >= 0 )
{
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 const aInva[] =
{
SID_SBA_BRW_UPDATE,
SID_SBA_BRW_INSERT,
@@ -514,7 +491,7 @@ static sal_uInt16 nTitleNo = 0;
};
pFrame->GetBindings().Invalidate( aInva );
- // Datenbankbeamer oeffnen
+ // Open database beamer
ShowDBObj(*pNewView, pSh->GetDBData());
}
}
@@ -528,14 +505,14 @@ static sal_uInt16 nTitleNo = 0;
rReq.Done();
}
- else //Abbruch
+ else // Abort
{
rReq.Ignore();
xDocSh->DoClose();
--nTitleNo;
- // Pointer auf oberste View restaurieren
+ // Set pointer to top view
if (pOldSh)
SetView(&pOldSh->GetView());
}
@@ -543,3 +520,4 @@ static sal_uInt16 nTitleNo = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 2b3b4b345dbc..0183d955ea18 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <hintids.hxx>
#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <tools/link.hxx>
#define _SVSTDARR_STRINGSDTOR
@@ -49,7 +50,6 @@
#include <svl/eitem.hxx>
#include <svl/whiter.hxx>
#include <svl/isethint.hxx>
-#include <svx/hyprlink.hxx>
#include <sfx2/request.hxx>
#include <sfx2/fcontnr.hxx>
#include <svl/stritem.hxx>
@@ -72,7 +72,7 @@
#include <srcview.hxx>
#include <wrtsh.hxx>
#include <docsh.hxx>
-#include <cmdid.h> // Funktion-Ids
+#include <cmdid.h> // Function-Ids
#include <initui.hxx>
#include <uitool.hxx>
#include <swmodule.hxx>
@@ -86,7 +86,7 @@
#include <cfgitems.hxx>
#include <prtopt.hxx>
#include <modcfg.hxx>
-#include <globals.h> // globale Konstanten z.B.
+#include <globals.h> // e.g. global Constants
#include <app.hrc>
#include <fontcfg.hxx>
#include <barcfg.hxx>
@@ -119,12 +119,12 @@
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Slotmaps fuer Methoden der Applikation
+ Description: Slotmaps for the application's methods
--------------------------------------------------------------------*/
-// hier werden die SlotID's included
-// siehe Idl-File
+// here are the SlotID's being included
+// see Idl-file
//
#define SwModule
#define ViewSettings
@@ -140,7 +140,6 @@ using namespace ::com::sun::star;
SFX_IMPL_INTERFACE( SwModule, SfxModule, SW_RES(RID_SW_NAME) )
{
- SFX_CHILDWINDOW_REGISTRATION(SvxHyperlinkDlgWrapper::GetChildWindowId());
SFX_STATUSBAR_REGISTRATION(SW_RES(CFG_STATUSBAR));
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION |
SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER,
@@ -149,7 +148,7 @@ SFX_IMPL_INTERFACE( SwModule, SfxModule, SW_RES(RID_SW_NAME) )
/*--------------------------------------------------------------------
- Beschreibung: Andere States
+ Description: other states
--------------------------------------------------------------------*/
@@ -206,15 +205,12 @@ void SwModule::StateOther(SfxItemSet &rSet)
IsInsTblFormatNum( bWebView )));
break;
default:
- DBG_ERROR("::StateOther: default");
+ OSL_FAIL("::StateOther: default");
}
nWhich = aIter.NextWhich();
}
}
-/*-- 06.04.2004 15:21:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwView* lcl_LoadDoc(SwView* pView, const String& rURL)
{
SwView* pNewView = 0;
@@ -260,7 +256,7 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL)
return pNewView;
}
/*--------------------------------------------------------------------
- Beschreibung: Felddialog starten
+ Description: start field dialog
--------------------------------------------------------------------*/
void NewXForms( SfxRequest& rReq ); // implementation: below
@@ -301,20 +297,20 @@ SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
{
- DBG_ASSERT( m_pWizard == 0, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
- DBG_ASSERT( m_pMMConfig == 0, "SwMailMergeWizardExecutor: m_pMMConfig must be Null!" );
+ OSL_ENSURE( m_pWizard == 0, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
+ OSL_ENSURE( m_pMMConfig == 0, "SwMailMergeWizardExecutor: m_pMMConfig must be Null!" );
}
void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs )
{
if ( m_pView )
{
- DBG_ERROR( "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
+ OSL_FAIL("SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
return;
}
m_pView = ::GetActiveView(); // not owner!
- DBG_ASSERT(m_pView, "no current view?");
+ OSL_ENSURE(m_pView, "no current view?");
if(m_pView)
{
// keep self alive until done.
@@ -335,7 +331,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs
m_pView->SetMailMergeConfigItem(0, 0, sal_True);
SfxViewFrame* pViewFrame = m_pView->GetViewFrame();
pViewFrame->ShowChildWindow(FN_MAILMERGE_CHILDWINDOW, sal_False);
- DBG_ASSERT(m_pMMConfig, "no MailMergeConfigItem available");
+ OSL_ENSURE(m_pMMConfig, "no MailMergeConfigItem available");
bRestoreWizard = true;
}
// to make it bullet proof ;-)
@@ -431,7 +427,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
#endif
{
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" );
+ OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" );
(void) pDialog;
#endif
@@ -473,7 +469,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
uno::Reference< frame::XFrame > xFrame =
m_pView->GetViewFrame()->GetFrame().GetFrameInterface();
xFrame->getContainerWindow()->setVisible(sal_False);
- DBG_ASSERT(pTargetView, "No target view has been created");
+ OSL_ENSURE(pTargetView, "No target view has been created");
if(pTargetView)
{
// destroy wizard asynchronously
@@ -489,7 +485,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
}
else
{
- //should not happen - just in case no target view has been created
+ // should not happen - just in case no target view has been created
ExecutionFinished( true );
}
break;
@@ -512,7 +508,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
{
SwView* pTargetView = m_pMMConfig->GetTargetView();
SwView* pSourceView = m_pMMConfig->GetSourceView();
- DBG_ASSERT(pTargetView && pSourceView, "source or target view not available" );
+ OSL_ENSURE(pTargetView && pSourceView, "source or target view not available" );
if(pTargetView && pSourceView)
{
m_pView2Close = pTargetView;
@@ -535,7 +531,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
}
else
{
- //should not happen - just in case no target view has been created
+ // should not happen - just in case no target view has been created
ExecutionFinished( true );
}
break;
@@ -547,7 +543,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM
LINK( this, SwMailMergeWizardExecutor, CancelHdl ), m_pWizard );
break;
}
- default: //finish
+ default: // finish
{
SwView* pSourceView = m_pMMConfig->GetSourceView();
if(pSourceView)
@@ -682,11 +678,11 @@ void SwModule::ExecOther(SfxRequest& rReq)
}
/*--------------------------------------------------------------------
- Beschreibung: Notifies abfangen
+ Description: Catch notifications
--------------------------------------------------------------------*/
- // Hint abfangen fuer DocInfo
+// Catch hint for DocInfo
void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if( rHint.ISA( SfxEventHint ) )
@@ -712,8 +708,8 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
pDocSh->GetDoc()->SetFixFields(false, 0);
}
}
- break;
case SFX_EVENT_CREATEDOC:
+ // Update all FIX-Date/Time fields
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
@@ -724,14 +720,14 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
pWrtSh->UpdateInputFlds();
- // Sind Datenbankfelder enthalten?
- // Erstmal alle verwendeten Datenbanken holen
+ // Are database fields contained?
+ // Get all used databases for the first time
SwDoc *pDoc = pDocSh->GetDoc();
SvStringsDtor aDBNameList;
pDoc->GetAllUsedDB( aDBNameList );
sal_uInt16 nCount = aDBNameList.Count();
if (nCount)
- { // Datenbankbeamer oeffnen
+ { // Open database beamer
ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData());
}
}
@@ -807,6 +803,7 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
sal_Int32 const nNew = GetUndoOptions().GetUndoCount();
bool const bUndo = (nNew != 0);
// switch Undo for all DocShells
+ // Iterate through DocShells and switch undos
TypeId aType(TYPE(SwDocShell));
SwDocShell * pDocShell =
static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType));
@@ -870,18 +867,13 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
}
-/* -----------------------------20.02.01 12:43--------------------------------
-
- ---------------------------------------------------------------------------*/
SwDBConfig* SwModule::GetDBConfig()
{
if(!pDBConfig)
pDBConfig = new SwDBConfig;
return pDBConfig;
}
-/* -----------------------------11.04.2002 15:27------------------------------
- ---------------------------------------------------------------------------*/
svtools::ColorConfig& SwModule::GetColorConfig()
{
if(!pColorConfig)
@@ -892,9 +884,7 @@ svtools::ColorConfig& SwModule::GetColorConfig()
}
return *pColorConfig;
}
-/* -----------------------------06.05.2002 09:42------------------------------
- ---------------------------------------------------------------------------*/
SvtAccessibilityOptions& SwModule::GetAccessibilityOptions()
{
if(!pAccessibilityOptions)
@@ -904,9 +894,7 @@ SvtAccessibilityOptions& SwModule::GetAccessibilityOptions()
}
return *pAccessibilityOptions;
}
-/* -----------------06.05.2003 14:52-----------------
- --------------------------------------------------*/
SvtCTLOptions& SwModule::GetCTLOptions()
{
if(!pCTLOptions)
@@ -916,9 +904,7 @@ SvtCTLOptions& SwModule::GetCTLOptions()
}
return *pCTLOptions;
}
-/* -----------------07.07.2003 09:31-----------------
- --------------------------------------------------*/
SvtUserOptions& SwModule::GetUserOptions()
{
if(!pUserOptions)
@@ -928,9 +914,7 @@ SvtUserOptions& SwModule::GetUserOptions()
}
return *pUserOptions;
}
-/* -----------------18.07.2003 13:31-----------------
- --------------------------------------------------*/
SvtUndoOptions& SwModule::GetUndoOptions()
{
if(!pUndoOptions)
@@ -940,16 +924,14 @@ SvtUndoOptions& SwModule::GetUndoOptions()
}
return *pUndoOptions;
}
-/*-----------------30.01.97 08.30-------------------
---------------------------------------------------*/
const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const
{
SwModule* pNonConstModule = (SwModule*)this;
if(bWeb && !pWebUsrPref)
{
- // im Load der SwMasterUsrPref wird der SpellChecker gebraucht, dort darf
- // er aber nicht angelegt werden #58256#
+ // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
+ // be created there #58256#
pNonConstModule->pWebUsrPref = new SwMasterUsrPref(sal_True);
}
else if(!bWeb && !pUsrPref)
@@ -978,3 +960,5 @@ void NewXForms( SfxRequest& rReq )
// set return value
rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 1bbdfc71eeb4..69623ddf05d2 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#if STLPORT_VERSION>=321
#include <cstdarg>
-#endif
-
#include <hintids.hxx>
@@ -78,12 +75,8 @@
#include <pagedesc.hxx>
#include <poolfmt.hxx>
-#ifndef _APP_HRC
#include <app.hrc>
-#endif
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include "swabstdlg.hxx"
#include "envelp.hrc"
#include <misc.hrc>
@@ -93,12 +86,10 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-// steht im appenv.cxx
+// is in appenv.cxx
extern String InsertLabEnvText( SwWrtShell& , SwFldMgr& , const String& );
-const char __FAR_DATA MASTER_LABEL[] = "MasterLabel";
-
-// --------------------------------------------------------------------------
+const char MASTER_LABEL[] = "MasterLabel";
const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem,
SwFrmFmt &rFmt,
@@ -117,18 +108,17 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem,
aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist,
text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
}
- const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen
- ASSERT( pFmt, "Fly not inserted" );
+ const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly
+ OSL_ENSURE( pFmt, "Fly not inserted" );
- rSh.UnSelectFrm(); //Rahmen wurde automatisch selektiert
+ rSh.UnSelectFrm(); //Frame was selected automatically
rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
- //
if(!rItem.bSynchron || !(nCol|nRow))
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( rItem.sGlossaryGroup );
@@ -157,14 +147,14 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist,
text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
}
- const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen
- ASSERT( pFmt, "Fly not inserted" );
+ const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly
+ OSL_ENSURE( pFmt, "Fly not inserted" );
- rSh.UnSelectFrm(); //Rahmen wurde automatisch selektiert
+ rSh.UnSelectFrm(); //Frame was selected automatically
rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
- // Ggf. "Naechster Datensatz"
+ // If applicable "next dataset"
String sDBName;
if( (!rItem.bSynchron || !(nCol|nRow)) && (sDBName = InsertLabEnvText( rSh, rFldMgr, rItem.aWriting )).Len() && !bLast )
{
@@ -176,43 +166,41 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
return pFmt;
}
-// ----------------------------------------------------------------------------
-
void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
{
-static sal_uInt16 nLabelTitleNo = 0;
-static sal_uInt16 nBCTitleNo = 0;
+ static sal_uInt16 nLabelTitleNo = 0;
+ static sal_uInt16 nBCTitleNo = 0;
- // DB-Manager anlegen
+ // Create DB-Manager
SwNewDBMgr* pNewDBMgr = new SwNewDBMgr;
- // SwLabItem aus Config lesen
+ // Read SwLabItem from Config
SwLabCfgItem aLabCfg(bLabel);
- // Dialog hochfahren
+ // Move up Dialog
SfxItemSet aSet( GetPool(), FN_LABEL, FN_LABEL, 0 );
aSet.Put( aLabCfg.GetItem() );
SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pDialogFactory, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!");
- AbstarctSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg( 0, aSet, pNewDBMgr, bLabel, DLG_LAB );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ AbstractSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg( 0, aSet, pNewDBMgr, bLabel, DLG_LAB );
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( RET_OK == pDlg->Execute() )
{
- // Dialog auslesen, Item in Config speichern
+ // Read dialog, store item in config
const SwLabItem& rItem = (const SwLabItem&) pDlg->
GetOutputItemSet()->Get(FN_LABEL);
aLabCfg.GetItem() = rItem;
aLabCfg.Commit();
- // Neues Dokument erzeugen.
+ // Create new document
SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD));
xDocSh->DoInitNew( 0 );
- // Drucker
+ // Printer
Printer *pPrt = pDlg->GetPrt();
if (pPrt)
{
@@ -223,9 +211,9 @@ static sal_uInt16 nBCTitleNo = 0;
SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
SwView *pNewView = (SwView*) pViewFrame->GetViewShell();
- pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird.
+ pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );// So that SelectShell is being called.
- // Dokumenttitel setzen
+ // Set document title
String aTmp;
if(bLabel)
{
@@ -241,9 +229,9 @@ static sal_uInt16 nBCTitleNo = 0;
pViewFrame->GetFrame().Appear();
- // Shell ermitteln
+ // Determine Shell
SwWrtShell *pSh = pNewView->GetWrtShellPtr();
- ASSERT( pSh, "missing WrtShell" );
+ OSL_ENSURE( pSh, "missing WrtShell" );
{ // block for locks the dispatcher!!
@@ -254,12 +242,12 @@ static sal_uInt16 nBCTitleNo = 0;
pSh->DoUndo( sal_False );
pSh->StartAllAction();
- pSh->SetNewDoc(); // Performanceprobleme vermeiden
+ pSh->SetNewDoc(); // Avoid performance problems
SwPageDesc aDesc = pSh->GetPageDesc( 0 );
SwFrmFmt& rFmt = aDesc.GetMaster();
- // Raender
+ // Borders
SvxLRSpaceItem aLRMargin( RES_LR_SPACE );
SvxULSpaceItem aULMargin( RES_UL_SPACE );
aLRMargin.SetLeft ((sal_uInt16) rItem.lLeft );
@@ -269,26 +257,26 @@ static sal_uInt16 nBCTitleNo = 0;
rFmt.SetFmtAttr(aLRMargin);
rFmt.SetFmtAttr(aULMargin);
- // Kopf- und Fusszeilen
+ // Header and footer
rFmt.SetFmtAttr(SwFmtHeader(sal_Bool(sal_False)));
aDesc.ChgHeaderShare(sal_False);
rFmt.SetFmtAttr(SwFmtFooter(sal_Bool(sal_False)));
aDesc.ChgFooterShare(sal_False);
- aDesc.SetUseOn(nsUseOnPage::PD_ALL); // Seitennumerierung
+ aDesc.SetUseOn(nsUseOnPage::PD_ALL); // Site numbering
- // Einstellen der Seitengroesse
+ // Set page size
rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE,
rItem.lLeft + rItem.nCols * rItem.lHDist + MINLAY,
rItem.lUpper + rItem.nRows * rItem.lVDist + MINLAY));
- // Numerierungsart
+ // Numbering type
SvxNumberType aType;
aType.SetNumberingType(SVX_NUM_NUMBER_NONE);
aDesc.SetNumType( aType );
- // Folgevorlage
+ // Followup template
const SwPageDesc &rFollow = pSh->GetPageDesc( pSh->GetCurPageDesc() );
aDesc.SetFollow( &rFollow );
@@ -297,23 +285,22 @@ static sal_uInt16 nBCTitleNo = 0;
aItem.SetValue((sal_Int8)pPrt->GetPaperBin());
rFmt.SetFmtAttr(aItem);
- //determine orientation by calculating the width and height of the resulting page
+ // Determine orientation by calculating the width and height of the resulting page
const int nResultWidth = rItem.lHDist * (rItem.nCols - 1) + rItem.lWidth + rItem.lLeft;
const int nResultHeight = rItem.lVDist * (rItem.nRows - 1) + rItem.lHeight + rItem.lUpper;
aDesc.SetLandscape(nResultWidth > nResultHeight);
pSh->ChgPageDesc( 0, aDesc );
- // Rahmen einfuegen
+ // Insert frame
SwFldMgr* pFldMgr = new SwFldMgr;
pFldMgr->SetEvalExpFlds(sal_False);
- //fix(24446): Damit der Text der Ettiketten nicht im unbedruckbaren
- //Bereich landet stellen wir entsprechende Raender ein. Um das Handling
- //so Optimal wie moeglich zu halten stellen wir zunaechst an der
- //aktuellen Absatzvorlage keinen Rand als hartes Attribut ein (Damit die
- //Formatierung wg. der Zeichengeb. Rahmen passt. Dann stellen wir die
- //Standarabsatzvorlage anhand des unbedruckbaren Bereiches ein.
+ //fix(24446): To avoid that labels end up in unprintable area, we set
+ //borders accordingly. To keep the handling as good as possible, we
+ //don't set any border as hard attribute at the current paragraph template
+ //(so that formating works, because of character-bound borders). Then
+ //we set the default paragraph template using the unprintable area.
const long nMin = pPrt->GetPageOffset().X() - rItem.lLeft;
if ( nMin > 0 )
{
@@ -325,7 +312,7 @@ static sal_uInt16 nBCTitleNo = 0;
pStandard->SetFmtAttr( aLR );
}
- // Rahmenvorlage vorbereiten
+ // Prepare border template
SwFrmFmt* pFmt = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL );
SwFmtFrmSize aFrmSize( ATT_FIX_SIZE,
rItem.lHDist - (rItem.lHDist-rItem.lWidth),
@@ -392,15 +379,15 @@ static sal_uInt16 nBCTitleNo = 0;
sLinkName += String::CreateFromAscii(MASTER_LABEL);
aSect.SetLinkFileName(sLinkName);
aSect.SetProtectFlag(true);
- pSh->Insert(aDotStr); // Dummytext zum Zuweisen der Section
+ pSh->Insert(aDotStr); // Dummytext to allocate the Section
pSh->SttDoc();
- pSh->EndDoc(sal_True); // Alles im Rahmen selektieren
+ pSh->EndDoc(sal_True); // Select everything in the frame
pSh->InsertSection(aSect);
}
pSh->Pop( sal_False );
}
if ( i + 1 != rItem.nRows )
- pSh->SplitNode(); // Kleine Optimierung
+ pSh->SplitNode(); // Small optimisation
}
}
else
@@ -418,7 +405,7 @@ static sal_uInt16 nBCTitleNo = 0;
if(!bLabel)
{
uno::Reference< frame::XModel > xModel = pSh->GetView().GetDocShell()->GetBaseModel();
- DBG_ASSERT(pDialogFactory, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!");
SwLabDlgMethod SwLabDlgUpdateFieldInformation = pDialogFactory->GetSwLabDlgStaticMethod ();
SwLabDlgUpdateFieldInformation(xModel, rItem);
}
@@ -436,14 +423,14 @@ static sal_uInt16 nBCTitleNo = 0;
if( rItem.aWriting.indexOf( '<' ) >= 0 )
{
- // Datenbankbrowser mit zuletzt verwendeter Datenbank oeffnen
+ // Open database browser on recently used database
ShowDBObj( *pNewView, pSh->GetDBData() );
}
if( rItem.bSynchron )
{
SfxDispatcher* pDisp = pViewFrame->GetDispatcher();
- ASSERT(pDisp, "Heute kein Dispatcher am Frame?");
+ OSL_ENSURE(pDisp, "No dispatcher in frame?");
pDisp->Execute(FN_SYNC_LABELS, SFX_CALLMODE_ASYNCHRON);
}
rReq.SetReturnValue(SfxVoidItem(bLabel ? FN_LABEL : FN_BUSINESS_CARD));
@@ -455,3 +442,4 @@ static sal_uInt16 nBCTitleNo = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index ca39c1330790..6ab953e62193 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <cmdid.h> // Function-Ids
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
@@ -58,8 +60,8 @@
#include <wrtsh.hxx>
#include <IDocumentDeviceAccess.hxx>
#include <uitool.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
-#include <fldbas.hxx> //fuer UpdateFields
+#include <initui.hxx> // for ::GetGlossaries()
+#include <fldbas.hxx> //for UpdateFields
#include <wview.hxx>
#include <cfgitems.hxx>
#include <prtopt.hxx>
@@ -72,7 +74,7 @@
#include <unotools/lingucfg.hxx>
#include <editeng/unolingu.hxx>
#include <globals.hrc>
-#include <globals.h> // globale Konstanten z.B.
+#include <globals.h> // e.g. global Constants
#include <svl/slstitm.hxx>
#include "swabstdlg.hxx"
#include <swwrtshitem.hxx>
@@ -82,37 +84,31 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-/* -----------------12.02.99 12:28-------------------
- *
- * --------------------------------------------------*/
-
SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
{
sal_Bool bTextDialog = (nId == SID_SW_EDITOPTIONS) ? sal_True : sal_False;
- // hier werden die Optionen fuer die Web- und den Textdialog zusmmengesetzt
+ // the options for the Web- and Textdialog are put together here
SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
SwMasterUsrPref* pPref = bTextDialog ? pUsrPref : pWebUsrPref;
- //kein MakeUsrPref, da hier nur die Optionen von Textdoks genommen werden duerfen
+ // no MakeUsrPref, because only options from textdoks can be used here
SwView* pAppView = GetView();
if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
pAppView = 0;
if(pAppView)
{
- // wenn Text dann nicht WebView und umgekehrt
+ // if Text then no WebView and vice versa
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
if( (bWebView && !bTextDialog) ||(!bWebView && bTextDialog))
{
aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
}
else
- pAppView = 0; // mit View kann hier nichts gewonnen werden
+ pAppView = 0; // with View, there's nothing to win here
}
/********************************************************************/
- /* */
- /* Optionen/Bearbeiten */
- /* */
+ /* Options/Edit */
/********************************************************************/
SfxItemSet* pRet = new SfxItemSet (GetPool(), FN_PARAM_DOCDISP, FN_PARAM_ELEM,
SID_PRINTPREVIEW, SID_PRINTPREVIEW,
@@ -121,6 +117,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL,
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_ATTR_METRIC, SID_ATTR_METRIC,
+ SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
RES_BACKGROUND, RES_BACKGROUND,
SID_HTML_MODE, SID_HTML_MODE,
@@ -130,7 +127,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE,
SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
FN_PARAM_SWTEST, FN_PARAM_SWTEST,
#endif
0);
@@ -163,32 +160,23 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
}
else
{
-/* Der Drucker wird jetzt von der TabPage erzeugt und auch geloescht
- * SfxItemSet* pSet = new SfxItemSet( SFX_APP()->GetPool(),
- SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
- SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
- 0 );
-
- pPrt = new SfxPrinter(pSet);
- pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));*/
-
SvtLinguConfig aLinguCfg;
Locale aLocale;
LanguageType nLang;
using namespace ::com::sun::star::i18n::ScriptType;
- Any aLang = aLinguCfg.GetProperty(C2U("DefaultLocale"));
+ Any aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale")));
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN);
pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
- aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CJK"));
+ aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CJK")));
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN);
pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
- aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CTL"));
+ aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CTL")));
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX);
pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
@@ -211,6 +199,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
pAppView->GetVLinealMetric(eUnit);
pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
+ pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
if(bTextDialog)
{
if(pAppView)
@@ -224,10 +213,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)pPref->GetDefTab()));
}
- /*-----------------01.02.97 11.13-------------------
- Optionen fuer GridTabPage
- --------------------------------------------------*/
-
+ // Options for GridTabPage
SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
@@ -243,9 +229,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
pRet->Put(aGridItem);
- /*-----------------01.02.97 13.02-------------------
- Optionen fuer PrintTabPage
- --------------------------------------------------*/
+ // Options for PrintTabPage
const SwPrintData* pOpt = pAppView ?
&pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() :
0;
@@ -256,42 +240,17 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, *pOpt );
pRet->Put(aAddPrinterItem);
- /*-----------------01.02.97 13.12-------------------
- Optionen fuer Web-Hintergrund
- --------------------------------------------------*/
+ // Options for Web background
if(!bTextDialog)
{
pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
}
-#ifdef DBG_UTIL
- /*-----------------01.02.97 13.02-------------------
- Test-Optionen
- --------------------------------------------------*/
- SwTestItem aTestItem(FN_PARAM_SWTEST);
- aTestItem.bTest1 = aViewOpt.IsTest1();
- aTestItem.bTest2 = aViewOpt.IsTest2();
- aTestItem.bTest3 = aViewOpt.IsTest3();
- aTestItem.bTest4 = aViewOpt.IsTest4();
- aTestItem.bTest5 = aViewOpt.IsTest5();
- aTestItem.bTest6 = aViewOpt.IsTest6();
- aTestItem.bTest7 = aViewOpt.IsTest7();
- aTestItem.bTest8 = aViewOpt.IsTest8();
- aTestItem.bTest9 = SwViewOption::IsTest9();
- aTestItem.bTest10 = aViewOpt.IsTest10();
- pRet->Put(aTestItem);
-#endif
- /*-----------------01.02.97 13.04-------------------
-
- --------------------------------------------------*/
if(!bTextDialog)
pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
-// delete pPrt;
return pRet;
}
-/* -----------------12.02.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
{
sal_Bool bTextDialog = nId == SID_SW_EDITOPTIONS;
@@ -303,7 +262,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
// the text dialog mustn't apply data to the web view and vice versa
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
if( (bWebView == bTextDialog))
- pAppView = 0; //
+ pAppView = 0;
}
SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
@@ -314,7 +273,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
: NULL;
/*---------------------------------------------------------------------
- Seite Dokumentansicht auswerten
+ Interpret the page Documentview
-----------------------------------------------------------------------*/
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, &pItem ))
{
@@ -342,7 +301,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
/*---------------------------------------------------------------------
- Elemente - Item auswerten
+ Elements - interpret Item
-----------------------------------------------------------------------*/
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, sal_False, &pItem ) )
@@ -358,6 +317,14 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog);
}
+ if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
+ sal_False, &pItem ) )
+ {
+ SFX_APP()->SetOptions(rSet);
+ const SfxBoolItem* pCharItem = (const SfxBoolItem*)pItem;
+ ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
+ }
+
if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, sal_False, &pItem ) )
{
const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
@@ -389,8 +356,8 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
- /*-----------------01.02.97 11.36-------------------
- Hintergrund nur im WebDialog
+ /*------------------------------------------------
+ Background only in WebDialog
--------------------------------------------------*/
if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND))
{
@@ -400,7 +367,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
/*--------------------------------------------------------------------
- Seite Rastereinstellungen auswerten
+ Interpret page Grid Settings
----------------------------------------------------------------------*/
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, sal_False, &pItem ))
@@ -429,9 +396,9 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
}
- //--------------------------------------------------------------------------
- // Writer Drucker Zusatzeinstellungen auswerten
- //----------------------------------------------------------------------------
+ /*--------------------------------------------------------------------
+ Interpret Writer Printer Options
+ ----------------------------------------------------------------------*/
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, sal_False, &pItem ))
{
@@ -471,33 +438,10 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
-#ifdef DBG_UTIL
- /*--------------------------------------------------------------------------
- Writer Testseite auswerten
- ----------------------------------------------------------------------------*/
-
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_SWTEST, sal_False, &pItem ))
- {
- const SwTestItem* pTestItem = (const SwTestItem*)pItem;
- aViewOpt.SetTest1((sal_Bool)pTestItem->bTest1);
- aViewOpt.SetTest2((sal_Bool)pTestItem->bTest2);
- aViewOpt.SetTest3((sal_Bool)pTestItem->bTest3);
- aViewOpt.SetTest4((sal_Bool)pTestItem->bTest4);
- aViewOpt.SetTest5((sal_Bool)pTestItem->bTest5);
- aViewOpt.SetTest6((sal_Bool)pTestItem->bTest6);
- aViewOpt.SetTest7((sal_Bool)pTestItem->bTest7);
- aViewOpt.SetTest8((sal_Bool)pTestItem->bTest8);
- SwViewOption::SetTest9((sal_Bool)pTestItem->bTest9);
- aViewOpt.SetTest10((sal_Bool)pTestItem->bTest10);
- }
-#endif
- // dann an der akt. View und Shell die entsp. Elemente setzen
+ // set elements for the current view and shell
ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB);
}
-/* -----------------12.02.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet )
{
SfxTabPage* pRet = NULL;
@@ -566,7 +510,7 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
SwView* pCurrView = GetView();
if(pCurrView)
{
- // wenn Text dann nicht WebView und umgekehrt
+ // if text then not WebView and vice versa
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pCurrView);
if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
(!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
@@ -602,7 +546,7 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
}
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
case RID_SW_TP_OPTTEST_PAGE:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
@@ -640,7 +584,9 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
break;
}
- DBG_ASSERT( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" );
+ OSL_ENSURE( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" );
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 9dc59a4aca19..cd1b81d58c40 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,11 +68,11 @@
#include <swwait.hxx>
#include <printdata.hxx>
#include <frmatr.hxx>
-#include <view.hxx> // fuer die aktuelle Sicht
+#include <view.hxx> // for the current view
#include <edtwin.hxx>
#include <PostItMgr.hxx>
-#include <wrtsh.hxx> // Verbindung zur Core
-#include <docsh.hxx> // Dokumenterzeugung
+#include <wrtsh.hxx> // connection to Core
+#include <docsh.hxx> // document creation
#include <basesh.hxx>
#include <viewopt.hxx>
#include <wdocsh.hxx>
@@ -95,14 +96,13 @@
#include <ftnidx.hxx>
#include <fldbas.hxx>
#include <docary.hxx>
-#include <swerror.h> // Fehlermeldungen
+#include <swerror.h> // Error messages
#include <helpid.h>
#include <cmdid.h>
#include <globals.hrc>
#include <app.hrc>
#include <cfgid.h>
-#include <unotools/moduleoptions.hxx>
#include <unotools/fltrcfg.hxx>
#include <svtools/htmlcfg.hxx>
#include <sfx2/fcontnr.hxx>
@@ -131,7 +131,6 @@ using namespace ::com::sun::star::container;
SFX_IMPL_INTERFACE( SwDocShell, SfxObjectShell, SW_RES(0) )
{
- SFX_CHILDWINDOW_REGISTRATION( SID_HYPERLINK_INSERT );
}
TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener);
@@ -140,7 +139,7 @@ TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener);
SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter" )
/*--------------------------------------------------------------------
- Beschreibung: Laden vorbereiten
+ Description: Prepare loading
--------------------------------------------------------------------*/
@@ -181,7 +180,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
else
return 0;
- // PassWord Checken
+ // Check password
String aPasswd;
if ((*ppRdr)->NeedsPasswd( *pRead ))
{
@@ -233,7 +232,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
}
/*--------------------------------------------------------------------
- Beschreibung: Laden
+ Description: Loading
--------------------------------------------------------------------*/
sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
@@ -248,7 +247,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
SwWait aWait( *this, sal_True );
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // Suppress SfxProgress, when we are Embedded
SW_MOD()->SetEmbeddedLoadSave(
SFX_CREATE_MODE_EMBEDDED == GetCreateMode() );
@@ -259,7 +258,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
sal_uLong nErr = pRdr->Read( *pRead );
- // Evtl. ein altes Doc weg
+ // Maybe put away one old Doc
if ( pDoc != pRdr->GetDoc() )
{
if( pDoc )
@@ -282,16 +281,10 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
sal_Bool bOk = !IsError( nErr );
- // --> OD 2006-11-07 #i59688#
-// // StartFinishedLoading rufen. Nicht bei asynchronen Filtern!
-// // Diese muessen das selbst rufen!
-// if( bOk && !pDoc->IsInLoadAsynchron() )
-// StartLoadFinishedTimer();
if ( bOk && !pDoc->IsInLoadAsynchron() )
{
LoadingFinished();
}
- // <--
pRead->setSotStorageRef(pStg); // #i45333# save sot storage ref in case of recursive calls
@@ -299,7 +292,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
}
/*--------------------------------------------------------------------
- Beschreibung: Sichern des Default-Formats, Stg vorhanden
+ Description: Saving the Default-Format, Stg present
--------------------------------------------------------------------*/
@@ -312,7 +305,7 @@ sal_Bool SwDocShell::Save()
SwWait aWait( *this, sal_True );
CalcLayoutForOLEObjects(); // format for OLE objets
- // --> OD 2006-03-17 #i62875#
+ // #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
@@ -320,7 +313,6 @@ sal_Bool SwDocShell::Save()
{
pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
- // <--
sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
if( SfxObjectShell::Save() )
@@ -343,9 +335,9 @@ sal_Bool SwDocShell::Save()
break;
case SFX_CREATE_MODE_EMBEDDED:
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // Suppress SfxProgress, if we are Embedded
SW_MOD()->SetEmbeddedLoadSave( sal_True );
- // kein break;
+ // no break;
case SFX_CREATE_MODE_STANDARD:
case SFX_CREATE_MODE_PREVIEW:
@@ -353,15 +345,12 @@ sal_Bool SwDocShell::Save()
{
if( pDoc->ContainsMSVBasic() )
{
- //TODO/MBA: it looks as that this code can be removed!
- //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() );
- //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr );
if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) );
pDoc->SetContainsMSVBasic( sal_False );
}
- // TabellenBox Edit beenden!
+ // End TableBox Edit!
if( pWrtShell )
pWrtShell->EndAllTblBoxEdit();
@@ -396,7 +385,7 @@ sal_Bool SwDocShell::Save()
}
/*--------------------------------------------------------------------
- Beschreibung: Sichern im Defaultformat
+ Description: Save using the Defaultformat
--------------------------------------------------------------------*/
@@ -436,14 +425,14 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps
= xDPS->getDocumentProperties();
- xDocProps->setTemplateName(::rtl::OUString::createFromAscii(""));
- xDocProps->setTemplateURL(::rtl::OUString::createFromAscii(""));
+ xDocProps->setTemplateName(::rtl::OUString());
+ xDocProps->setTemplateURL(::rtl::OUString());
xDocProps->setTemplateDate(::util::DateTime());
}
}
CalcLayoutForOLEObjects(); // format for OLE objets
- // --> OD 2006-03-17 #i62875#
+ // #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
@@ -451,7 +440,6 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
{
pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
- // <--
sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage();
@@ -477,26 +465,23 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
if( pDoc->ContainsMSVBasic() )
{
- //TODO/MBA: it looks as that this code can be removed!
- //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() );
- //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr );
if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this );
pDoc->SetContainsMSVBasic( sal_False );
}
- // TabellenBox Edit beenden!
+ // End TableBox Edit!
if( pWrtShell )
pWrtShell->EndAllTblBoxEdit();
- // Modified-Flag merken und erhalten ohne den Link zu Callen
- // (fuer OLE; nach Anweisung von MM)
+ // Remember and preserve Modified-Flag without calling the Link
+ // (for OLE; after Statement from MM)
sal_Bool bIsModified = pDoc->IsModified();
pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
Link aOldOLELnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // Suppress SfxProgress when we are Embedded
SW_MOD()->SetEmbeddedLoadSave(
SFX_CREATE_MODE_EMBEDDED == GetCreateMode() );
@@ -531,11 +516,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
}
/*--------------------------------------------------------------------
- Beschreibung: Sichern aller Formate
+ Description: Save all Formats
--------------------------------------------------------------------*/
SwSrcView* lcl_GetSourceView( SwDocShell* pSh )
{
- // sind wir in der SourceView?
+ // are we in SourceView?
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( pSh );
SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : 0;
return PTR_CAST( SwSrcView, pViewShell);
@@ -551,7 +536,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
WriterRef xWriter;
SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter );
if( !xWriter.Is() )
- { // Der Filter ist nicht vorhanden
+ { // Filter not available
InfoBox( 0,
SW_RESSTR(STR_DLLNOTFOUND) ).Execute();
return sal_False;
@@ -579,7 +564,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if ( bSave )
{
SvStorageRef xStg = new SotStorage( rMedium.GetOutStream(), sal_False );
- DBG_ASSERT( !xStg->GetError(), "No storage available for storing VBA macros!" );
+ OSL_ENSURE( !xStg->GetError(), "No storage available for storing VBA macros!" );
if ( !xStg->GetError() )
{
nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") );
@@ -589,14 +574,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
}
- // TabellenBox Edit beenden!
+ // End TableBox Edit!
if( pWrtShell )
pWrtShell->EndAllTblBoxEdit();
if( pFlt->GetUserData().EqualsAscii( "HTML") )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( !pHtmlOpt->IsStarBasic() && pHtmlOpt->IsStarBasicWarning() && HasBasic() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
{
uno::Reference< XLibraryContainer > xLibCont(GetBasicContainer(), UNO_QUERY);
uno::Reference< XNameAccess > xLib;
@@ -620,12 +605,12 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
UpdateDocInfoForSave();
}
- // --> FME 2007-5-7 #i76360# Update document statistics
+ // #i76360# Update document statistics
SwDocStat aDocStat( pDoc->GetDocStat() );;
pDoc->UpdateDocStat( aDocStat );
- // <--
+
CalcLayoutForOLEObjects(); // format for OLE objets
- // --> OD 2006-03-17 #i62875#
+ // #i62875#
// reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
if ( pWrtShell && pDoc &&
pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
@@ -633,7 +618,6 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
{
pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
- // <--
if( xWriter->IsStgWriter() &&
( /*xWriter->IsSw3Writer() ||*/
@@ -641,14 +625,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
pFlt->GetUserData().EqualsAscii( FILTER_XMLV ) ||
pFlt->GetUserData().EqualsAscii( FILTER_XMLVW ) ) )
{
- // eigenen Typ ermitteln
+ // determine the own Type
sal_uInt8 nMyType = 0;
if( ISA( SwWebDocShell) )
nMyType = 1;
else if( ISA( SwGlobalDocShell) )
nMyType = 2;
- // gewuenschten Typ ermitteln
+ // determine the desired Type
sal_uInt8 nSaveType = 0;
sal_uLong nSaveClipId = pFlt->GetFormat();
if( SOT_FORMATSTR_ID_STARWRITERWEB_8 == nSaveClipId ||
@@ -662,7 +646,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
SOT_FORMATSTR_ID_STARWRITERGLOB_40 == nSaveClipId )
nSaveType = 2;
- // Flags am Dokument entsprechend umsetzen
+ // Change Flags of the Document accordingly
sal_Bool bIsHTMLModeSave = GetDoc()->get(IDocumentSettingAccess::HTML_MODE);
sal_Bool bIsGlobalDocSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT);
sal_Bool bIsGlblDocSaveLinksSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS);
@@ -684,14 +668,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
// TODO/MBA: testing
uno::Reference < beans::XPropertySet > xSet( rMedium.GetStorage(), uno::UNO_QUERY );
if ( xSet.is() )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("MediaType"), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) );
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) );
}
catch ( uno::Exception& )
{
}
}
- // Jetzt das Dokument normal speichern
+ // Now normally save the Document
sal_Bool bRet = SaveAs( rMedium );
if( nMyType != nSaveType )
@@ -723,40 +707,37 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
xWriter->SetAsciiOptions( aOpt );
}
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // Suppress SfxProgress when we are Embedded
SW_MOD()->SetEmbeddedLoadSave(
SFX_CREATE_MODE_EMBEDDED == GetCreateMode());
- // Kontext aufspannen, um die Anzeige der Selektion zu unterbinden
+ // Span Context in order to suppress the Selection's View
sal_uLong nErrno;
String aFileName( rMedium.GetName() );
- //Keine View also das ganze Dokument!
+ // No View, so the whole Document!
if ( pWrtShell )
{
SwWait aWait( *this, sal_True );
- // --> OD 2009-12-31 #i106906#
+ // #i106906#
const sal_Bool bFormerLockView = pWrtShell->IsViewLocked();
pWrtShell->LockView( sal_True );
- // <--
pWrtShell->StartAllAction();
pWrtShell->Push();
SwWriter aWrt( rMedium, *pWrtShell, sal_True );
nErrno = aWrt.Write( xWriter, &aFileName );
- //JP 16.05.97: falls der SFX uns die View waehrend des speicherns
- // entzieht
+ //JP 16.05.97: In case the SFX revokes the View while saving
if( pWrtShell )
{
pWrtShell->Pop(sal_False);
pWrtShell->EndAllAction();
- // --> OD 2009-12-31 #i106906#
+ // #i106906#
pWrtShell->LockView( bFormerLockView );
- // <--
}
}
else
{
- // sind wir in der SourceView?
+ // are we in SourceView?
SwSrcView* pSrcView = ::lcl_GetSourceView( this );
if( pSrcView )
{
@@ -779,12 +760,12 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
/*--------------------------------------------------------------------
- Beschreibung: Haende weg
+ Description: Hands off
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
- Beschreibung: ??? noch nicht zu aktivieren, muss sal_True liefern
+ Description: ??? do not yet activate, must deliver TRUE
--------------------------------------------------------------------*/
@@ -794,7 +775,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
sal_Bool bRet = SfxObjectShell::SaveCompleted( xStor );
if( bRet )
{
- // erst hier entscheiden, ob das Speichern geklappt hat oder nicht
+ // Do not decide until here, whether Saving was successful or not
if( IsModified() )
pDoc->SetModified();
else
@@ -812,12 +793,8 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
{
if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
{
- DBG_ERROR( "Copying of objects didn't work!" );
+ OSL_FAIL("Copying of objects didn't work!" );
}
-
- //SvPersist* pPersist = this;
- //SvInfoObjectRef aRef( pInfList->GetObject( --n ));
- //pPersist->Move( &aRef, aRef->GetStorageName() );
}
DELETEZ( pOLEChildList );
@@ -828,26 +805,26 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
}
/*--------------------------------------------------------------------
- Beschreibung: Draw()-Overload fuer OLE2 (Sfx)
+ Description: Draw()-Overload for OLE2 (Sfx)
--------------------------------------------------------------------*/
void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
sal_uInt16 nAspect )
{
- //fix #25341# Draw sollte das Modified nicht beeinflussen
+ //fix #25341# Draw should not affect the Modified
sal_Bool bResetModified;
if ( sal_True == (bResetModified = IsEnableSetModified()) )
EnableSetModified( sal_False );
- //sollte am Document ein JobSetup haengen, dann kopieren wir uns diesen,
- //um nach dem PrtOle2 diesen wieder am Doc zu verankern.
- //Einen leeren JobSetup setzen wir nicht ein, denn der wuerde nur zu
- //fragwuerdigem Ergebnis nach teurer Neuformatierung fuehren (Preview!)
+ // When there is a JobSetup connected to the Document, we copy it to
+ // reconnect it after PrtOle2. We don't use an empty JobSetup because
+ // that would only lead to questionable results after expensive
+ // reformatting (Preview!)
JobSetup *pOrig = 0;
if ( rSetup.GetPrinterName().Len() && ASPECT_THUMBNAIL != nAspect )
{
pOrig = const_cast<JobSetup*>(pDoc->getJobsetup());
- if( pOrig ) // dann kopieren wir uns den
+ if( pOrig ) // then we copy that
pOrig = new JobSetup( *pOrig );
pDoc->setJobsetup( rSetup );
}
@@ -891,7 +868,7 @@ void SwDocShell::SetVisArea( const Rectangle &rRect )
nMoveY = aRect.Top() < 0 ? -aRect.Top() : 0;
aRect.Move( nMoveX, nMoveY );
- //Ruft das SfxInPlaceObject::SetVisArea()!
+ // Calls SfxInPlaceObject::SetVisArea()!
pView->SetVisArea( aRect, sal_True );
}
else
@@ -903,7 +880,7 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
{
if ( nAspect == ASPECT_THUMBNAIL )
{
- //PreView: VisArea auf die erste Seite einstellen.
+ // PreView: set VisArea to the first page.
SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 );
SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx );
@@ -936,7 +913,7 @@ sal_uLong SwDocShell::GetMiscStatus() const
return SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE;
}
-// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption
+// #i20883# Digital Signatures and Encryption
sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
{
// get global state like HIDDENINFORMATION_DOCUMENTVERSIONS
@@ -949,7 +926,7 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
}
if ( nStates & HIDDENINFORMATION_NOTES )
{
- ASSERT( GetWrtShell(), "No SwWrtShell, no information" )
+ OSL_ENSURE( GetWrtShell(), "No SwWrtShell, no information" );
if ( GetWrtShell() )
{
SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr );
@@ -969,12 +946,6 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
return nState;
}
-// <--
-
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDocShell::GetState(SfxItemSet& rSet)
@@ -993,7 +964,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
if ( !bDisable )
{
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
- while (pTmpFrm) // Preview suchen
+ while (pTmpFrm) // Look for Preview
{
if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
@@ -1095,7 +1066,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
}
break;
- default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!");
+ default: OSL_ENSURE(!this,"You cannot get here!");
}
nWhich = aIter.NextWhich();
@@ -1103,15 +1074,15 @@ void SwDocShell::GetState(SfxItemSet& rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: OLE-Hdls
+ Description: OLE-Hdls
--------------------------------------------------------------------*/
IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p )
{
- // vom Doc wird der Status mitgegeben (siehe doc.cxx)
- // Bit 0: -> alter Zustand
- // Bit 1: -> neuer Zustand
+ // the Status is handed over from Doc (see doc.cxx)
+ // Bit 0: -> old state
+ // Bit 1: -> new state
long nStatus = (long)p;
if( IsEnableSetModified() )
SetModified( (nStatus & 2) ? sal_True : sal_False );
@@ -1119,7 +1090,7 @@ IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p )
}
/*--------------------------------------------------------------------
- Beschreibung: Pool returnen Hier weil virtuelll
+ Description: return Pool here, because virtual
--------------------------------------------------------------------*/
@@ -1143,13 +1114,13 @@ void SwDocShell::PrepareReload()
::DelAllGrfCacheEntries( pDoc );
}
-// --> OD 2006-11-07 #i59688#
+// #i59688#
// linked graphics are now loaded on demand.
// Thus, loading of linked graphics no longer needed and necessary for
// the load of document being finished.
void SwDocShell::LoadingFinished()
{
- // --> OD 2007-10-08 #i38810#
+ // #i38810#
// Original fix fails after integration of cws xmlsec11:
// interface <SfxObjectShell::EnableSetModified(..)> no longer works, because
// <SfxObjectShell::FinishedLoading(..)> doesn't care about its status and
@@ -1157,23 +1128,8 @@ void SwDocShell::LoadingFinished()
// Thus, manuell modify the document, if its modified and its links are updated
// before <FinishedLoading(..)> is called.
const bool bHasDocToStayModified( pDoc->IsModified() && pDoc->LinksUpdated() );
-// // --> OD 2005-02-11 #i38810# - disable method <SetModified(..)>, if document
-// // has stay in modified state, due to the update of its links during load.
-// bool bResetEnableSetModified(false);
-// if ( IsEnableSetModified() &&
-// pDoc->IsModified() && pDoc->LinksUpdated() )
-// {
-// EnableSetModified( sal_False );
-// bResetEnableSetModified = true;
-// }
- // <--
+
FinishedLoading( SFX_LOADED_ALL );
-// // --> OD 2005-02-11 #i38810#
-// if ( bResetEnableSetModified )
-// {
-// EnableSetModified( sal_True );
-// }
-// // <--
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this);
if(pVFrame)
{
@@ -1182,18 +1138,17 @@ void SwDocShell::LoadingFinished()
((SwSrcView*)pShell)->Load(this);
}
- // --> OD 2007-10-08 #i38810#
+ // #i38810#
if ( bHasDocToStayModified && !pDoc->IsModified() )
{
pDoc->SetModified();
}
- // <--
}
-// eine Uebertragung wird abgebrochen (wird aus dem SFX gerufen)
+// a Transfer is cancelled (is called from SFX)
void SwDocShell::CancelTransfers()
{
- // alle Links vom LinkManager Canceln
+ // Cancel all links from LinkManager
aFinishedTimer.Stop();
pDoc->GetLinkManager().CancelTransfers();
SfxObjectShell::CancelTransfers();
@@ -1247,33 +1202,28 @@ void SwDocShell::CalcLayoutForOLEObjects()
}
-// --> FME 2005-02-25 #i42634# Overwrites SfxObjectShell::UpdateLinks
+// #i42634# Overwrites SfxObjectShell::UpdateLinks
// This new function is necessary to trigger update of links in docs
// read by the binary filter:
void SwDocShell::UpdateLinks()
{
GetDoc()->UpdateLinks(sal_True);
- // --> FME 2005-07-27 #i50703# Update footnote numbers
+ // #i50703# Update footnote numbers
SwTxtFtn::SetUniqueSeqRefNo( *GetDoc() );
SwNodeIndex aTmp( GetDoc()->GetNodes() );
GetDoc()->GetFtnIdxs().UpdateFtn( aTmp );
- // <--
}
uno::Reference< frame::XController >
SwDocShell::GetController()
{
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > aRet;
- // --> FME 2007-10-15 #i82346# No view in page preview
+ // #i82346# No view in page preview
if ( GetView() )
- // <--
aRet = GetView()->GetController();
return aRet;
}
-/* -----------------------------12.02.01 12:08--------------------------------
-
- ---------------------------------------------------------------------------*/
static const char* pEventNames[] =
{
"OnPageCountChange",
@@ -1389,3 +1339,5 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 311d22271767..c180168913fc 100755
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,7 @@
#include <editeng/svxacorr.hxx>
#include <editeng/langitem.hxx>
#include <svx/fmshell.hxx>
+#include <sfx2/linkmgr.hxx>
#include <svtools/htmlcfg.hxx>
#include <svx/ofaitem.hxx>
@@ -72,8 +74,8 @@
#include <swunodef.hxx>
#include <fmtcol.hxx>
#include <swevent.hxx>
-#include <view.hxx> // fuer die aktuelle Sicht
-#include <docsh.hxx> // Dokumenterzeugung
+#include <view.hxx> // for the current view
+#include <docsh.hxx> // creation of documents
#include <wrtsh.hxx>
#include <fldbas.hxx>
#include <viewopt.hxx>
@@ -110,16 +112,13 @@
#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#ifdef FUTURE_VBA
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/script/vba/VBAEventId.hpp>
-#endif
#include <editeng/acorrcfg.hxx>
#include <SwStyleNameMapper.hxx>
#include <sfx2/fcontnr.hxx>
-#include "swabstdlg.hxx"
#include "dialog.hrc"
#include "swabstdlg.hxx"
@@ -134,24 +133,24 @@ using namespace ::sfx2;
extern sal_Bool FindPhyStyle( SwDoc& , const String& , SfxStyleFamily );
/*--------------------------------------------------------------------
- Beschreibung: DocInfo kreieren (virtuell)
+ Description: create DocInfo (virtual)
--------------------------------------------------------------------*/
SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet &rSet)
{
SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet);
- //nur mit Statistik, wenn dieses Doc auch angezeigt wird, nicht
- //aus dem Doc-Manager
+ //only with statistics, when this document is being shown, not
+ //from within the Doc-Manager
SwDocShell* pDocSh = (SwDocShell*) SfxObjectShell::Current();
if( pDocSh == this )
{
- //Nicht fuer SourceView.
+ //Not for SourceView.
SfxViewShell *pVSh = SfxViewShell::Current();
if ( pVSh && !pVSh->ISA(SwSrcView) )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg->AddTabPage(TP_DOC_STAT, SW_RESSTR(STR_DOC_STAT),pFact->GetTabPageCreatorFunc( TP_DOC_STAT ),0);
}
}
@@ -197,7 +196,7 @@ void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
}
// End of disabled "multiple layout"
-/// update text fields on document properties changes
+// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
{
if ( !pDoc ) return;
@@ -219,7 +218,6 @@ void SwDocShell::DoFlushDocInfo()
}
}
-#ifdef FUTURE_VBA
void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint )
{
using namespace com::sun::star::script::vba::VBAEventId;
@@ -238,31 +236,26 @@ void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventP
}
}
}
-#endif
/*--------------------------------------------------------------------
- Beschreibung: Benachrichtigung bei geaenderter DocInfo
+ Description: Notification on DocInfo changes
--------------------------------------------------------------------*/
void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if( !pDoc )
{
-//MA: Kommt bei der OLE-Registration vor!
-// ASSERT( !this, "DocShell ist nicht richtig initialisiert!" );
return ;
}
-#ifdef FUTURE_VBA
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
lcl_processCompatibleSfxHint( xVbaEvents, rHint );
-#endif
sal_uInt16 nAction = 0;
if( rHint.ISA(SfxSimpleHint) )
{
- // swithc for more actions
+ // switch for more actions
switch( ((SfxSimpleHint&) rHint).GetId() )
{
case SFX_HINT_TITLECHANGED:
@@ -274,9 +267,8 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
else if( rHint.ISA(SfxEventHint) &&
((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
{
- // --> OD 2004-12-03 #i38126# - own action id
+ // #i38126# - own action id
nAction = 3;
- // <--
}
if( nAction )
@@ -293,9 +285,9 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
case 2:
pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds();
break;
- // --> OD 2004-12-03 #i38126# - own action for event LOADFINISHED
+ // #i38126# - own action for event LOADFINISHED
// in order to avoid a modified document.
- // --> OD 2005-02-01 #i41679# - Also for the instance of <SwDoc>
+ // #i41679# - Also for the instance of <SwDoc>
// it has to be assured, that it's not modified.
// Perform the same as for action id 1, but disable <SetModified>.
case 3:
@@ -303,21 +295,18 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
const bool bResetModified = IsEnableSetModified();
if ( bResetModified )
EnableSetModified( sal_False );
- // --> OD 2005-02-01 #i41679#
+ // #i41679#
const bool bIsDocModified = pDoc->IsModified();
- // <--
pDoc->DocInfoChgd( );
- // --> OD 2005-02-01 #i41679#
+ // #i41679#
if ( !bIsDocModified )
pDoc->ResetModified();
- // <--
if ( bResetModified )
EnableSetModified( sal_True );
}
break;
- // <--
}
if( pWrtShell )
@@ -330,17 +319,16 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
/*--------------------------------------------------------------------
- Beschreibung: Benachrichtigung Doc schliessen
+ Description: Notification Close Doc
--------------------------------------------------------------------*/
sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
- if( sal_True == nRet ) //Unbedingt auf sal_True abfragen! (RET_NEWTASK)
+ if( sal_True == nRet ) //has to be queried against TRUE! (RET_NEWTASK)
EndListening( *this );
-#ifdef FUTURE_VBA
if( pDoc && IsInPrepareClose() )
{
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
@@ -351,28 +339,26 @@ sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs );
}
}
-#endif
return nRet;
}
/*--------------------------------------------------------------------
- Beschreibung: Organizer
+ Description: Organizer
--------------------------------------------------------------------*/
sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
- sal_uInt16 nSourceIdx1, // SourcePool: oberste Inhaltsebene (Vorlagen/Makros)
- sal_uInt16 nSourceIdx2, // Index in den Inhalt
- sal_uInt16 nSourceIdx3, // Index in die Inhaltsebene
- sal_uInt16 &rIdx1, // und das gleiche fuer den DestinationPool
+ sal_uInt16 nSourceIdx1, // SourcePool: uppermost content level (templates/macros)
+ sal_uInt16 nSourceIdx2, // Index in the content
+ sal_uInt16 nSourceIdx3, // Index in the content level
+ sal_uInt16 &rIdx1, // and the same for the DestinationPool
sal_uInt16 &rIdx2, // ""
sal_uInt16 &rIdx3, // ""
- sal_uInt16 &rRemovedIdx ) // falls doppelte geloescht werden, Pos zurueck
+ sal_uInt16 &rRemovedIdx ) // if doubles are being deleted, Pos back
{
- // --> OD 2005-05-10 #i48949# - actions aren't undoable. Thus, allow no undo
+ // #i48949# - actions aren't undoable. Thus, allow no undo
// actions
// Note: The undo action stack is cleared at the end of this method.
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
- // <--
sal_Bool bRet = sal_False;
@@ -385,22 +371,22 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
SwDocStyleSheetPool* pMyPool =
(SwDocStyleSheetPool*)GetStyleSheetPool();
- // wir koennen nicht in uns selbst hin und her moven
+ // we can't move back and forth within ourselves
if( pHisPool == pMyPool )
return sal_False;
if( INDEX_IGNORE == rIdx2 )
rIdx2 = pMyPool->Count();
- // erstmal auf die Such-Maske "positionieren"
+ // firstly "position" to the search-mask
pHisPool->First();
SfxStyleSheetBase* pHisSheet = (*pHisPool)[nSourceIdx2];
- // wenn so eine Vorlage schon existiert: loeschen!
+ // when such a template already exists: delete!
const String& rOldName = pHisSheet->GetName();
SfxStyleFamily eOldFamily( pHisSheet->GetFamily() );
- // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!!
+ // never delete default PageDesc and Standard Charactertemplate !!!
if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily &&
const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() ==
rOldName ) ||
@@ -415,20 +401,20 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
SfxStyleSheetBase* pExist;
if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) )
{
- // Bug 20365: nur uebernehmen, wenn das gewuenscht ist!
+ // only take over, if desired!
if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError(
*new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, rOldName )) )
{
return sal_False;
}
- // Da Replace den aStyleSheet-Member selbst benoetigt, muss
- // das Ergebnis vom Find kopiert werden (s.u.))
+ // Because Replace needs the aStyleSheet-Member itself, the result
+ // has to be copied from Find (see below))
rtl::Reference< SwDocStyleSheet > xExist( new SwDocStyleSheet(
*(SwDocStyleSheet*)pMyPool->Find( rOldName, eOldFamily ) ) );
pMyPool->Replace( *pHisSheet, *xExist.get() );
- // An der Reihenfolge der Vorlagen im Pool aendert sich nichts.
+ // The ordering of the templates in the Pool is not changed.
rIdx2 = rIdx1 = INDEX_IGNORE;
GetDoc()->SetModified();
@@ -438,34 +424,32 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
pMyPool->SetSearchMask( eOldFamily, nMySrchMask );
- // MIB 18.12.98: SwDocStyleSheetPool::Make liefert einen
- // Pointer auf SwDocStyleSheetPool::aStyleSheet zurueck.
- // Der gleiche Member von SwDocStyleSheetPool::Find benutzt.
- // Deshalb muss hier mit einer Kopie gearbeitet werden.
- // Vorsicht: SfxStyleSheetBase::SetFollow ruft seinerseits
- // ein SwDocStyleSheetPool::Find auf, do dass es nicht genuegt
- // die Find-Aufrufe in dieser Methode zu eleminieren.
+ // SwDocStyleSheetPool::Make returns a pointer to
+ // SwDocStyleSheetPool::aStyleSheet that uses same members of
+ // SwDocStyleSheetPool::Find. Therefore a copy has to be used
+ // here. Attention: SfxStylessheetBase::SetFollow calls itself
+ // a SwDocStyleSheetPool::Find, so that it's not sufficiant to
+ // to eliminate the Find-calls in this method.
rtl::Reference< SwDocStyleSheet > xNewSheet( new SwDocStyleSheet( (SwDocStyleSheet&)pMyPool
->Make(rOldName, eOldFamily, pHisSheet->GetMask() ) ) );
if( SFX_STYLE_FAMILY_PAGE == eOldFamily && rSource.ISA(SwDocShell) )
{
- // gesondert behandeln!!
+ // to deal with separately!!
SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc();
SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc();
pDoc->CopyPageDesc( *pCpyDsc, *pDestDsc );
}
else
- // die neue Vorlage mit den Attributen fuellen
+ // populate the new templates with the attributes
xNewSheet->SetItemSet( pHisSheet->GetItemSet() );
pMyPool->SetSearchMask( SFX_STYLE_FAMILY_ALL, nMySrchMask );
if( xNewSheet->IsUserDefined() || xNewSheet->IsUsed() )
{
- // Benutzte und Benutzer-definierte Vorlagen werden angezeigt.
- // Dshalb muss hier der Index der neuen Vorlage im Pool
- // ermittelt werden.
+ // Used and User-defined templates are being showed. That's why
+ // the Index of the template in the pool has to be found out.
pExist = pMyPool->First();
sal_uInt16 nIdx = 0;
while( pExist )
@@ -482,18 +466,12 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
}
else
{
- // Andere Vorlagen werden nicht angezeigt.
+ // Other templates are not being showed.
rIdx1 = rIdx2 = INDEX_IGNORE;
}
-/* pMyPool->Count(); //interne Liste neu fuellen lassen!!!!!
-
- // suchen, um die richige Insert-Position returnen zu koennen
- pMyPool->Find( rOldName, SFX_STYLE_FAMILY_ALL, nMySrchMask );
- rIdx2 = pMyPool->GetFindPos();*/
-
- // wer bekommt den Neuen als Parent? wer benutzt den Neuen als Follow?
- // (immer nur ueber die Instanziierten!!!)
+ // who gets the new one as parent? who uses the new one as Follow?
+ // (always using the instanciated!!!)
pMyPool->SetSearchMask( eOldFamily, nMySrchMask );
pMyPool->SetOrganizerMode( sal_True );
SfxStyleSheetBase* pTestSheet = pMyPool->First();
@@ -503,21 +481,21 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
pTestSheet->HasParentSupport() &&
pTestSheet->GetParent() == rOldName)
{
- pTestSheet->SetParent(rOldName); // Verknuepfung neu aufbauen
+ pTestSheet->SetParent(rOldName); // establish the link newly
}
if (pTestSheet->GetFamily() == eOldFamily &&
pTestSheet->HasFollowSupport() &&
pTestSheet->GetFollow() == rOldName)
{
- pTestSheet->SetFollow(rOldName); // Verknuepfung neu aufbauen
+ pTestSheet->SetFollow(rOldName); // establish the link newly
}
pTestSheet = pMyPool->Next();
}
pMyPool->SetOrganizerMode( SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
- // hat der Neue einen Parent? wenn ja, mit gleichem Namen bei uns suchen
+ // does the new one have a parent? if yes, search with the same name at our place.
if (pHisSheet->HasParentSupport())
{
const String& rParentName = pHisSheet->GetParent();
@@ -533,7 +511,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
}
}
- // hat der Neue einen Follow? wenn ja, mit gleichem Namen bei uns suchen
+ // does the new one have a Follow? if yes, search with the same name at our place.
if (pHisSheet->HasFollowSupport())
{
const String& rFollowName = pHisSheet->GetFollow();
@@ -549,11 +527,11 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
}
}
- // Bug 27347: alte Einstellung wieder setzen
+ // set old settings again
pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask );
- // Model geaendert
- ASSERT(pDoc, "Doc fehlt");
+ // Model changed
+ OSL_ENSURE(pDoc, "Doc missing");
GetDoc()->SetModified();
bRet = sal_True;
@@ -568,22 +546,21 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
rIdx3,
rRemovedIdx);
- // --> OD 2005-05-10 #i48949# - actions aren't undoable and could have change
+ // #i48949# - actions aren't undoable and could have change
// the document node array. Thus, clear the undo action stack.
if (undoGuard.UndoWasEnabled())
{
GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
- // <--
return bRet;
}
/*--------------------------------------------------------------------
- Beschreibung: Vorlagen Remove
+ Description: template Remove
--------------------------------------------------------------------*/
-sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
+sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // see Insert
sal_uInt16 nIdx2,
sal_uInt16 nIdx3)
{
@@ -593,13 +570,13 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
{
SwDocStyleSheetPool* pMyPool = (SwDocStyleSheetPool*)GetStyleSheetPool();
- pMyPool->First(); // vorm Zugriff Pool aktualisieren!!
+ pMyPool->First(); // update Pool before access!!
SfxStyleSheetBase* pMySheet = (*pMyPool)[nIdx2];
String aName( pMySheet->GetName() );
SfxStyleFamily eFamily( pMySheet->GetFamily() );
- // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!!
+ // never delete default PageDesc and Standard Character template!!!
if( ( SFX_STYLE_FAMILY_PAGE == eFamily &&
const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName()
== aName ) ||
@@ -608,10 +585,10 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
RES_POOLCOLL_TEXT_BEGIN ] ))
return sal_False;
- // also loeschen
+ // so delete
pMyPool->Remove( pMySheet );
- // jetzt noch die Parents/Follows aller Instanziierten korrigieren
+ // now correct the Parents/Follows of all instanciated
pMyPool->SetOrganizerMode( sal_True );
SfxStyleSheetBase* pTestSheet = pMyPool->First();
while (pTestSheet)
@@ -620,14 +597,14 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
pTestSheet->HasParentSupport() &&
pTestSheet->GetParent() == aName)
{
- pTestSheet->SetParent( aEmptyStr ); // Verknuepfung aufloesen
+ pTestSheet->SetParent( aEmptyStr ); // resolve link
}
if (pTestSheet->GetFamily() == eFamily &&
pTestSheet->HasFollowSupport() &&
pTestSheet->GetFollow() == aName)
{
- pTestSheet->SetFollow( aEmptyStr ); // Verknuepfung aufloesen
+ pTestSheet->SetFollow( aEmptyStr ); // resolve link
}
pTestSheet = pMyPool->Next();
@@ -642,17 +619,13 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert
nIdx3 );
- // Model geaendert
- ASSERT(pDoc, "Doc fehlt");
+ // Model changed
+ OSL_ENSURE(pDoc, "Doc missing");
GetDoc()->SetModified();
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDocShell::Execute(SfxRequest& rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -663,13 +636,13 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
case SID_AUTO_CORRECT_DLG:
{
- SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
SwAutoCompleteWord& rACW = SwDoc::GetAutoCompleteWords();
- sal_Bool bOldLocked = rACW.IsLockWordLstLocked(),
+ bool bOldLocked = rACW.IsLockWordLstLocked(),
bOldAutoCmpltCollectWords = pAFlags->bAutoCmpltCollectWords;
- rACW.SetLockWordLstLocked( sal_True );
+ rACW.SetLockWordLstLocked( true );
SvStringsISortDtor aTmpLst;
aTmpLst.Insert( &rACW.GetWordList() );
@@ -683,8 +656,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
// SMARTTAGS
pAFlags->pSmartTagMgr = &SwSmartTagMgr::Get();
- //pApp->ExecuteSlot(aAppReq);
-
SfxItemSet aSet( pApp->GetPool(), SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS, 0 );
aSet.Put( aSwOptions );
@@ -758,15 +729,15 @@ void SwDocShell::Execute(SfxRequest& rReq)
bSet = !bCurrent;
sal_uInt16 nSlotId = 0;
- if( bSet && !bFound ) // Keine gefunden, daher neue Preview anlegen
+ if( bSet && !bFound ) // Nothing found, so create new Preview
nSlotId = SID_VIEWSHELL1;
else if( bFound && !bSet )
nSlotId = bOnly ? SID_VIEWSHELL0 : SID_VIEWSHELL1;
if( nSlotId )
{
- //JP 23.8.2001: Bug 91360 - PagePreView in the WebDocShell
- // is found under Id ViewShell2.
+ // PagePreView in the WebDocShell
+ // is found under Id ViewShell2.
if( ISA(SwWebDocShell) && SID_VIEWSHELL1 == nSlotId )
nSlotId = SID_VIEWSHELL2;
@@ -830,7 +801,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
SfxObjectFactory &rFact = GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
@@ -851,7 +822,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
SwDocShell::Factory().GetFilterContainer()->
GetFilter4FilterName(String::CreateFromAscii("writer8"));
- //#b6439685# make sure the default file format is also available
+ // make sure the default file format is also available
if(bWeb)
{
const String sWild = ((WildCard&)pOwnFlt->GetWildcard()).GetWildCard();
@@ -859,7 +830,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
bool bError = false;
- //#b6439685# catch expception if wrong filter is selected - should not happen anymore
+ // catch expception if wrong filter is selected - should not happen anymore
try
{
xFltMgr->setCurrentFilter( pOwnFlt->GetUIName() );
@@ -952,13 +923,13 @@ void SwDocShell::Execute(SfxRequest& rReq)
break;
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
sal_Bool bWeb = 0 != dynamic_cast<SwWebDocShell*>(this);
- DBG_ASSERT(bWeb == sal_True, "SourceView nur in der WebDocShell");
+ OSL_ENSURE(bWeb == sal_True, "SourceView only in WebDocShell");
}
#endif
- // die SourceView ist fuer die SwWebDocShell die 1
+ // the SourceView is not the 1 for SwWebDocShell
sal_uInt16 nSlot = SID_VIEWSHELL1;
sal_Bool bSetModified = sal_False;
SfxPrinter* pSavePrinter = 0;
@@ -987,24 +958,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
nSlot = SID_VIEWSHELL0;
}
}
-/* OS 10.04.97 14.20: Im Web-Writer gibt es keinen Unterschied zwischen
- Export in den SourceMode und dem Speichern des Docs
- else if(IsModified())
- {
- sal_uInt16 nRet = QueryBox( SFX_APPWINDOW ,SW_RES(MSG_SAVE_HTML_QUERY)).Execute();
- if(RET_YES == nRet)
- {
- S F X _DISPATCHER().Execute(SID_SAVEDOC,
- SFX_CALLMODE_SYNCHRON);
- // der ReturnValue von SID_SAVEDOC ist etwas schwer verstaendlich
- if(IsModified())
- nSlot = 0;
- }
- else if( RET_CANCEL == nRet )
- {
- nSlot = 0;
- }
- }*/
if(nSlot)
pViewFrm->GetDispatcher()->Execute(nSlot, SFX_CALLMODE_SYNCHRON);
if(bSetModified)
@@ -1012,7 +965,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
if(pSavePrinter)
{
GetDoc()->setPrinter( pSavePrinter, true, true);
- //pSavePrinter darf nicht wieder geloescht werden
+ //pSavePrinter must not be deleted again
}
pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
pViewFrm->GetBindings().Invalidate( SID_NEWWINDOW );
@@ -1031,10 +984,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
case FN_ABSTRACT_NEWDOC:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwInsertAbstractDlg* pDlg = pFact->CreateSwInsertAbstractDlg(0, DLG_INSERT_ABSTRACT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
sal_uInt8 nLevel = pDlg->GetLevel();
@@ -1058,12 +1011,12 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
uno::Reference< lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory();
uno::Reference< frame::XDispatchProvider > xProv(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY );
if ( xProv.is() )
{
- ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( "SendOutlineToImpress" );
+ ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM("SendOutlineToImpress"));
uno::Reference< frame::XDispatchHelper > xHelper(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY );
if ( xHelper.is() )
{
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -1081,7 +1034,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead );
uno::Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0].Name = ::rtl::OUString::createFromAscii("RtfOutline");
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RtfOutline"));
aArgs[0].Value <<= aSeq;
xHelper->executeDispatch( xProv, aCmd, ::rtl::OUString(), 0, aArgs );
}
@@ -1093,11 +1046,11 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
else
{
- // Neues Dokument erzeugen.
+ // Create new document
SfxViewFrame *pFrame = SfxViewFrame::LoadDocument( *xDocSh, 0 );
SwView *pCurrView = (SwView*) pFrame->GetViewShell();
- // Dokumenttitel setzen
+ // Set document's title
String aTmp( SW_RES(STR_ABSTRACT_TITLE) );
aTmp += GetTitle();
xDocSh->SetTitle( aTmp );
@@ -1132,12 +1085,12 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
uno::Reference< lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory();
uno::Reference< frame::XDispatchProvider > xProv(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY );
if ( xProv.is() )
{
- ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( "SendOutlineToImpress" );
+ ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM("SendOutlineToImpress"));
uno::Reference< frame::XDispatchHelper > xHelper(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY );
if ( xHelper.is() )
{
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -1155,7 +1108,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead );
uno::Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0].Name = ::rtl::OUString::createFromAscii("RtfOutline");
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RtfOutline"));
aArgs[0].Value <<= aSeq;
xHelper->executeDispatch( xProv, aCmd, ::rtl::OUString(), 0, aArgs );
}
@@ -1274,7 +1227,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
if( bCreateHtml )
{
- // fuer HTML gibts es nur einen Filter!!
+ // for HTML there is only one filter!!
pFlt = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii("HTML"),
SwWebDocShell::Factory().GetFilterContainer() );
@@ -1282,8 +1235,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
else
{
- // Fuer Global-Dokumente bieten wir jetzt auch nur
- // noch den aktuellen an.
+ // for Global-documents we now only offer the current one.
pFlt = SwGlobalDocShell::Factory().GetFilterContainer()->
GetFilter4Extension( String::CreateFromAscii("odm") );
nStrId = STR_LOAD_GLOBAL_DOC;
@@ -1307,44 +1259,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
uno::Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY);
- //#removed by zhaojianwei
-
- // const sal_uInt16 nCount = pDoc->GetTxtFmtColls()->Count();
- // Sequence<OUString> aListBoxEntries(nCount);
- // OUString* pEntries = aListBoxEntries.getArray();
- // sal_Int32 nIdx = 0;
- // sal_Int16 nSelect = 0;
- // OUString sStartTemplate;
- // SwTxtFmtColl *pFnd = 0, *pAny = 0;
- // for(sal_uInt16 i = 0; i < nCount; ++i)
- // {
- // SwTxtFmtColl &rTxtColl =
- // *pDoc->GetTxtFmtColls()->GetObject( i );
- // if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
- // {
- // //if( MAXLEVEL >= rTxtColl.GetOutlineLevel() && ( !pFnd || //#outline level,zhaojianwei
- //if( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && ( !pFnd || //<-end,zhaojianwei
- // pFnd->GetAssignedOutlineStyleLevel() > rTxtColl.GetAssignedOutlineStyleLevel() ))
- // {
- // nSelect = (sal_Int16)nIdx;
- // pFnd = &rTxtColl;
- // sStartTemplate = rTxtColl.GetName();
- // }
- // else if( !pAny )
- // pAny = &rTxtColl;
- // //pEntries[nIdx++] = rTxtColl.GetName(); //#outline level,remove by zhaojianwei
- // pEntries[nIdx++] = sStyles + rTxtColl.GetName(); //#outline level,add by zhaojianwei
- // }
- // }
- // if(!sStartTemplate.getLength() && pAny)
- // sStartTemplate = pAny->GetName();
- // aListBoxEntries.realloc(nIdx);
- //<-end,zhaojianwei
-
-
- //#outline level,add by zhaojianwei
- /////////////////////////////////////////////////////////////////////
-
bool bOutline[MAXLEVEL] = {false};
const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
if( rOutlNds.Count() )
@@ -1383,8 +1297,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
aListBoxEntries.realloc(nIdx);
sal_Int16 nSelect = 0;
- /////////////////////////////////////////////////////////////////////
- //<-end,zhaojianwei
try
{
@@ -1400,7 +1312,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
catch(Exception& )
{
- DBG_ERROR("control acces failed");
+ OSL_FAIL("control acces failed");
}
xFP->setTitle( SW_RESSTR( nStrId ));
@@ -1414,21 +1326,18 @@ void SwDocShell::Execute(SfxRequest& rReq)
ListboxControlActions::GET_SELECTED_ITEM );
OUString sTmpl;
aTemplateValue >>= sTmpl;
- //aTemplateName = sTmpl; //#outline level,removed by zhaojianwei
- //#outline level,add by zhaojianwei
sal_Int32 nColonPos = sTmpl.indexOf( sal_Unicode(':') );
OUString sPrefix = sTmpl.copy( 0L, nColonPos );
- if( sPrefix.equalsAscii("Style"))
+ if( sPrefix.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Style")))
{
aTemplateName = sTmpl.copy( 7L ); //get string behind "Style: "
}
- else if( sPrefix.equalsAscii("Outline"))
+ else if( sPrefix.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Outline")))
{
nTemplateOutlineLevel = ( sTmpl.copy( 15L )).toInt32(); //get string behind "Outline: Leve ";
bCreateByOutlineLevel = true;
}
- //<-end,zhaojianwei
if ( aFileName.Len() )
{
@@ -1440,22 +1349,15 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
}
- //const SwTxtFmtColl* pSplitColl = 0; //#outline level,removed by zhaojianwei
- // if ( aTemplateName.Len() )
- // pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
- //<-end,zhaojianwei
if( aFileName.Len() )
{
if( PrepareClose( sal_False ) )
{
SwWait aWait( *this, sal_True );
- //bDone = bCreateHtml //#outline level,removed by zhaojianwei
- // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
- // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
- if ( bCreateByOutlineLevel ) //add by zhaojianwei
+ if ( bCreateByOutlineLevel )
{
- bDone = bCreateHtml //#outline level,removed by zhaojianwei
+ bDone = bCreateHtml
? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
: pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
}
@@ -1464,11 +1366,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
const SwTxtFmtColl* pSplitColl = 0;
if ( aTemplateName.Len() )
pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
- bDone = bCreateHtml //#outline level,removed by zhaojianwei
+ bDone = bCreateHtml
? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
: pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
}
- //<-end,zhaojianwei
if( bDone )
{
SfxStringItem aName( SID_FILE_NAME, aFileName );
@@ -1512,9 +1413,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
case SID_ATTR_YEAR2000:
if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pItem ))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "falsches Item");
+ OSL_ENSURE(pItem->ISA(SfxUInt16Item), "wrong Item");
sal_uInt16 nYear2K = ((SfxUInt16Item*)pItem)->GetValue();
- //ueber Views iterieren und den State an den FormShells setzen
+ // iterate over Views and put the State to FormShells
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( this );
SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : 0;
@@ -1532,14 +1433,38 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
break;
- default: DBG_ERROR("falscher Dispatcher");
+ default: OSL_FAIL("wrong Dispatcher");
}
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+ // #FIXME - align with NEW event stuff ( if possible )
+#if 0
+void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHelper >& xVbaEventsHelper, const SfxHint& rHint )
+{
+ if ( rHint.ISA( SfxEventHint ) )
+ {
+ uno::Sequence< uno::Any > aArgs;
+ sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ switch( nEventId )
+ {
+ case SFX_EVENT_CREATEDOC:
+ {
+ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_DOCUMENT_NEW, aArgs );
+ break;
+ }
+ case SFX_EVENT_OPENDOC:
+ {
+ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_DOCUMENT_OPEN, aArgs );
+ break;
+ }
+ default:
+ {
+ //do nothing
+ }
+ }
+ }
+}
+#endif
long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType,
uno::Any & rValue )
@@ -1547,30 +1472,24 @@ long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType,
return pDoc->GetData( rItem, rMimeType, rValue );
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType,
const uno::Any & rValue )
{
return pDoc->SetData( rItem, rMimeType, rValue );
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem )
{
return pDoc->CreateLinkSource( rItem );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+void SwDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
+{
+ if ( pDoc ) {
+ ::sfx2::LinkManager& rLinkManager = pDoc->GetLinkManager();
+ rLinkManager.ReconnectDdeLink(rServer);
+ }
+}
void SwDocShell::FillClass( SvGlobalName * pClassName,
sal_uInt32 * pClipFormat,
@@ -1592,15 +1511,16 @@ void SwDocShell::FillClass( SvGlobalName * pClassName,
*pClipFormat = bTemplate ? SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE : SOT_FORMATSTR_ID_STARWRITER_8;
*pLongUserName = SW_RESSTR(STR_WRITER_DOCUMENT_FULLTYPE);
}
+// #FIXME check with new Event handling
+#if 0
+ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper = pDoc->GetVbaEventsHelper();
+ if( xVbaEventsHelper.is() )
+ lcl_processCompatibleSfxHint( xVbaEventsHelper, rHint );
+#endif
*pUserName = SW_RESSTR(STR_HUMAN_SWDOC_NAME);
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDocShell::SetModified( sal_Bool bSet )
{
SfxObjectShell::SetModified( bSet );
@@ -1629,13 +1549,9 @@ void SwDocShell::SetModified( sal_Bool bSet )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDocShell::UpdateChildWindows()
{
- // Flddlg ggf neu initialisieren (z.B. fuer TYP_SETVAR)
+ // if necessary newly initialize Flddlg (i.e. for TYP_SETVAR)
if(!GetView())
return;
SfxViewFrame* pVFrame = GetView()->GetViewFrame();
@@ -1644,17 +1560,14 @@ void SwDocShell::UpdateChildWindows()
if( pWrp )
pWrp->ReInitDlg( this );
- // RedlineDlg ggf neu initialisieren
+ // if necessary newly initialize RedlineDlg
SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*)pVFrame->
GetChildWindow( SwRedlineAcceptChild::GetChildWindowId() );
if( pRed )
pRed->ReInitDlg( this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-// --> OD 2005-08-02 #i48748#
+// #i48748#
class SwReloadFromHtmlReader : public SwReader
{
public:
@@ -1666,21 +1579,24 @@ class SwReloadFromHtmlReader : public SwReader
SetBaseURL( _rFilename );
}
};
-// <--
+
void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView )
{
sal_Bool bModified = IsModified();
- // MIB 23.6.97: Die HTTP-Header-Felder muessen geloescht werden,
- // sonst gibt es welche aus Meta-Tags hinter doppelt und dreifach.
+ // The HTTP-Header fields have to be removed, otherwise
+ // there are some from Meta-Tags dublicated or triplicated afterwards.
ClearHeaderAttributesForSourceViewHack();
- // MIB 24.07.97: Das Dokument-Basic muss auch noch d'ran glauben ...
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- //#59620# HasBasic() zeigt an, dass es schon einen BasicManager an der DocShell
- // gibt. Der wurde im HTML-Import immer angelegt, wenn Macros im Quelltext
- // vorhanden sind.
- if( pHtmlOptions && pHtmlOptions->IsStarBasic() && HasBasic())
+ // The Document-Basic also bites the dust ...
+ // A EnterBasicCall is not needed here, because nothing is called and
+ // there can't be any Dok-Basic, that has not yet been loaded inside
+ // of an HTML document.
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ //#59620# HasBasic() shows, that there already is a BasicManager at the DocShell.
+ // That was always generated in HTML-Import, when there are
+ // Macros in the source code.
+ if( rHtmlOptions.IsStarBasic() && HasBasic())
{
BasicManager *pBasicMan = GetBasicManager();
if( pBasicMan && (pBasicMan != SFX_APP()->GetBasicManager()) )
@@ -1691,7 +1607,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
StarBASIC *pBasic = pBasicMan->GetLib( --nLibCount );
if( pBasic )
{
- // Die IDE benachrichtigen
+ // Notify the IDE
SfxUsrAnyItem aShellItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( GetModel() ) );
String aLibName( pBasic->GetName() );
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
@@ -1700,7 +1616,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
SFX_CALLMODE_SYNCHRON,
&aShellItem, &aLibNameItem, 0L );
- // Aus der Standard-Lib werden nur die Module geloescht
+ // Only the modules are deleted from the standard-lib
if( nLibCount )
pBasicMan->RemoveLib( nLibCount, sal_True );
else
@@ -1708,14 +1624,14 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
}
}
- ASSERT( pBasicMan->GetLibCount() <= 1,
- "Loschen des Basics hat nicht geklappt" );
+ OSL_ENSURE( pBasicMan->GetLibCount() <= 1,
+ "Deleting Basics didn't work" );
}
}
sal_Bool bWasBrowseMode = pDoc->get(IDocumentSettingAccess::BROWSE_MODE);
RemoveLink();
- //jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535#
+ // now also the UNO-Model has to be informed about the new Doc #51535#
uno::Reference<text::XTextDocument> xDoc(GetBaseModel(), uno::UNO_QUERY);
text::XTextDocument* pxDoc = xDoc.get();
((SwXTextDocument*)pxDoc)->InitNewDoc();
@@ -1729,8 +1645,8 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
const String& rMedname = GetMedium()->GetName();
- // fix #51032#: Die HTML-Vorlage muss noch gesetzt werden
- SetHTMLTemplate( *GetDoc() ); //Styles aus HTML.vor
+ // The HTML template still has to be set
+ SetHTMLTemplate( *GetDoc() ); //Styles from HTML.vor
SfxViewShell* pViewShell = GetView() ? (SfxViewShell*)GetView()
: SfxViewShell::Current();
@@ -1740,12 +1656,12 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
SubInitNew();
SfxMedium aMed( rStreamName, STREAM_READ, sal_False );
- // --> OD 2005-08-01 #i48748# - use class <SwReloadFromHtmlReader>, because
+ // #i48748# - use class <SwReloadFromHtmlReader>, because
// the base URL has to be set to the filename of the document <rMedname>
// and not to the base URL of the temporary file <aMed> in order to get
// the URLs of the linked graphics correctly resolved.
SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc );
- // <--
+
aReader.Read( *ReadHTML );
const SwView* pCurrView = GetView();
@@ -1759,9 +1675,9 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
}
- // MIB 23.6.97: Die HTTP-Header-Attribute wieder in die DokInfo
- // uebernehmen. Die Base-URL ist hier egal, da TLX zum absolutieren die
- // vom Dokument nimmt.
+ // Take HTTP-Header-Attibutes over into the DokInfo again.
+ // The Base-URL doesn't matter here because TLX uses the one from the document
+ // for absolutization.
SetHeaderAttributesForSourceViewHack();
if(bModified && !IsReadOnly())
@@ -1779,12 +1695,11 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
INetURLObject aURLObj( rURL );
String sURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
- // Filter bestimmen:
-// const SfxFilter* pFlt = SwIoSystem::GetFileFilter( rURL, aEmptyStr );
+ // Set filter:
String sFactory(String::CreateFromAscii(SwDocShell::Factory().GetShortName()));
SfxFilterMatcher aMatcher( sFactory );
- //#b6445961# search for filter in WebDocShell, too
+ // search for filter in WebDocShell, too
SfxMedium aMed( rURL, STREAM_STD_READ, sal_False );
const SfxFilter* pFlt = 0;
aMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False );
@@ -1825,7 +1740,6 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
if ( bImport )
// <--
{
- DBG_ASSERT((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?");
SwRead pRead = ReadXML;
SwReader* pReader = 0;
SwPaM* pPam = 0;
@@ -1884,3 +1798,4 @@ SfxInPlaceClient* SwDocShell::GetIPClient( const ::svt::EmbeddedObjectRef& xObjR
return pResult;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx
index cd6d2aee296d..73e0b0c4342c 100644
--- a/sw/source/ui/app/docshdrw.cxx
+++ b/sw/source/ui/app/docshdrw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,35 +29,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
-
-
-
-
-
-
-
-
#include <svl/stritem.hxx>
#include <svx/drawitem.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdoutl.hxx>
#include <svx/xtable.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <doc.hxx>
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Document laden
+ Description: Load Document
--------------------------------------------------------------------*/
@@ -65,7 +52,7 @@ void SwDocShell::InitDraw()
SdrModel *pDrDoc = pDoc->GetDrawModel();
if( pDrDoc )
{
- // Listen, bzw. Tables im ItemSet der DocShell anlegen
+ // create Lists and Tables DocShell's ItemSet
PutItem( SvxGradientListItem( pDrDoc->GetGradientList(), SID_GRADIENT_LIST ) );
PutItem( SvxHatchListItem( pDrDoc->GetHatchList(), SID_HATCH_LIST ) );
PutItem( SvxBitmapListItem( pDrDoc->GetBitmapList(), SID_BITMAP_LIST ) );
@@ -77,8 +64,9 @@ void SwDocShell::InitDraw()
rOutliner.SetHyphenator( xHyphenator );
}
else
- PutItem( SvxColorTableItem( XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
+ PutItem( SvxColorTableItem( &XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 6c8e73931105..f1cde365ba55 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <svx/dialogs.hrc>
@@ -105,13 +105,10 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using ::rtl::OUString;
-/*-----------------21.09.96 15.29-------------------
-
---------------------------------------------------*/
/*--------------------------------------------------------------------
- Beschreibung: Document laden
+ Description: Load Document
--------------------------------------------------------------------*/
@@ -120,26 +117,19 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::InitNew" );
sal_Bool bRet = SfxObjectShell::InitNew( xStor );
- ASSERT( GetMapUnit() == MAP_TWIP, "map unit is not twip!" );
+ OSL_ENSURE( GetMapUnit() == MAP_TWIP, "map unit is not twip!" );
sal_Bool bHTMLTemplSet = sal_False;
if( bRet )
{
- AddLink(); // pDoc / pIo ggf. anlegen
+ AddLink(); // create pDoc / pIo if applicable
sal_Bool bWeb = ISA( SwWebDocShell );
if ( bWeb )
- bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );//Styles aus HTML.vor
+ bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );// Styles from HTML.vor
else if( ISA( SwGlobalDocShell ) )
GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); // Globaldokument
-/*
- //JP 12.07.95: so einfach waere es fuer die neu Mimik
- pDoc->SetDefault( SvxTabStopItem( 1,
- GetStar Writer App()->GetUsrPref()->GetDefTabDist(),
- SVX_TAB_ADJUST_DEFAULT,
- RES_PARATR_TABSTOP));
-*/
if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
SwTransferable::InitOle( this, *pDoc );
@@ -164,7 +154,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
SubInitNew();
- // fuer alle
+ // for all
SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
SfxPrinter* pPrt = pDoc->getPrinter( false );
@@ -344,24 +334,23 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// the static pool default.
pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) );
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) );
// <-- collapsing
//#i16874# AutoKerning as default for new documents
pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
- // --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)>
+ // #i42080# - Due to the several calls of method <SetDefault(..)>
// at the document instance, the document is modified. Thus, reset this
// status here. Note: In method <SubInitNew()> this is also done.
pDoc->ResetModified();
- // <--
return bRet;
}
/*--------------------------------------------------------------------
- Beschreibung: Ctor mit SfxCreateMode ?????
+ Description: Ctor with SfxCreateMode ?????
--------------------------------------------------------------------*/
@@ -380,7 +369,7 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
}
/*--------------------------------------------------------------------
- Beschreibung: Ctor / Dtor
+ Description: Ctor / Dtor
--------------------------------------------------------------------*/
@@ -399,7 +388,7 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
}
/*--------------------------------------------------------------------
- Beschreibung: Ctor / Dtor
+ Description: Ctor / Dtor
--------------------------------------------------------------------*/
@@ -418,7 +407,7 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
}
/*--------------------------------------------------------------------
- Beschreibung: Dtor
+ Description: Dtor
--------------------------------------------------------------------*/
@@ -436,30 +425,28 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
RemoveLink();
delete pFontList;
- // wir als BroadCaster werden auch unser eigener Listener
- // (fuer DocInfo/FileNamen/....)
+ // we, as BroadCaster also become our own Listener
+ // (for DocInfo/FileNames/....)
EndListening( *this );
SvxColorTableItem* pColItem = (SvxColorTableItem*)GetItem(SID_COLOR_TABLE);
- // wird nur die DocInfo fuer den Explorer gelesen, ist das Item nicht da
+ // when only DocInfo is read for the Explorer, the Item is not there
if(pColItem)
{
XColorTable* pTable = pColItem->GetColorTable();
- // wurde eine neue Table angelegt, muss sie auch geloescht werden.
- if((void*)pTable != (void*)(XColorTable::GetStdColorTable()) )
+ // when a new Table was created, it has to be deleted as well.
+ if(pTable != &XColorTable::GetStdColorTable())
delete pTable;
}
delete pOLEChildList;
}
-/* -----------------------------10.09.2001 15:59------------------------------
- ---------------------------------------------------------------------------*/
void SwDocShell::Init_Impl()
{
SetPool(&SW_MOD()->GetPool());
SetBaseModel(new SwXTextDocument(this));
- // wir als BroadCaster werden auch unser eigener Listener
- // (fuer DocInfo/FileNamen/....)
+ // we, as BroadCaster also become our own Listener
+ // (for DocInfo/FileNames/....)
StartListening( *this );
//position of the "Automatic" style filter for the stylist (app.src)
SetAutoStyleFilterIndex(3);
@@ -468,7 +455,7 @@ void SwDocShell::Init_Impl()
SetMapUnit( MAP_TWIP );
}
/*--------------------------------------------------------------------
- Beschreibung: AddLink
+ Description: AddLink
--------------------------------------------------------------------*/
@@ -483,18 +470,18 @@ void SwDocShell::AddLink()
}
else
pDoc->acquire();
- pDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen
+ pDoc->SetDocShell( this ); // set the DocShell-Pointer for Doc
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Reactivate(this);
SetPool(&pDoc->GetAttrPool());
- // am besten erst wenn eine sdbcx::View erzeugt wird !!!
+ // most suitably not until a sdbcx::View is created!!!
pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
}
/*--------------------------------------------------------------------
- Beschreibung: neue FontList erzeugen Aenderung Drucker
+ Description: create new FontList Change Printer
--------------------------------------------------------------------*/
@@ -503,7 +490,7 @@ void SwDocShell::UpdateFontList()
if(!bInUpdateFontList)
{
bInUpdateFontList = true;
- ASSERT(pDoc, "Kein Doc keine FontList");
+ OSL_ENSURE(pDoc, "No Doc no FontList");
if( pDoc )
{
delete pFontList;
@@ -515,13 +502,13 @@ void SwDocShell::UpdateFontList()
}
/*--------------------------------------------------------------------
- Beschreibung: RemoveLink
+ Description: RemoveLink
--------------------------------------------------------------------*/
void SwDocShell::RemoveLink()
{
- // Uno-Object abklemmen
+ // disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Invalidate();
aFinishedTimer.Stop();
@@ -537,24 +524,24 @@ void SwDocShell::RemoveLink()
pDoc->SetDocShell( 0 );
if( !nRefCt )
delete pDoc;
- pDoc = 0; // wir haben das Doc nicht mehr !!
+ pDoc = 0; // we don't have the Doc anymore!!
}
}
void SwDocShell::InvalidateModel()
{
- // Uno-Object abklemmen
+ // disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Invalidate();
}
void SwDocShell::ReactivateModel()
{
- // Uno-Object abklemmen
+ // disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
((SwXTextDocument*)xDoc.get())->Reactivate(this);
}
/*--------------------------------------------------------------------
- Beschreibung: Laden, Default-Format
+ Description: Load, Default-Format
--------------------------------------------------------------------*/
@@ -565,14 +552,14 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
if( SfxObjectShell::Load( rMedium ))
{
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after SfxInPlaceObject::Load" );
- if( pDoc ) // fuer Letzte Version !!
- RemoveLink(); // das existierende Loslassen
+ if( pDoc ) // for last version!!
+ RemoveLink(); // release the existing
- AddLink(); // Link setzen und Daten updaten !!
+ AddLink(); // set Link and update Data!!
- // Das Laden
- // fuer MD
- ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
+ // Loading
+ // for MD
+ OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
{
@@ -584,9 +571,6 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
sal_uInt32 nErr = ERR_SWG_READ_ERROR;
switch( GetCreateMode() )
{
-// case SFX_CREATE_MODE_INTERNAL:
-// nErr = 0;
-// break;
case SFX_CREATE_MODE_ORGANIZER:
{
@@ -603,12 +587,12 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
case SFX_CREATE_MODE_INTERNAL:
case SFX_CREATE_MODE_EMBEDDED:
{
- // fuer MWERKS (Mac-Compiler): kann nicht selbststaendig casten
+ // for MWERKS (Mac-Compiler): can't cast autonomously
SwTransferable::InitOle( this, *pDoc );
}
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // suppress SfxProgress, when we are Embedded
SW_MOD()->SetEmbeddedLoadSave( sal_True );
- // kein break;
+ // no break;
case SFX_CREATE_MODE_STANDARD:
case SFX_CREATE_MODE_PREVIEW:
@@ -616,7 +600,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
Reader *pReader = ReadXML;
if( pReader )
{
- // die DocInfo vom Doc am DocShell-Medium setzen
+ // set Doc's DocInfo at DocShell-Medium
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before ReadDocInfo" );
SwReader aRdr( rMedium, aEmptyStr, pDoc );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before Read" );
@@ -637,15 +621,15 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !this, "ohne Sw3Reader geht nichts" );
+ OSL_ENSURE( !this, "it won't do without Sw3Reader" );
#endif
}
break;
default:
- ASSERT( !this, "Load: new CreateMode?" );
+ OSL_ENSURE( !this, "Load: new CreateMode?" );
}
@@ -655,30 +639,19 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
bRet = !IsError( nErr );
- // --> OD 2006-11-07 #i59688#
-// // StartFinishedLoading rufen.
-// if( bRet && !pDoc->IsInLoadAsynchron() &&
-// GetCreateMode() == SFX_CREATE_MODE_STANDARD )
-// StartLoadFinishedTimer();
if ( bRet && !pDoc->IsInLoadAsynchron() &&
GetCreateMode() == SFX_CREATE_MODE_STANDARD )
{
LoadingFinished();
}
- // <--
- // SfxProgress unterdruecken, wenn man Embedded ist
+ // suppress SfxProgress, when we are Embedded
SW_MOD()->SetEmbeddedLoadSave( sal_False );
}
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::LoadFrom" );
@@ -686,20 +659,19 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
if( pDoc )
RemoveLink();
- AddLink(); // Link setzen und Daten updaten !!
+ AddLink(); // set Link and update Data!!
do { // middle check loop
sal_uInt32 nErr = ERR_SWG_READ_ERROR;
- //const String& rNm = pStor->GetName();
String aStreamName;
aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("styles.xml"));
uno::Reference < container::XNameAccess > xAccess( rMedium.GetStorage(), uno::UNO_QUERY );
if ( xAccess->hasByName( aStreamName ) && rMedium.GetStorage()->isStreamElement( aStreamName ) )
{
- // Das Laden
+ // Loading
SwWait aWait( *this, sal_True );
{
- ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
+ OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if( ReadXML )
{
@@ -712,25 +684,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR("Code removed!");
- /*
- //TODO/LATER: looks like some binary stuff?!
- // sollte es sich um eine 2. Vrolage handeln ??
- if( SvStorage::IsStorageFile( rNm ) )
- break;
-
- const SfxFilter* pFltr = SwIoSystem::GetFileFilter( rNm, aEmptyStr );
- if( !pFltr || !pFltr->GetUserData().EqualsAscii( FILTER_SWG ))
- break;
-
- SfxMedium aMed( rNm, STREAM_STD_READ, sal_False );
- if( 0 == ( nErr = aMed.GetInStream()->GetError() ) )
- {
- SwWait aWait( *this, sal_True );
- SwReader aRead( aMed, rNm, pDoc );
- nErr = aRead.Read( *ReadSwg );
- }
- */
+ OSL_FAIL("Code removed!");
}
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
@@ -746,7 +700,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
void SwDocShell::SubInitNew()
{
- ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" );
+ OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
UpdateFontList();
InitDraw();
@@ -765,8 +719,8 @@ void SwDocShell::SubInitNew()
0, 0, 0 };
if(!bWeb)
{
- nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP;
- nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE;
+ nRange[ (SAL_N_ELEMENTS(nRange)) - 3 ] = RES_PARATR_TABSTOP;
+ nRange[ (SAL_N_ELEMENTS(nRange)) - 2 ] = RES_PARATR_HYPHENZONE;
}
SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange );
@@ -816,3 +770,5 @@ void SwDocShell::SubInitNew()
IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; }
const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; }
IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 2e38cde62c52..847e629d454c 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,19 +83,13 @@
#include "app.hrc"
#include <fmtui.hrc>
#include "swabstdlg.hxx"
-// --> OD 2008-03-27 #refactorlists#
+
#include <list.hxx>
-// <--
#include <paratr.hxx> //#outline level,add by zhaojianwei
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
{
SfxWhichIter aIter(rSet);
@@ -121,14 +116,13 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
while (nWhich)
{
- // aktuelle Vorlage zu jeder Familie ermitteln
- //
+ // determine current template to every family
String aName;
switch (nWhich)
{
case SID_STYLE_APPLY:
- {//hier wird die Vorlage und ihre Familie an die StyleBox
- //uebergeben, damit diese Familie angezeigt wird
+ {// here the template and its family are passed to the StyleBox
+ // so that this family is being showed
if(pShell->IsFrmSelected())
{
SwFrmFmt* pFmt = pShell->GetCurFrmFmt();
@@ -208,8 +202,8 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY4:
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
rSet.DisableItem( nWhich );
else
{
@@ -260,7 +254,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
break;
default:
- DBG_ERROR( "Invalid SlotId");
+ OSL_FAIL("Invalid SlotId");
}
nWhich = aIter.NextWhich();
}
@@ -268,7 +262,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
/*--------------------------------------------------------------------
- Beschreibung: StyleSheet-Requeste auswerten
+ Description: evaluate StyleSheet-Requests
--------------------------------------------------------------------*/
@@ -328,7 +322,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
uno::Reference< beans::XPropertySet > xInfo;
xStyles->getByName( pNameItem->GetValue() ) >>= xInfo;
::rtl::OUString aUIName;
- xInfo->getPropertyValue( ::rtl::OUString::createFromAscii("DisplayName") ) >>= aUIName;
+ xInfo->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayName")) ) >>= aUIName;
if ( aUIName.getLength() )
rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) );
}
@@ -386,7 +380,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
}
else
{
- ASSERT( pArgs->Count(), "SfxBug ItemSet ist leer");
+ OSL_ENSURE( pArgs->Count(), "SfxBug ItemSet is empty");
SwWrtShell* pShell = GetWrtShell();
if( SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem ))
@@ -468,7 +462,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
nRet = Delete(aParam, nFamily);
break;
case SID_STYLE_APPLY:
- // Shellwechsel in ApplyStyles
+ // Shell-switch in ApplyStyles
nRet = ApplyStyles(aParam, nFamily, pActShell, rReq.GetModifier() );
break;
case SID_STYLE_WATERCAN:
@@ -488,7 +482,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
break;
default:
- DBG_ERROR( "Falsche Slot-Id");
+ OSL_FAIL("Invalid SlotId");
}
rReq.Done();
@@ -500,7 +494,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
if(bSetReturn)
{
- if(rReq.IsAPI()) // Basic bekommt nur sal_True oder sal_False
+ if(rReq.IsAPI()) // Basic only gets TRUE or FALSE
rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet !=0));
else
rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet));
@@ -509,7 +503,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
}
/*--------------------------------------------------------------------
- Beschreibung: Edit
+ Description: Edit
--------------------------------------------------------------------*/
@@ -517,7 +511,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
sal_Bool bNew, sal_Bool bColumn, SwWrtShell* pActShell,
sal_Bool bBasic )
{
- ASSERT(GetWrtShell(), "Keine Shell, keine Styles");
+ OSL_ENSURE(GetWrtShell(), "No Shell, no Styles");
SfxStyleSheetBase *pStyle = 0;
sal_uInt16 nRet = nMask;
@@ -532,7 +526,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
pStyle = &mxBasePool->Make( rName, (SfxStyleFamily)nFamily, nMask );
- // die aktuellen als Parent setzen
+ // set the current one as Parent
SwDocStyleSheet* pDStyle = (SwDocStyleSheet*)pStyle;
switch( nFamily )
{
@@ -618,38 +612,23 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
else
{
pStyle = mxBasePool->Find( rName, (SfxStyleFamily)nFamily );
- ASSERT(pStyle, "Vorlage nicht gefunden");
+ OSL_ENSURE(pStyle, "Vorlage nicht gefunden");
}
if(!pStyle)
return sal_False;
- // Dialoge zusammenstoepseln
- //
+ // put dialogues together
rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) );
if( SFX_STYLE_FAMILY_PARA == nFamily )
{
SfxItemSet& rSet = xTmp->GetItemSet();
::SwToSfxPageDescAttr( rSet );
- // erstmal nur eine Null
+ // firstly only a Zero
rSet.Put(SwBackgroundDestinationItem(SID_PARA_BACKGRND_DESTINATION, 0));
- // --> OD 2008-02-13 #newlistlevelattrs#
// merge list level indent attributes into the item set if needed
xTmp->MergeIndentAttrsOfListStyle( rSet );
- // <--
}
-/* else if( SFX_STYLE_FAMILY_FRAME == nFamily )
- {
- // Auskommentiert wegen Bug #45776 (per default keine Breite&Groesse in Rahmenvorlagen)
- SfxItemSet& rSet = aTmp.GetItemSet();
- if( SFX_ITEM_SET != rSet.GetItemState( RES_FRM_SIZE ))
- {
- // dann sollten wir spaetesten hier eines anlegen
- SwFrmValid aFrmDefValues;
- rSet.Put( SwFmtFrmSize( ATT_VAR_SIZE, aFrmDefValues.nWidth,
- aFrmDefValues.nHeight ));
- }
- }*/
else if( SFX_STYLE_FAMILY_CHAR == nFamily )
{
SfxItemSet& rSet = xTmp->GetItemSet();
@@ -664,7 +643,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
}
if (!bBasic)
{
- // vor dem Dialog wird der HtmlMode an der DocShell versenkt
+ // prior to the dialog the HtmlMode at the DocShell is being sunk
sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
// In HTML mode, we do not always have a printer. In order to show
@@ -679,16 +658,19 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE,
0, *(xTmp.get()), nFamily, bColumn,
pActShell ? pActShell : pWrtShell, bNew);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
- if(RET_OK == pDlg->Execute())
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ while (true)
+ {
+ short nButton = pDlg->Execute();
+ if(RET_OK == nButton || RET_APPLY_TEMPLATE == nButton)
{
GetWrtShell()->StartAllAction();
- // nur bei Absatz-Vorlagen die Maske neu setzen
+ // newly set the mask only with paragraph-templates
if( bNew )
{
nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily()
@@ -702,11 +684,9 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
{
SfxItemSet aSet( *pDlg->GetOutputItemSet() );
::SfxToSwPageDescAttr( *GetWrtShell(), aSet );
- // --> OD 2008-02-12 #newlistlevelattrs#
// reset indent attributes at paragraph style, if a list style
// will be applied and no indent attributes will be applied.
xTmp->SetItemSet( aSet, true );
- // <--
}
else
{
@@ -746,11 +726,11 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
if( bNew )
mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) );
- // JP 19.09.97:
- // Dialog vorm EndAction zerstoeren - bei Seitenvorlagen kann
- // muss der ItemSet zerstoert werden, damit die Cursor aus den
- // Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!!
- delete pDlg;
+ // Destroy dialog before EndAction - with page-templates the
+ // ItemSet must be destroyed, so that the cursors get removed
+ // from Headers/Footers. Otherwise "GPF" happen!!!
+ if(RET_OK == nButton)
+ delete pDlg;
pDoc->SetModified();
if( !bModified ) // Bug 57028
@@ -764,8 +744,6 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
{
if( bNew )
{
- // #116530#
- //pBasePool->Erase( &aTmp );
GetWrtShell()->Undo(1);
pDoc->GetIDocumentUndoRedo().ClearRedo();
}
@@ -774,15 +752,18 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
pDoc->ResetModified();
delete pDlg;
}
+ if(RET_APPLY_TEMPLATE != nButton)
+ break;
+ }
}
else
{
- // vor dem Dialog wird der HtmlMode an der DocShell versenkt
+ // prior to the dialog the HtmlMode at the DocShell is being sunk
PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this)));
GetWrtShell()->StartAllAction();
- // nur bei Absatz-Vorlagen die Maske neu setzen
+ // newly set the mask only with paragraph-templates
if( bNew )
{
nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily()
@@ -829,7 +810,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
}
/*--------------------------------------------------------------------
- Beschreibung: Delete
+ Description: Delete
--------------------------------------------------------------------*/
@@ -839,7 +820,7 @@ sal_uInt16 SwDocShell::Delete(const String &rName, sal_uInt16 nFamily)
if(pStyle)
{
- ASSERT(GetWrtShell(), "Keine Shell, keine Styles");
+ OSL_ENSURE(GetWrtShell(), "No Shell, no Styles");
GetWrtShell()->StartAllAction();
mxBasePool->Remove(pStyle);
@@ -851,7 +832,7 @@ sal_uInt16 SwDocShell::Delete(const String &rName, sal_uInt16 nFamily)
}
/*--------------------------------------------------------------------
- Beschreibung: Vorlage anwenden
+ Description: apply template
--------------------------------------------------------------------*/
@@ -861,13 +842,14 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
SwDocStyleSheet* pStyle =
(SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily);
- ASSERT(pStyle, "Wo ist der StyleSheet");
+ OSL_ENSURE(pStyle, "Where's the StyleSheet");
+
if(!pStyle)
return sal_False;
SwWrtShell *pSh = pShell ? pShell : GetWrtShell();
- ASSERT( pSh, "Keine Shell, keine Styles");
+ OSL_ENSURE( pSh, "No Shell, no Styles");
pSh->StartAllAction();
@@ -882,11 +864,10 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
}
case SFX_STYLE_FAMILY_PARA:
{
- // --> OD 2007-11-06 #i62675#
+ // #i62675#
// clear also list attributes at affected text nodes, if paragraph
// style has the list style attribute set.
pSh->SetTxtFmtColl( pStyle->GetCollection(), true );
- // <--
break;
}
case SFX_STYLE_FAMILY_FRAME:
@@ -902,18 +883,15 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
}
case SFX_STYLE_FAMILY_PSEUDO:
{
- // --> OD 2008-02-08 #newlistlevelattrs#
// reset indent attribute on applying list style
- // --> OD 2008-03-17 #refactorlists#
// continue list of list style
const SwNumRule* pNumRule = pStyle->GetNumRule();
const String sListIdForStyle =pNumRule->GetDefaultListId();
pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true );
- // <--
break;
}
default:
- DBG_ERROR("Unbekannte Familie");
+ OSL_FAIL("Unknown family");
}
pSh->EndAllAction();
@@ -921,20 +899,22 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
}
/*--------------------------------------------------------------------
- Beschreibung: Giesskanne starten
+ Description: start watering-can
--------------------------------------------------------------------*/
sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily)
{
- ASSERT(GetWrtShell(), "Keine Shell, keine Styles");
+ OSL_ENSURE(GetWrtShell(), "No Shell, no Styles");
SwEditWin& rEdtWin = pView->GetEditWin();
SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
sal_Bool bWaterCan = !(pApply && pApply->eType != 0);
+
if( !rName.Len() )
bWaterCan = sal_False;
+
SwApplyTemplate aTemplate;
aTemplate.eType = nFamily;
@@ -943,7 +923,8 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily)
SwDocStyleSheet* pStyle =
(SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily);
- ASSERT(pStyle, "Wo ist der StyleSheet");
+ OSL_ENSURE (pStyle, "Where's the StyleSheet");
+
if(!pStyle) return nFamily;
switch(nFamily)
@@ -965,27 +946,26 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily)
break;
default:
- DBG_ERROR( "Unbekannte Familie");
+ OSL_FAIL("Unknown family");
}
}
else
aTemplate.eType = 0;
- // Template anwenden
pView->GetEditWin().SetApplyTemplate(aTemplate);
return nFamily;
}
/*--------------------------------------------------------------------
- Beschreibung: Vorlage Updaten
+ Description: update template
--------------------------------------------------------------------*/
sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWrtShell* pShell)
{
SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell();
- ASSERT(GetWrtShell(), "Keine Shell, keine Styles");
+ OSL_ENSURE(GetWrtShell(), "No Shell, no Styles");
SwDocStyleSheet* pStyle =
(SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily);
@@ -1007,8 +987,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
GetWrtShell()->StartUndo(UNDO_INSFMTATTR, &aRewriter);
GetWrtShell()->FillByEx(pColl);
- // Vorlage auch anwenden, um harte Attributierung
- // zu entfernen
+ // also apply template to remove hard set attributes
GetWrtShell()->SetTxtFmtColl( pColl );
GetWrtShell()->EndUndo();
GetWrtShell()->EndAllAction();
@@ -1024,15 +1003,13 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
pCurrWrtShell->StartAllAction();
pCurrWrtShell->GetFlyFrmAttr( aSet );
- // --> OD 2009-12-28 #i105535#
+ // #i105535#
// no update of anchor attribute
aSet.ClearItem( RES_ANCHOR );
- // <--
pFrm->SetFmtAttr( aSet );
- // Vorlage auch anwenden, um harte Attributierung
- // zu entfernen
+ // also apply template to remove hard set attributes
pCurrWrtShell->SetFrmFmt( pFrm, sal_True );
pCurrWrtShell->EndAllAction();
}
@@ -1045,8 +1022,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
{
pCurrWrtShell->StartAllAction();
pCurrWrtShell->FillByEx(pChar);
- // Vorlage auch anwenden, um harte Attributierung
- // zu entfernen
+ // also apply template to remove hard set attributes
pCurrWrtShell->EndAllAction();
}
@@ -1059,10 +1035,9 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
0 != ( pCurRule = pCurrWrtShell->GetCurNumRule() ))
{
SwNumRule aRule( *pCurRule );
- // --> OD 2008-07-08 #i91400#
+ // #i91400#
aRule.SetName( pStyle->GetNumRule()->GetName(),
*(pCurrWrtShell->GetDoc()) );
- // <--
pCurrWrtShell->ChgNumRuleFmts( aRule );
}
}
@@ -1072,7 +1047,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
}
/*--------------------------------------------------------------------
- Beschreibung: NewByExample
+ Description: NewByExample
--------------------------------------------------------------------*/
@@ -1084,8 +1059,8 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
rName, (SfxStyleFamily)nFamily );
if(!pStyle)
{
- // JP 07.07.95: behalte die akt. Maske vom PI bei, dadurch werden
- // neue sofort in den sichtbaren Bereich einsortiert
+ // preserve the current mask of PI, then the new one is
+ // immediately merged with the viewable area
if( SFXSTYLEBIT_ALL == nMask || SFXSTYLEBIT_USED == nMask )
nMask = SFXSTYLEBIT_USERDEF;
else
@@ -1104,11 +1079,10 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
{
pCurrWrtShell->StartAllAction();
pCurrWrtShell->FillByEx(pColl);
- // Vorlage auch anwenden, um harte Attributierung
- // zu entfernen
+ // also apply template to remove hard set attributes
pColl->SetDerivedFrom(pCurrWrtShell->GetCurTxtFmtColl());
- // setze die Maske noch an der Collection:
+ // set the mask at the Collection:
sal_uInt16 nId = pColl->GetPoolFmtId() & 0x87ff;
switch( nMask & 0x0fff )
{
@@ -1151,23 +1125,8 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
SwFrmFmt* pFFmt = pCurrWrtShell->GetCurFrmFmt();
pFrm->SetDerivedFrom( pFFmt );
- // JP 10.06.98: nur automatische Orientierungen uebernehmen
-/* #61359# jetzt auch wieder alle Orientierungen
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == aSet.GetItemState( RES_VERT_ORIENT,
- sal_False, &pItem ) &&
- text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient())
- aSet.ClearItem( RES_VERT_ORIENT );
-
- if( SFX_ITEM_SET == aSet.GetItemState( RES_HORI_ORIENT,
- sal_False, &pItem ) &&
- text::HoriOrientation::NONE == ((SwFmtHoriOrient*)pItem)->GetHoriOrient())
- aSet.ClearItem( RES_HORI_ORIENT );
- */
-
pFrm->SetFmtAttr( aSet );
- // Vorlage auch anwenden, um harte Attributierung
- // zu entfernen
+ // also apply template to remove hard set attributes
pCurrWrtShell->SetFrmFmt( pFrm );
pCurrWrtShell->EndAllAction();
}
@@ -1201,12 +1160,12 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
pCurrWrtShell->GetDoc()->CopyPageDesc( rSrc, rDest );
- // PoolId darf NIE kopiert werden!
+ // PoolId must NEVER be copied!
rDest.SetPoolFmtId( nPoolId );
rDest.SetPoolHelpId( nHId );
rDest.SetPoolHlpFileId( nHFId );
- // werden Kopf-/Fusszeilen angelegt, so gibt es kein Undo mehr!
+ // when Headers/Footers are created, there is no Undo anymore!
pCurrWrtShell->GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
pCurrWrtShell->EndAllAction();
@@ -1219,10 +1178,9 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
SwNumRule aRule( *pCurrWrtShell->GetCurNumRule() );
String sOrigRule( aRule.GetName() );
- // --> OD 2008-07-08 #i91400#
+ // #i91400#
aRule.SetName( pStyle->GetNumRule()->GetName(),
*(pCurrWrtShell->GetDoc()) );
- // <--
pCurrWrtShell->ChgNumRuleFmts( aRule );
pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() );
@@ -1239,7 +1197,7 @@ void SwDocShell::LoadStyles( SfxObjectShell& rSource )
{
_LoadStyles(rSource, sal_False);
}
-/* -----------------16.05.2003 15:45-----------------
+/* --------------------------------------------------
bPreserveCurrentDocument determines whether SetFixFields() is called
This call modifies the source document. This mustn't happen when the source
is a document the user is working on.
@@ -1248,23 +1206,21 @@ void SwDocShell::LoadStyles( SfxObjectShell& rSource )
--------------------------------------------------*/
void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrentDocument )
{
-/* [Beschreibung]
-
- Diese Methode wird vom SFx gerufen, wenn aus einer Dokument-Vorlage
- Styles nachgeladen werden sollen. Bestehende Styles soll dabei
- "uberschrieben werden. Das Dokument mu"s daher neu formatiert werden.
- Daher werden die Applikationen in der Regel diese Methode "uberladen
- und in ihrer Implementierung die Implementierung der Basisklasse
- rufen.
+/* [Description]
+
+ This method is called by SFx if Styles have to be reloaded from a
+ document-template. Existing Styles should be overwritten by that.
+ That's why the document has to be reformatted. Therefore applications
+ will usually overload this method and call the baseclass' implementation
+ in their implementation.
*/
- // ist die Source unser Document, dann uebernehmen wir das
- // abpruefen selbst (wesentlich schneller und laeuft nicht ueber
- // die Kruecke SfxStylePool
+ // When the source is our document, we do the checking ourselves
+ // (much quicker and doesn't use the crutch StxStylePool).
if( rSource.ISA( SwDocShell ))
{
- //JP 28.05.99: damit die Kopf-/Fusszeilen nicht den fixen Inhalt
- // der Vorlage erhalten, einmal alle FixFelder der
- // Source aktualisieren
+ // in order for the Headers/Footers not to get the fixed content
+ // of the template, update all the Source's
+ // FixFields once.
if(!bPreserveCurrentDocument)
((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL);
if( pWrtShell )
@@ -1279,8 +1235,8 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
if( !bModified && pDoc->IsModified() && !pView )
{
- // die View wird spaeter angelegt, ueberschreibt aber das
- // Modify-Flag. Per Undo ist sowieso nichts mehr zu machen
+ // the View is created later, but overwrites the Modify-Flag.
+ // Undo doesn't work anymore anyways.
pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
@@ -1295,18 +1251,13 @@ void SwDocShell::FormatPage( const String& rPage, sal_Bool bColumn, SwWrtShell*
Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, bColumn, pActShell);
}
-Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily, BmpColorMode eColorMode )
+Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily )
{
if( SFX_STYLE_FAMILY_PSEUDO == eFamily )
- {
- if ( eColorMode == BMP_COLOR_NORMAL )
- return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM ));
- else
- return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM_HC ));
- }
-
- return SfxObjectShell::GetStyleFamilyBitmap( eFamily, eColorMode );
+ return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM ));
+ return SfxObjectShell::GetStyleFamilyBitmap( eFamily );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index a73a01011123..b0f0734e289a 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,15 +38,12 @@
#include <unotools/syslocale.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/numitem.hxx>
-// --> OD 2008-02-13 #newlistlevelattrs#
#include <editeng/lrspitem.hxx>
-// <--
#include <fmtcol.hxx>
#include <uitool.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <docsh.hxx>
-#include <errhdl.hxx>
#include <frmfmt.hxx>
#include <charfmt.hxx>
#include <poolfmt.hxx>
@@ -67,12 +65,10 @@
#include <numrule.hxx>
#include <fmthdft.hxx>
#include <svx/svxids.hrc>
-// --> OD 2008-02-12 #newlistlevelattrs#
#include <SwRewriter.hxx>
-// <--
-// MD 06.02.95: Die Formatnamen in der Liste aller Namen haben als
-// erstes Zeichen die Familie:
+// The Format names in the list of all names have the
+// following family as their first character:
#define cCHAR (sal_Unicode)'c'
#define cPARA (sal_Unicode)'p'
@@ -80,11 +76,11 @@
#define cPAGE (sal_Unicode)'g'
#define cNUMRULE (sal_Unicode)'n'
-// Dieses Zeichen wird bei der Herausgabe der Namen wieder entfernt und
-// die Familie wird neu generiert.
+// At the names' publication, this character is removed again and the
+// family is newly generated.
-// Ausserdem gibt es jetzt zusaetzlich das Bit bPhysical. Ist dieses Bit
-// sal_True, werden die Pool-Formatnamen NICHT mit eingetragen.
+// In addition now there is the Bit bPhysical. In case this Bit is
+// TRUE, the Pool-Formatnames are not being submitted.
class SwImplShellAction
{
@@ -122,8 +118,8 @@ SwImplShellAction::~SwImplShellAction()
}
/*--------------------------------------------------------------------
- Beschreibung: SwCharFormate finden/anlegen
- evtl. Style fuellen
+ Description: find/create SwCharFormate
+ possibly fill Style
--------------------------------------------------------------------*/
SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc,
@@ -138,12 +134,12 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc,
if( !pFmt && rName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD -
RES_POOLCOLL_TEXT_BEGIN ] )
{
- // Standard-Zeichenvorlage
+ // Standard-Character template
pFmt = (SwCharFmt*)rDoc.GetDfltCharFmt();
}
if( !pFmt && bCreate )
- { // Pool abklappern
+ { // explore Pool
const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
if(nId != USHRT_MAX)
pFmt = rDoc.GetCharFmtFromPool(nId);
@@ -168,8 +164,8 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc,
/*--------------------------------------------------------------------
- Beschreibung: ParaFormate finden/erzeugen
- Style fuellen
+ Description: find/create ParaFormats
+ fill Style
--------------------------------------------------------------------*/
SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc,
@@ -183,7 +179,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc,
{
pColl = rDoc.FindTxtFmtCollByName( rName );
if( !pColl && bCreate )
- { // Pool abklappern
+ { // explore Pool
const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
if(nId != USHRT_MAX)
pColl = rDoc.GetTxtCollFromPool(nId);
@@ -211,7 +207,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc,
/*--------------------------------------------------------------------
- Beschreibung: Rahmenformate
+ Description: Border formats
--------------------------------------------------------------------*/
@@ -225,7 +221,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc,
{
pFmt = rDoc.FindFrmFmtByName( rName );
if( !pFmt && bCreate )
- { // Pool abklappern
+ { // explore Pool
const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT);
if(nId != USHRT_MAX)
pFmt = rDoc.GetFrmFmtFromPool(nId);
@@ -249,7 +245,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc,
}
/*--------------------------------------------------------------------
- Beschreibung: Seitendescriptoren
+ Description: Page descriptors
--------------------------------------------------------------------*/
@@ -324,7 +320,6 @@ sal_uInt16 lcl_FindName( const SwPoolFmtList& rLst, SfxStyleFamily eFam,
{
if( rLst.Count() )
{
- // suchen
String sSrch( ' ' );
switch( eFam )
{
@@ -364,7 +359,7 @@ sal_Bool FindPhyStyle( SwDoc& rDoc, const String& rName, SfxStyleFamily eFam )
/*--------------------------------------------------------------------
- Beschreibung: Einfuegen von Strings in die Liste der Vorlagen
+ Description: Add Strings to the list of templates
--------------------------------------------------------------------*/
@@ -384,7 +379,7 @@ void SwPoolFmtList::Append( char cChar, const String& rStr )
}
/*--------------------------------------------------------------------
- Beschreibung: Liste kompletti loeschen
+ Description: Erase the list completely
--------------------------------------------------------------------*/
@@ -393,11 +388,9 @@ void SwPoolFmtList::Erase()
DeleteAndDestroy( 0, Count() );
}
-/* */
-
/*--------------------------------------------------------------------
- Beschreibung: UI-seitige implementierung von StyleSheets
- greift auf die Core-Engine zu
+ Description: UI-sided implementation of StyleSheets
+ uses the Core-Engine
--------------------------------------------------------------------*/
SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument,
@@ -417,9 +410,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument,
aCoreSet(GetPool().GetPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_PARATR_BEGIN, RES_PARATR_END - 1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
- // <--
RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
SID_ATTR_PAGE, SID_ATTR_PAGE_EXT1,
@@ -461,7 +452,7 @@ SwDocStyleSheet::SwDocStyleSheet( const SwDocStyleSheet& rOrg) :
}
/*--------------------------------------------------------------------
- Beschreibung: Zuruecksetzen
+ Description: Reset
--------------------------------------------------------------------*/
@@ -474,7 +465,7 @@ void SwDocStyleSheet::Reset()
}
/*--------------------------------------------------------------------
- Beschreibung: virtuelle Methoden
+ Description: virtual methods
--------------------------------------------------------------------*/
@@ -482,7 +473,7 @@ const String& SwDocStyleSheet::GetParent() const
{
if( !bPhysical )
{
- // dann pruefe, ob schon im Doc vorhanden
+ // check if it's already in document
SwFmt* pFmt = 0;
SwGetPoolIdFromName eGetType;
switch(nFamily)
@@ -505,11 +496,11 @@ const String& SwDocStyleSheet::GetParent() const
case SFX_STYLE_FAMILY_PAGE:
case SFX_STYLE_FAMILY_PSEUDO:
default:
- return aEmptyStr; // es gibt keinen Parent
+ return aEmptyStr; // there's no parent
}
String sTmp;
- if( !pFmt ) // noch nicht vorhanden, also dflt. Parent
+ if( !pFmt ) // not yet there, so default Parent
{
sal_uInt16 i = SwStyleNameMapper::GetPoolIdFromUIName( aName, eGetType );
i = ::GetPoolParent( i );
@@ -529,7 +520,7 @@ const String& SwDocStyleSheet::GetParent() const
}
/*--------------------------------------------------------------------
- Beschreibung: Nachfolger
+ Description: Follower
--------------------------------------------------------------------*/
@@ -544,7 +535,7 @@ const String& SwDocStyleSheet::GetFollow() const
}
/*--------------------------------------------------------------------
- Beschreibung: Welche Verkettung ist moeglich
+ Description: What Linkage is possible
--------------------------------------------------------------------*/
@@ -558,13 +549,13 @@ sal_Bool SwDocStyleSheet::HasFollowSupport() const
case SFX_STYLE_FAMILY_CHAR :
case SFX_STYLE_FAMILY_PSEUDO: return sal_False;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
return sal_False;
}
/*--------------------------------------------------------------------
- Beschreibung: Parent ?
+ Description: Parent ?
--------------------------------------------------------------------*/
@@ -596,7 +587,7 @@ sal_Bool SwDocStyleSheet::HasClearParentSupport() const
}
/*--------------------------------------------------------------------
- Beschreibung: textuelle Beschreibung ermitteln
+ Description: determine textual description
--------------------------------------------------------------------*/
String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
{
@@ -667,7 +658,7 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
case SID_ATTR_AUTO_STYLE_UPDATE:
case SID_PARA_BACKGRND_DESTINATION:
case RES_PAGEDESC:
- //CTL no yet supported
+ //CTL not yet supported
case RES_CHRATR_CTL_FONT:
case RES_CHRATR_CTL_FONTSIZE:
case RES_CHRATR_CTL_LANGUAGE:
@@ -733,8 +724,8 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
}
pItem = aIter.NextItem();
}
- //Sonderbehandlung fuer Umburch, Seitenvorlage und Seitenoffset
- if(sBreak.Len() && !sModel.Len()) // wemm Model. dann ist Break ungueltig
+ // Special treatment for Break, Page template and Site offset
+ if(sBreak.Len() && !sModel.Len()) // when Model, break is invalid
{
if(aDesc.Len())
aDesc += sPlus;
@@ -758,9 +749,6 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
}
else if( SFX_STYLE_FAMILY_PSEUDO == nFamily )
{
-// if( pNumRule )
-// return pNumRule->GetName();
- //os: was sollte man bei Numerierungen schon anzeigen?
return aEmptyStr;
}
@@ -774,7 +762,7 @@ String SwDocStyleSheet::GetDescription()
}
/*--------------------------------------------------------------------
- Beschreibung: Namen setzen
+ Description: Set names
--------------------------------------------------------------------*/
@@ -796,7 +784,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
{
case SFX_STYLE_FAMILY_CHAR :
{
- ASSERT(pCharFmt, "SwCharFormat fehlt!");
+ OSL_ENSURE(pCharFmt, "SwCharFormat missing!");
if( pCharFmt && pCharFmt->GetName() != rStr )
{
pCharFmt->SetName( rStr );
@@ -806,7 +794,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
}
case SFX_STYLE_FAMILY_PARA :
{
- ASSERT(pColl, "Collektion fehlt!");
+ OSL_ENSURE(pColl, "Collection missing!");
if( pColl && pColl->GetName() != rStr )
{
if (pColl->GetName().Len() > 0)
@@ -820,7 +808,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
}
case SFX_STYLE_FAMILY_FRAME:
{
- ASSERT(pFrmFmt, "FrmFmt fehlt!");
+ OSL_ENSURE(pFrmFmt, "FrmFmt missing!");
if( pFrmFmt && pFrmFmt->GetName() != rStr )
{
if (pFrmFmt->GetName().Len() > 0)
@@ -833,13 +821,12 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
break;
}
case SFX_STYLE_FAMILY_PAGE :
- ASSERT(pDesc, "PageDesc fehlt!");
+ OSL_ENSURE(pDesc, "PageDesc missing!");
if( pDesc && pDesc->GetName() != rStr )
{
- //PageDesc setzen - mit vorherigem kopieren - ist fuer das
- //setzen des Namens wohl nicht notwendig. Deshalb erlauben
- //wir hier mal einen cast.
- // -> #116530#
+ // Set PageDesc - copy with earlier one - probably not
+ // necessary for setting the name. So here we allow a
+ // cast.
SwPageDesc aPageDesc(*((SwPageDesc*)pDesc));
String aOldName(aPageDesc.GetName());
@@ -849,16 +836,14 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
rDoc.GetIDocumentUndoRedo().DoUndo(aOldName.Len() > 0);
rDoc.ChgPageDesc(aOldName, aPageDesc);
rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo);
- // <- #116530#
rDoc.SetModified();
bChg = sal_True;
}
break;
case SFX_STYLE_FAMILY_PSEUDO:
- ASSERT(pNumRule, "NumRule fehlt!");
+ OSL_ENSURE(pNumRule, "NumRule missing!");
- // -> #106897#
if (pNumRule)
{
String aOldName = pNumRule->GetName();
@@ -876,25 +861,23 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
}
else
{
- // --> OD 2008-07-08 #i91400#
+ // #i91400#
((SwNumRule*)pNumRule)->SetName( rStr, rDoc );
- // <--
rDoc.SetModified();
bChg = sal_True;
}
}
- // <- #106897#
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
if( bChg )
{
- rPool.First(); // interne Liste muss geupdatet werden
+ rPool.First(); // internal list has to be updated
rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
SwEditShell* pSh = rDoc.GetEditShell();
if( pSh )
@@ -904,7 +887,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
}
/*--------------------------------------------------------------------
- Beschreibung: Ableitungshirachie
+ Description: hierarchy of deduction
--------------------------------------------------------------------*/
@@ -914,19 +897,19 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr)
switch(nFamily)
{
case SFX_STYLE_FAMILY_CHAR :
- ASSERT( pCharFmt, "SwCharFormat fehlt!" )
+ OSL_ENSURE( pCharFmt, "SwCharFormat missing!" );
if( 0 != ( pFmt = pCharFmt ) && rStr.Len() )
pParent = lcl_FindCharFmt(rDoc, rStr);
break;
case SFX_STYLE_FAMILY_PARA :
- ASSERT( pColl, "Collektion fehlt!")
+ OSL_ENSURE( pColl, "Collektion missing!");
if( 0 != ( pFmt = pColl ) && rStr.Len() )
pParent = lcl_FindParaFmt( rDoc, rStr );
break;
case SFX_STYLE_FAMILY_FRAME:
- ASSERT(pFrmFmt, "FrameFormat fehlt!");
+ OSL_ENSURE(pFrmFmt, "FrameFormat missing!");
if( 0 != ( pFmt = pFrmFmt ) && rStr.Len() )
pParent = lcl_FindFrmFmt( rDoc, rStr );
break;
@@ -935,7 +918,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr)
case SFX_STYLE_FAMILY_PSEUDO:
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
sal_Bool bRet = sal_False;
@@ -959,7 +942,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr)
}
/*--------------------------------------------------------------------
- Beschreibung: Nachfolger detzen
+ Description: Set Follower
--------------------------------------------------------------------*/
@@ -973,7 +956,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr)
{
case SFX_STYLE_FAMILY_PARA :
{
- ASSERT(pColl, "Collection fehlt!");
+ OSL_ENSURE(pColl, "Collection missing!");
if( pColl )
{
SwTxtFmtColl* pFollow = pColl;
@@ -986,7 +969,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr)
}
case SFX_STYLE_FAMILY_PAGE :
{
- ASSERT(pDesc, "PageDesc fehlt!");
+ OSL_ENSURE(pDesc, "PageDesc missing!");
if( pDesc )
{
const SwPageDesc* pFollowDesc = rStr.Len()
@@ -1009,14 +992,14 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr)
case SFX_STYLE_FAMILY_PSEUDO:
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknwown style family");
}
return sal_True;
}
/*--------------------------------------------------------------------
- Beschreibung: ueber Name und Family, Mask den ItemSet rausholen
+ Description: extract ItemSet to Name and Family, Mask
--------------------------------------------------------------------*/
SfxItemSet& SwDocStyleSheet::GetItemSet()
@@ -1028,8 +1011,9 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
{
case SFX_STYLE_FAMILY_CHAR:
{
- ASSERT(pCharFmt, "Wo ist das SwCharFmt");
+ OSL_ENSURE(pCharFmt, "Where's SwCharFmt");
aCoreSet.Put(pCharFmt->GetAttrSet());
+
if(pCharFmt->DerivedFrom())
aCoreSet.SetParent(&pCharFmt->DerivedFrom()->GetAttrSet());
}
@@ -1039,26 +1023,28 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
{
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
aBoxInfo.SetTable( sal_False );
- aBoxInfo.SetDist( sal_True); // Abstandsfeld immer anzeigen
- aBoxInfo.SetMinDist( sal_True );// Minimalgroesse in Tabellen und Absaetzen setzen
- aBoxInfo.SetDefDist( MIN_BORDER_DIST );// Default-Abstand immer setzen
- // Einzelne Linien koennen nur in Tabellen DontCare-Status haben
+ aBoxInfo.SetDist( sal_True ); // always show gap field
+ aBoxInfo.SetMinDist( sal_True );// set minimum size in tables and paragraphs
+ aBoxInfo.SetDefDist( MIN_BORDER_DIST );// always set Default-Gap
+ // Single lines can only have DontCare-Status in tables
aBoxInfo.SetValid( VALID_DISABLE, sal_True );
if ( nFamily == SFX_STYLE_FAMILY_PARA )
{
- ASSERT(pColl, "Wo ist die Collektion");
+ OSL_ENSURE(pColl, "Where's Collection");
aCoreSet.Put(pColl->GetAttrSet());
aCoreSet.Put( aBoxInfo );
aCoreSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, pColl->IsAutoUpdateFmt()));
+
if(pColl->DerivedFrom())
aCoreSet.SetParent(&pColl->DerivedFrom()->GetAttrSet());
}
else
{
- ASSERT(pFrmFmt, "Wo ist das FrmFmt");
+ OSL_ENSURE(pFrmFmt, "Where's FrmFmt");
aCoreSet.Put(pFrmFmt->GetAttrSet());
aCoreSet.Put( aBoxInfo );
aCoreSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, pFrmFmt->IsAutoUpdateFmt()));
+
if(pFrmFmt->DerivedFrom())
aCoreSet.SetParent(&pFrmFmt->DerivedFrom()->GetAttrSet());
}
@@ -1067,29 +1053,28 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
case SFX_STYLE_FAMILY_PAGE :
{
- ASSERT(pDesc, "Kein PageDescriptor");
+ OSL_ENSURE(pDesc, "No PageDescriptor");
::PageDescToItemSet(*((SwPageDesc*)pDesc), aCoreSet);
}
break;
case SFX_STYLE_FAMILY_PSEUDO:
{
- ASSERT(pNumRule, "Keine NumRule");
+ OSL_ENSURE(pNumRule, "No NumRule");
SvxNumRule aRule = pNumRule->MakeSvxNumRule();
aCoreSet.Put(SvxNumBulletItem(aRule));
}
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
- // Member der Basisklasse
+ // Member of Baseclass
pSet = &aCoreSet;
return aCoreSet;
}
-// --> OD 2008-02-13 #newlistlevelattrs#
void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet )
{
if ( nFamily != SFX_STYLE_FAMILY_PARA )
@@ -1097,10 +1082,10 @@ void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet )
return;
}
- ASSERT( pColl, "<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - missing paragraph style");
+ OSL_ENSURE( pColl, "<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - missing paragraph style");
if ( pColl->AreListLevelIndentsApplicable() )
{
- ASSERT( pColl->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET,
+ OSL_ENSURE( pColl->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET,
"<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - list level indents are applicable at paragraph style, but no list style found. Serious defect -> please inform OD." );
const String sNumRule = pColl->GetNumRule().GetValue();
if( sNumRule.Len() )
@@ -1120,33 +1105,25 @@ void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet )
}
}
}
-// <--
-
-/*--------------------------------------------------------------------
- Beschreibung: ItemSet setzen
- --------------------------------------------------------------------*/
-// --> OD 2008-02-12 #newlistlevelattrs#
// handling of parameter <bResetIndentAttrsAtParagraphStyle>
void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
const bool bResetIndentAttrsAtParagraphStyle )
{
- // gegebenenfalls Format erst ermitteln
+ // if applicable determine format first
if(!bPhysical)
FillStyleSheet( FillPhysical );
SwImplShellAction aTmpSh( rDoc );
- ASSERT( &rSet != &aCoreSet, "SetItemSet mit eigenem Set ist nicht erlaubt" );
+ OSL_ENSURE( &rSet != &aCoreSet, "SetItemSet with own Set is not allowed" );
- // --> OD 2008-02-12 #newlistlevelattrs#
if (rDoc.GetIDocumentUndoRedo().DoesUndo())
{
SwRewriter aRewriter;
aRewriter.AddRule( UNDO_ARG1, GetName() );
rDoc.GetIDocumentUndoRedo().StartUndo( UNDO_INSFMTATTR, &aRewriter );
}
- // <--
SwFmt* pFmt = 0;
SwPageDesc* pNewDsc = 0;
@@ -1156,14 +1133,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
case SFX_STYLE_FAMILY_CHAR :
{
- ASSERT(pCharFmt, "Wo ist das CharFormat");
+ OSL_ENSURE(pCharFmt, "Where's CharFormat");
pFmt = pCharFmt;
}
break;
case SFX_STYLE_FAMILY_PARA :
{
- ASSERT(pColl, "Wo ist die Collection");
+ OSL_ENSURE(pColl, "Where's Collection");
const SfxPoolItem* pAutoUpdate;
if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate ))
{
@@ -1192,24 +1169,23 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
}
}
- // Document auf die neue Bedingungen updaten
+ // Update document to new conditions
SwCondCollCondChg aMsg( pColl );
pColl->ModifyNotification( &aMsg, &aMsg );
}
else if( pCondItem && !pColl->GetDepends() )
{
- // keine bedingte Vorlage, dann erstmal erzeugen und
- // alle wichtigen Werte uebernehmen
+ // no conditional template, then first create and adopt
+ // all important values
SwConditionTxtFmtColl* pCColl = rDoc.MakeCondTxtFmtColl(
pColl->GetName(), (SwTxtFmtColl*)pColl->DerivedFrom() );
if( pColl != &pColl->GetNextTxtFmtColl() )
pCColl->SetNextTxtFmtColl( pColl->GetNextTxtFmtColl() );
- //pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );//#outline level,zhaojianwei
if( pColl->IsAssignedToListLevelOfOutlineStyle())
pCColl->AssignToListLevelOfOutlineStyle(pColl->GetAssignedOutlineStyleLevel());
else
- pCColl->DeleteAssignmentToListLevelOfOutlineStyle();//<--end,zhaojianwei
+ pCColl->DeleteAssignmentToListLevelOfOutlineStyle();
@@ -1229,7 +1205,6 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
rDoc.DelTxtFmtColl( pColl );
pColl = pCColl;
}
- // --> OD 2008-02-12 #newlistlevelattrs#
if ( bResetIndentAttrsAtParagraphStyle &&
rSet.GetItemState( RES_PARATR_NUMRULE, sal_False, 0 ) == SFX_ITEM_SET &&
rSet.GetItemState( RES_LR_SPACE, sal_False, 0 ) != SFX_ITEM_SET &&
@@ -1237,7 +1212,6 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
rDoc.ResetAttrAtFormat( RES_LR_SPACE, *pColl );
}
- // <--
// #i56252: If a standard numbering style is assigned to a standard paragraph style
// we have to create a physical instance of the numbering style. If we do not and
@@ -1291,7 +1265,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
}
case SFX_STYLE_FAMILY_FRAME:
{
- ASSERT(pFrmFmt, "Wo ist das FrmFmt");
+ OSL_ENSURE(pFrmFmt, "Where's FrmFmt");
const SfxPoolItem* pAutoUpdate;
if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate ))
{
@@ -1303,16 +1277,15 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
case SFX_STYLE_FAMILY_PAGE :
{
- ASSERT(pDesc, "Wo ist der PageDescriptor");
+ OSL_ENSURE(pDesc, "Where's PageDescriptor");
if( rDoc.FindPageDescByName( pDesc->GetName(), &nPgDscPos ))
{
pNewDsc = new SwPageDesc( *pDesc );
- // --> OD 2005-05-09 #i48949# - no undo actions for the
+ // #i48949# - no undo actions for the
// copy of the page style
::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
rDoc.CopyPageDesc(*pDesc, *pNewDsc); // #i7983#
- // <--
pFmt = &pNewDsc->GetMaster();
}
@@ -1321,7 +1294,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
case SFX_STYLE_FAMILY_PSEUDO:
{
- ASSERT(pNumRule, "Wo ist die NumRule");
+ OSL_ENSURE(pNumRule, "Where's NumRule");
if (!pNumRule)
break;
@@ -1333,22 +1306,18 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
pSetRule->UnLinkGraphics();
- //SwNumRule aSetRule(rDoc.GetUniqueNumRuleName());
SwNumRule aSetRule(*pNumRule);
aSetRule.SetSvxRule(*pSetRule, &rDoc);
rDoc.ChgNumRuleFmts( aSetRule );
}
break;
case SFX_ITEM_DONTCARE:
- // NumRule auf default Werte
- // was sind die default Werte?
+ // set NumRule to default values
+ // what are the default values?
{
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aRule( pNumRule->GetName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
rDoc.ChgNumRuleFmts( aRule );
}
break;
@@ -1357,7 +1326,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
if( pFmt && rSet.Count())
@@ -1366,12 +1335,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
const SfxPoolItem* pItem = aIter.GetCurItem();
while( sal_True )
{
- if( IsInvalidItem( pItem ) ) // Clearen
+ if( IsInvalidItem( pItem ) ) // Clear
{
- // --> OD 2008-02-12 #newlistlevelattrs#
// use method <SwDoc::ResetAttrAtFormat(..)> in order to
// create an Undo object for the attribute reset.
-// pFmt->ResetAttr( rSet.GetWhichByPos(aIter.GetCurPos()));
rDoc.ResetAttrAtFormat( rSet.GetWhichByPos(aIter.GetCurPos()),
*pFmt );
}
@@ -1394,24 +1361,22 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
delete pNewDsc;
}
else
- rDoc.ChgFmt(*pFmt, aSet); // alles gesetzten Putten
+ rDoc.ChgFmt(*pFmt, aSet); // put all that is set
}
else
{
aCoreSet.ClearItem();
- if( pNewDsc ) // den muessen wir noch vernichten!!
+ if( pNewDsc ) // we still need to delete it
{
rDoc.PreDelPageDesc(pNewDsc); // #i7983#
delete pNewDsc;
}
}
- // --> OD 2008-02-12 #newlistlevelattrs#
if (rDoc.GetIDocumentUndoRedo().DoesUndo())
{
rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
}
- // <--
}
void lcl_SaveStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc )
@@ -1557,7 +1522,7 @@ void lcl_DeleteInfoStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc )
}
/*--------------------------------------------------------------------
- Beschreibung: Das Format ermitteln
+ Description: determine the format
--------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
@@ -1726,7 +1691,7 @@ sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
if( pFmt )
{
- ASSERT( bPhysical, "Format nicht gefunden" );
+ OSL_ENSURE( bPhysical, "Format not found" );
nHelpId = pFmt->GetPoolHelpId();
if( pFmt->GetPoolHlpFileId() != UCHAR_MAX )
@@ -1746,7 +1711,7 @@ sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
}
/*--------------------------------------------------------------------
- Beschreibung: Neues Format in der Core anlegen
+ Description: Create new format in Core
--------------------------------------------------------------------*/
@@ -1794,24 +1759,19 @@ void SwDocStyleSheet::Create()
pNumRule = lcl_FindNumRule( rDoc, aName );
if( !pNumRule )
{
- //JP 05.02.99: temp Namen erzeugen, damit kein ASSERT kommt
String sTmpNm( aName );
if( !aName.Len() )
sTmpNm = rDoc.GetUniqueNumRuleName();
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule* pRule = rDoc.GetNumRuleTbl()[
rDoc.MakeNumRule( sTmpNm, 0, sal_False,
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() ) ];
- // <--
- // <--
pRule->SetAutoRule( sal_False );
if( !aName.Len() )
{
- // --> OD 2008-07-08 #i91400#
+ // #i91400#
pRule->SetName( aName, rDoc );
- // <--
}
pNumRule = pRule;
}
@@ -1822,12 +1782,6 @@ void SwDocStyleSheet::Create()
aCoreSet.ClearItem();
}
-/*--------------------------------------------------------------------
- Beschreibung: Konkrete Formate rausholen
- --------------------------------------------------------------------*/
-
-
-
SwCharFmt* SwDocStyleSheet::GetCharFmt()
{
if(!bPhysical)
@@ -1835,7 +1789,6 @@ SwCharFmt* SwDocStyleSheet::GetCharFmt()
return pCharFmt;
}
-
SwTxtFmtColl* SwDocStyleSheet::GetCollection()
{
if(!bPhysical)
@@ -1843,7 +1796,6 @@ SwTxtFmtColl* SwDocStyleSheet::GetCollection()
return pColl;
}
-
const SwPageDesc* SwDocStyleSheet::GetPageDesc()
{
if(!bPhysical)
@@ -1860,12 +1812,12 @@ const SwNumRule * SwDocStyleSheet::GetNumRule()
void SwDocStyleSheet::SetNumRule(const SwNumRule& rRule)
{
- DBG_ASSERT(pNumRule, "Wo ist die NumRule");
+ OSL_ENSURE(pNumRule, "Wo ist die NumRule");
rDoc.ChgNumRuleFmts( rRule );
}
-// Namen UND Familie aus String re-generieren
-// First() und Next() (s.u.) fuegen einen Kennbuchstaben an Pos.1 ein
+// re-generate Name AND Family from String
+// First() and Next() (see below) insert an identification letter at Pos.1
void SwDocStyleSheet::PresetNameAndFamily(const String& rName)
{
@@ -1882,7 +1834,7 @@ void SwDocStyleSheet::PresetNameAndFamily(const String& rName)
}
/*--------------------------------------------------------------------
- Beschreibung: Ist das Format physikalisch schon vorhanden
+ Description: Is the format physically present yet
--------------------------------------------------------------------*/
@@ -1906,7 +1858,6 @@ SwFrmFmt* SwDocStyleSheet::GetFrmFmt()
return pFrmFmt;
}
-
sal_Bool SwDocStyleSheet::IsUsed() const
{
if( !bPhysical )
@@ -1915,7 +1866,6 @@ sal_Bool SwDocStyleSheet::IsUsed() const
pThis->FillStyleSheet( FillOnlyName );
}
- // immer noch nicht ?
if( !bPhysical )
return sal_False;
@@ -1931,7 +1881,7 @@ sal_Bool SwDocStyleSheet::IsUsed() const
return pNumRule ? rDoc.IsUsed( *pNumRule ) : sal_False;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
return sal_False;
}
return rDoc.IsUsed( *pMod );
@@ -2008,7 +1958,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp");
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
return 0;
}
@@ -2024,7 +1974,6 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp");
const String *pTemplate = rDoc.GetDocPattern( nFileId );
if( pTemplate )
{
-// const String aHelpPath(MakeHelpPath(*pTemplate));
rFile = *pTemplate;
}
}
@@ -2033,9 +1982,9 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp");
nId = nPoolId;
}
- // weil sich der SFX so anstellt mit der HilfeId:
+ // because SFX acts like that, with HelpId:
if( USHRT_MAX == nId )
- nId = 0; // entsp. keine Hilfe anzeigen
+ nId = 0; // don't show Help accordingly
return nId;
}
@@ -2044,7 +1993,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp");
void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId )
{
sal_uInt8 nFileId = static_cast< sal_uInt8 >(rDoc.SetDocPattern( r ));
- sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX hat eigenmaechtig auf sal_uLong umgestellt!
+ sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX changed over to ULONG arbitrarily!
SwFmt* pTmpFmt = 0;
switch( nFamily )
@@ -2063,7 +2012,7 @@ void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId )
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
return ;
}
if( pTmpFmt )
@@ -2073,11 +2022,8 @@ void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId )
}
}
-
-/* */
-
/*--------------------------------------------------------------------
- Beschreibung: Methoden fuer den DocStyleSheetPool
+ Description: methods for DocStyleSheetPool
--------------------------------------------------------------------*/
SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, sal_Bool bOrg )
@@ -2122,7 +2068,7 @@ SfxStyleSheetBase& SwDocStyleSheetPool::Make(
SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOrg*/)
{
- ASSERT(!this , "Create im SW-Stylesheet-Pool geht nicht" );
+ OSL_ENSURE(!this , "Create im SW-Stylesheet-Pool geht nicht" );
return NULL;
}
@@ -2130,7 +2076,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOr
SfxStyleSheetBase* SwDocStyleSheetPool::Create( const String &,
SfxStyleFamily, sal_uInt16 )
{
- ASSERT( !this, "Create im SW-Stylesheet-Pool geht nicht" );
+ OSL_ENSURE( !this, "Create im SW-Stylesheet-Pool geht nicht" );
return NULL;
}
@@ -2164,7 +2110,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
sal_Bool bSwSrcPool = GetAppName() == rSource.GetPool().GetAppName();
if( SFX_STYLE_FAMILY_PAGE == eFamily && bSwSrcPool )
{
- // gesondert behandeln!!
+ // deal with separately!
SwPageDesc* pDestDsc =
(SwPageDesc*)((SwDocStyleSheet&)rTarget).GetPageDesc();
SwPageDesc* pCpyDsc =
@@ -2207,8 +2153,8 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
}
break;
case SFX_STYLE_FAMILY_PSEUDO:
- // Eine NumRule besteht nur aus einem Item, also muss man
- // hier nichts loeschen.
+ // A NumRule only consists of one Item, so nothing has
+ // to be deleted here.
break;
default:; //prevent warning
}
@@ -2220,9 +2166,8 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
pTargetFmt->ResetFmtAttr( RES_PAGEDESC, RES_FRMATR_END-1 );
else
{
- // --> OD 2007-01-25 #i73790# - method renamed
+ // #i73790# - method renamed
pTargetFmt->ResetAllFmtAttr();
- // <--
}
if( USHRT_MAX != nPgDscPos )
@@ -2287,13 +2232,13 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle)
case SFX_STYLE_FAMILY_PSEUDO:
{
if( !rDoc.DelNumRule( rName ) )
- // Broadcast nur versenden, wenn etwas geloescht wurde
+ // Only send Broadcast, when something was deleted
bBroadcast = sal_False;
}
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
bBroadcast = sal_False;
}
@@ -2329,7 +2274,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
sal_Bool bRet = sal_False;
@@ -2343,7 +2288,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
if( bRet )
{
- // nur fuer das Broadcasting
+ // only for Broadcasting
mxStyleSheet->PresetName( rStyle );
mxStyleSheet->PresetParent( rParent );
if( SFX_STYLE_FAMILY_PARA == eFam )
@@ -2366,7 +2311,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName,
sal_uInt16 nSMask = n;
if( SFX_STYLE_FAMILY_PARA == eFam && rDoc.get(IDocumentSettingAccess::HTML_MODE) )
{
- // dann sind nur HTML-Vorlagen von Interesse
+ // then only HTML-Templates are of interest
if( USHRT_MAX == nSMask )
nSMask = SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED;
else
@@ -2412,18 +2357,18 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName,
!(bSearchUsed && (bOrganizer || rDoc.IsUsed(*pRule)) ) &&
(( nSMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(pRule->GetPoolFmtId() & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bSearchUsed ))
bFnd = sal_False;
}
break;
default:
- ASSERT(!this, "unbekannte Style-Familie");
+ OSL_ENSURE(!this, "unknown style family");
}
}
- // dann noch die Maske auswerten:
+ // then evaluate the mask:
if( pMod && !(bSearchUsed && (bOrganizer || rDoc.IsUsed(*pMod)) ) )
{
const sal_uInt16 nId = SFX_STYLE_FAMILY_PAGE == eFam
@@ -2432,15 +2377,13 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName,
if( ( nSMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(nId & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bSearchUsed )
bFnd = sal_False;
}
return bFnd ? mxStyleSheet.get() : 0;
}
-/* */
-
SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase,
SfxStyleFamily eFam, sal_uInt16 n )
: SfxStyleSheetIterator( pBase, eFam, n ),
@@ -2459,7 +2402,7 @@ SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase,
sal_uInt16 SwStyleSheetIterator::Count()
{
- // Liste richtig fuellen lassen !!
+ // let the list fill correctly!!
if( !bFirstCalled )
First();
return aLst.Count();
@@ -2467,7 +2410,7 @@ sal_uInt16 SwStyleSheetIterator::Count()
SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_uInt16 nIdx )
{
- // gefunden
+ // found
if( !bFirstCalled )
First();
mxStyleSheet->PresetNameAndFamily( *aLst[ nIdx ] );
@@ -2479,12 +2422,12 @@ SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_uInt16 nIdx )
SfxStyleSheetBase* SwStyleSheetIterator::First()
{
- // Alte Liste loeschen
+ // Delete old list
bFirstCalled = sal_True;
nLastPos = 0;
aLst.Erase();
- // aktuellen loeschen
+ // Delete current
mxIterSheet->Reset();
SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc();
@@ -2506,13 +2449,13 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
const sal_Bool bUsed = bIsSearchUsed && (bOrganizer || rDoc.IsUsed(*pFmt));
if( !bUsed )
{
- // Standard ist keine Benutzervorlage #46181#
+ // Standard is no User template
const sal_uInt16 nId = rDoc.GetDfltCharFmt() == pFmt ?
sal_uInt16( RES_POOLCHR_INET_NORMAL ):
pFmt->GetPoolFmtId();
if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(nId & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bIsSearchUsed )
continue;
@@ -2561,7 +2504,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
sal_uInt16 nSMask = nSrchMask;
if( rDoc.get(IDocumentSettingAccess::HTML_MODE) )
{
- // dann sind nur HTML-Vorlagen von Interesse
+ // then only HTML-Template are of interest
if( USHRT_MAX == nSMask )
nSMask = SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF |
SFXSTYLEBIT_USED;
@@ -2604,15 +2547,14 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
case SWSTYLEBIT_EXTRA:
if((nId & COLL_GET_RANGE_BITS) != COLL_EXTRA_BITS) continue;
break;
-
case SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF:
if(IsPoolUserFmt(nId))
break;
- // ansonten weiter
+ // otherwise move on
case SWSTYLEBIT_HTML:
if( (nId & COLL_GET_RANGE_BITS) != COLL_HTML_BITS)
{
- // einige wollen wir aber auch in dieser Section sehen
+ // but some we also want to see in this section
sal_Bool bWeiter = sal_True;
switch( nId )
{
@@ -2641,7 +2583,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if( RES_CONDTXTFMTCOLL != pColl->Which() ) continue;
break;
default:
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
if( bIsSearchUsed )
continue;
}
@@ -2681,7 +2623,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
bIsSearchUsed, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, cPARA ) ;
if( !bAll )
{
- // dann auch die, die wir mappen:
+ // then also the ones, that we are mapping:
static sal_uInt16 aPoolIds[] = {
RES_POOLCOLL_SENDADRESS, // --> ADDRESS
RES_POOLCOLL_TABLE_HDLN, // --> TH
@@ -2732,7 +2674,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
{
if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(nId & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bIsSearchUsed )
{
continue;
@@ -2763,7 +2705,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
{
if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(nId & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bIsSearchUsed )
continue;
}
@@ -2789,7 +2731,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
{
if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(rRule.GetPoolFmtId() & USER_FMT)
- // benutzte gesucht und keine gefunden
+ // searched for used and found none
: bIsSearchUsed )
continue;
}
@@ -2830,16 +2772,16 @@ SfxStyleSheetBase* SwStyleSheetIterator::Next()
SfxStyleSheetBase* SwStyleSheetIterator::Find( const UniString& rName )
{
- // suchen
+ // searching
if( !bFirstCalled )
First();
nLastPos = lcl_FindName( aLst, nSearchFamily, rName );
if( USHRT_MAX != nLastPos )
{
- // gefunden
+ // found
mxStyleSheet->PresetNameAndFamily(*aLst[nLastPos]);
- // neuer Name gesetzt, also bestimme seine Daten
+ // new name is set, so determine its Data
mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName );
if( !mxStyleSheet->IsPhysical() )
mxStyleSheet->SetPhysical( sal_False );
@@ -2874,7 +2816,7 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList,
bUsed = rDoc.IsPoolPageDescUsed( nId );
break;
default:
- ASSERT( !this, "unknown PoolFmt-Id" );
+ OSL_ENSURE( !this, "unknown PoolFmt-Id" );
}
if ( bUsed )
aLst.Append( cType, *rList[i] );
@@ -2887,7 +2829,7 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList,
void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- // suchen und aus der Anzeige-Liste entfernen !!
+ // search and remove from View-List!!
if( rHint.ISA( SfxStyleSheetHint ) &&
SFX_STYLESHEET_ERASED == ((SfxStyleSheetHint&) rHint).GetHint() )
{
@@ -2904,3 +2846,4 @@ void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/error.src b/sw/source/ui/app/error.src
index 30b9bc7c0e35..fbacdb7f87e9 100644
--- a/sw/source/ui/app/error.src
+++ b/sw/source/ui/app/error.src
@@ -24,18 +24,16 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#define __RSC
+#define __RSC
- //#include <tools/errcode.hxx>
#include "globals.hrc"
#include "app.hrc"
#include "swerror.h"
-#include "comcore.hrc" // MS: Warum gibst auf der Core-Seite
- // jetzt Resourcen
+#include "comcore.hrc" // MS: Why are there resources at the Core-Side now
/*--------------------------------------------------------------------
- Beschreibung: Strings
+ Description: Strings
--------------------------------------------------------------------*/
String STR_COMCORE_READERROR
@@ -47,7 +45,7 @@ String STR_COMCORE_CANT_SHOW
Text [ en-US ] = "Graphic cannot be displayed." ;
};
/*--------------------------------------------------------------------
- Beschreibung: Boxes
+ Description: Boxes
--------------------------------------------------------------------*/
InfoBox ERR_CLPBRD_WRITE
{
@@ -95,10 +93,6 @@ Resource RID_SW_ERRHDL
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_FASTSAVE_ERR )
{
- /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */
- /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */
- /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */
- /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */
Text [ en-US ] = "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL )
@@ -149,12 +143,10 @@ Resource RID_SW_ERRHDL
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLSPLIT_ERROR )
{
- /* ### ACHTUNG: Neuer Text in Resource? Zellen können nicht mehr geteilt werden : Zellen k÷nnen nicht mehr geteilt werden */
Text [ en-US ] = "Cells cannot be further split." ;
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLINSCOL_ERROR )
{
- /* ### ACHTUNG: Neuer Text in Resource? weitere Spalten können nicht eingefügt werden : weitere Spalten k÷nnen nicht eingef³gt werden */
Text [ en-US ] = "Additional columns cannot be inserted." ;
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLDDECHG_ERROR )
@@ -180,22 +172,18 @@ Resource RID_SW_ERRHDL
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_OLE )
{
- /* ### ACHTUNG: Neuer Text in Resource? Einige OLE-Objekte konnten nur als Grafiken übernommen werden : Einige OLE-Objekte konnten nur als Grafiken ³bernommen werden */
Text [ en-US ] = "Some OLE objects could only be loaded as graphics." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_OLE )
{
- /* ### ACHTUNG: Neuer Text in Resource? Einige OLE-Objekte konnten nur als Grafiken übernommen werden : Einige OLE-Objekte konnten nur als Grafiken ³bernommen werden */
Text [ en-US ] = "Some OLE objects could only be saved as graphics." ;
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_POOR_LOAD )
{
- /* ### ACHTUNG: Neuer Text in Resource? Dokument konnte nicht vollständig geladen werden : Dokument konnte nicht vollstõndig geladen werden */
Text [ en-US ] = "Document could not be completely loaded." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_POOR_LOAD )
{
- /* ### ACHTUNG: Neuer Text in Resource? Dokument konnte nicht vollständig gespeichert werden : Dokument konnte nicht vollstõndig gespeichert werden */
Text [ en-US ] = "Document could not be completely saved." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_HTML_NO_MACROS)
diff --git a/sw/source/ui/app/mainwn.cxx b/sw/source/ui/app/mainwn.cxx
index d9750b737617..5ad53a445541 100644
--- a/sw/source/ui/app/mainwn.cxx
+++ b/sw/source/ui/app/mainwn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,13 +34,9 @@
#include <mdiexp.hxx>
#include <tools/shl.hxx>
#include <tools/string.hxx>
-#ifndef _SVARRAY_HXX
#include <svl/svstdarr.hxx>
-#endif
#include <sfx2/progress.hxx>
-#ifndef _RESID_HXX //autogen
#include <tools/resid.hxx>
-#endif
#include <docsh.hxx>
#include <swmodule.hxx>
#include "swtypes.hxx"
@@ -163,3 +160,4 @@ void RescheduleProgress( SwDocShell *pDocShell )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index b3ae93cdf6ca..4d58c56e3594 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -34,9 +34,7 @@
#include "popup.hrc"
/* --------------------- F O R M A T --------------------------------- */
-
#define SEPARATOR MenuItem { Separator = TRUE; }
-
//define for ITEM_FORMAT_NUMBERING
#define DEFINE_SLOTID_FOR_NUMBER_BULLETS FN_NUMBER_BULLETS
#define MN_NUMBERING ITEM_FORMAT_NUMBERING
@@ -300,7 +298,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_FORMAT_RESET ; \
HelpId = CMD_FN_FORMAT_RESET ; \
- Text [ en-US ] = "~Default Formatting" ; \
+ Text [ en-US ] = "Clear ~Direct Formatting" ; \
};
#define _NUMBERING_RELATED_MENU \
@@ -372,7 +370,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
};
/*------------------------------------------------------------------------
- Beschreibung: Menu Window
+ Description: Menu Window
------------------------------------------------------------------------*/
#define MN_FRM_CAPTION_ITEM \
@@ -412,9 +410,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = MN_CELL ; \
Command = ".uno:CellMenu" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Ze~lle : Zelle */\
Text [ en-US ] = "~Cell" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Einstellungen für die Tabellenzelle : Einstellungen f³r die Tabellenzelle */\
SubMenu = Menu\
{\
ItemList = \
@@ -455,7 +451,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_SET_READ_ONLY_CELLS ; \
HelpId = CMD_FN_TABLE_SET_READ_ONLY_CELLS ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Schützen : ~Sch³tzen */\
Text [ en-US ] = "~Protect" ; \
};\
MenuItem\
@@ -474,9 +469,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
Identifier = MN_SUB_TBLROW ; \
HelpID = HID_MN_SUB_TBLROW ; \
Command = ".uno:RowMenu" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Ze~ile : Zeile */\
Text [ en-US ] = "~Row" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Einstellungen für die Tabellenzeile : Einstellungen f³r die Tabellenzeile */\
SubMenu = Menu\
{\
ItemList = \
@@ -485,7 +478,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_SET_ROW_HEIGHT ; \
HelpId = CMD_FN_TABLE_SET_ROW_HEIGHT ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Höhe... : ~H÷he... */\
Text [ en-US ] = "~Height..." ; \
};\
MenuItem\
@@ -498,14 +490,12 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_OPTIMAL_HEIGHT ; \
HelpId = CMD_FN_TABLE_OPTIMAL_HEIGHT ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Optimale Höhe : ~Optimale H÷he */\
Text [ en-US ] = "~Optimal Height" ; \
};\
MenuItem\
{\
Identifier = FN_TABLE_BALANCE_ROWS ; \
HelpId = CMD_FN_TABLE_BALANCE_ROWS ; \
- /* ### ACHTUNG: Neuer Text in Resource? Gleichmäßig ~verteilen : Gleichmõ˜ig ~verteilen */\
Text [ en-US ] = "Space ~Equally" ; \
};\
SEPARATOR ; \
@@ -513,22 +503,18 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_SELECT_ROW ; \
HelpId = CMD_FN_TABLE_SELECT_ROW ; \
- /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Auswählen */\
- /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Ausw~õhlen */\
Text [ en-US ] = "~Select" ; \
};\
MenuItem\
{\
Identifier = FN_TABLE_INSERT_ROW_DLG ; \
HelpId = CMD_FN_TABLE_INSERT_ROW_DLG ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Einfügen... : ~Einf³gen... */\
Text [ en-US ] = "~Insert..." ; \
};\
MenuItem\
{\
Identifier = FN_TABLE_DELETE_ROW ; \
HelpId = CMD_FN_TABLE_DELETE_ROW ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */\
Text [ en-US ] = "~Delete" ; \
};\
};\
@@ -540,7 +526,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
HelpID = HID_MN_SUB_TBLCOL ; \
Command = ".uno:ColumnMenu" ; \
Text [ en-US ] = "Colu~mn" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Einstellungen für die Tabellenspalte : Einstellungen f³r die Tabellenspalte */\
SubMenu = Menu\
{\
ItemList = \
@@ -561,7 +546,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_BALANCE_CELLS ; \
HelpId = CMD_FN_TABLE_BALANCE_CELLS ; \
- /* ### ACHTUNG: Neuer Text in Resource? Gleichmäßig ~verteilen : Gleichmõ˜ig ~verteilen */\
Text [ en-US ] = "Space ~Equally" ; \
};\
SEPARATOR ; \
@@ -569,22 +553,18 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
{\
Identifier = FN_TABLE_SELECT_COL ; \
HelpId = CMD_FN_TABLE_SELECT_COL ; \
- /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Auswählen */\
- /* ### ACHTUNG: Neuer Text in Resource? Ausw~ählen : Ausw~õhlen */\
Text [ en-US ] = "~Select" ; \
};\
MenuItem\
{\
Identifier = FN_TABLE_INSERT_COL_DLG ; \
HelpId = CMD_FN_TABLE_INSERT_COL_DLG ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Einfügen... : ~Einf³gen... */\
Text [ en-US ] = "~Insert..." ; \
};\
MenuItem\
{\
Identifier = FN_TABLE_DELETE_COL ; \
HelpId = CMD_FN_TABLE_DELETE_COL ; \
- /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */\
Text [ en-US ] = "~Delete" ; \
};\
};\
@@ -617,7 +597,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml
Text [ en-US ] = "Name..." ; \
};
-// #i68101#
#define MN_TITLE_DESCRIPTION_SHAPE\
MenuItem\
{\
@@ -845,12 +824,10 @@ Menu MN_TAB_POPUPMENU
ITEM_FORMAT_PARA_DLG
};
ITEM_TRANSLITERATE_MENU
- // MN_BB
SEPARATOR ;
MN_TAB1
MN_TAB2
MN_FRM_CAPTION_ITEM
- // SEPARATOR;
MenuItem
{
Identifier = FN_VIEW_TABLEGRID ;
@@ -1088,11 +1065,9 @@ Menu MN_DRAW_POPUPMENU
ITEM_FORMAT_ATTR_TRANSFORM
};
- //-#i68101#----------------------
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
MN_NAME_SHAPE
- //-#i68101#----------------------
SEPARATOR ;
MN_DRAW5
@@ -1118,11 +1093,9 @@ Menu MN_DRAWFORM_POPUPMENU
ITEM_FORMAT_ATTR_TRANSFORM
};
- //-#i68101#----------------------
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
MN_NAME_SHAPE
- //-#i68101#----------------------
SEPARATOR ;
MN_FORM
@@ -1167,9 +1140,6 @@ Menu MN_ANNOTATION_POPUPMENU
{
ItemList =
{
- //MN_RESET
- //SEPARATOR ;
- //MN_TEXT_ATTR
MenuItem\
{\
ITEM_FORMAT_ATTR_CHAR_WEIGHT\
@@ -1187,13 +1157,8 @@ Menu MN_ANNOTATION_POPUPMENU
ITEM_FORMAT_ATTR_CHAR_STRIKEOUT\
};\
SEPARATOR ;
- //ITEM_TRANSLITERATE_MENU
- //SEPARATOR ;
- //MN_DRWTXT
- //MN_FRM_CAPTION_ITEM
SEPARATOR ;
MN_ANNOTATIONS
- //MN_REDCOMMENT
};
};
@@ -1298,10 +1263,8 @@ Menu MN_GRF_POPUPMENU
{
MN_ALIGN_FRAME
MN_MOUSE_FRAME_WITH_CONTOUR
- // --> OD 2009-07-14 #i73249#
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
- // <--
SEPARATOR ;
MenuItem
{
@@ -1316,6 +1279,14 @@ Menu MN_GRF_POPUPMENU
Text [ en-US ] = "Save Graphics..." ;
};
MN_FRM_CAPTION_ITEM
+ SEPARATOR;
+ MenuItem
+ {
+ Identifier = FN_EXTERNAL_EDIT ;
+ HelpID = CMD_FN_EXTERNAL_EDIT ;
+ Text [ en-US ] = "Edit with External Tool...";
+ };
+ SEPARATOR;
MenuItem
{
ITEM_EDIT_IMAP
@@ -1328,6 +1299,29 @@ String MN_OLE_POPUPMENU
Text [ en-US ] = "Object" ;
};
+#define MN_OLE_EXPORT \
+ MenuItem\
+ {\
+ Text [ en-US ] = "Export..." ; \
+ SubMenu = Menu\
+ {\
+ ItemList = \
+ {\
+ MenuItem\
+ {\
+ Identifier = FN_EXPORT_OLE_AS_PDF ;\
+ HelpID = CMD_FN_EXPORT_OLE_AS_PDF ; \
+ Text [ en-US ] = "Export as P~DF..." ; \
+ };\
+ MenuItem\
+ {\
+ Identifier = FN_EXPORT_OLE_AS_GRAPHIC ;\
+ HelpID = CMD_FN_EXPORT_OLE_AS_GRAPHIC ; \
+ Text [ en-US ] = "Export as JPG..." ; \
+ };\
+ };\
+ };\
+ };
Menu MN_OLE_POPUPMENU
{
@@ -1335,10 +1329,8 @@ Menu MN_OLE_POPUPMENU
{
MN_ALIGN_FRAME
MN_MOUSE_FRAME_WITH_CONTOUR
- // --> OD 2009-07-14 #i73249#
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
- // <--
SEPARATOR ;
MenuItem
{
@@ -1346,6 +1338,9 @@ Menu MN_OLE_POPUPMENU
HelpId = CMD_FN_FORMAT_FRAME_DLG ;
Text [ en-US ] = "Object..." ;
};
+ SEPARATOR ;
+ MN_OLE_EXPORT
+ SEPARATOR ;
MN_FRM_CAPTION_ITEM
};
};
@@ -1363,10 +1358,8 @@ Menu MN_FRM_POPUPMENU
{
MN_ALIGN_FRAME
MN_MOUSE_FRAME_WITHOUT_CONTOUR
- // --> OD 2009-07-07 #i73249#
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
- // <--
SEPARATOR ;
MN_FRM
MN_FRM_CAPTION_ITEM
@@ -1392,13 +1385,11 @@ Menu MN_PPREVIEW_POPUPMENU
{
Identifier = FN_PAGEDOWN ;
HelpId = CMD_FN_PAGEDOWN ;
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Seite : Nõchste Seite */
Text [ en-US ] = "Next Page" ;
};
MenuItem
{
ITEM_VIEW_ATTR_ZOOM
- /* ### ACHTUNG: Neuer Text in Resource? Schließt die Seitenvorschau : Schlie˜t die Seitenvorschau */
};
SEPARATOR ;
MenuItem
@@ -1431,11 +1422,9 @@ Menu MN_MEDIA_POPUPMENU
ITEM_FORMAT_ATTR_TRANSFORM
};
- //-#i68101#----------------------
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
MN_NAME_SHAPE
- //-#i68101#----------------------
SEPARATOR ;
MN_DRAW6
diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx
index 71409e4dedf3..ff22a1c8f2e8 100644
--- a/sw/source/ui/app/swdll.cxx
+++ b/sw/source/ui/app/swdll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,13 +33,9 @@
#include <svx/svdobj.hxx>
#include <rtl/logfile.hxx>
-#ifndef _GLOBDOC_HRC
#include "globdoc.hrc"
-#endif
-#ifndef _SWDLL_HXX
#include <swdll.hxx>
-#endif
#include <wdocsh.hxx>
#include <globdoc.hxx>
#include <initui.hxx>
@@ -49,23 +46,41 @@
#include <cfgid.h>
#include <unotools/moduleoptions.hxx>
+#include <comphelper/scoped_disposing_ptr.hxx>
+#include <comphelper/processfactory.hxx>
-#ifndef _FM_FMOBJFAC_HXX
#include <svx/fmobjfac.hxx>
-#endif
#include <svx/svdfield.hxx>
#include <svx/objfac3d.hxx>
#include <unomid.h>
+#include "swdllimpl.hxx"
-/*************************************************************************
-|*
-|* Init
-|*
-\************************************************************************/
+namespace
+{
+ //Holds a SwDLL and release it on exit, or dispose of the
+ //default XComponent, whichever comes first
+ class SwDLLInstance : public comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>
+ {
+ public:
+ SwDLLInstance() : comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>(::com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), ::com::sun::star::uno::UNO_QUERY_THROW), new SwDLL)
+ {
+ }
+ };
+
+ struct theSwDLLInstance : public rtl::Static<SwDLLInstance, theSwDLLInstance> {};
+}
-void SwDLL::Init()
+namespace SwGlobals
+{
+ void ensure()
+ {
+ theSwDLLInstance::get();
+ }
+}
+
+SwDLL::SwDLL()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDLL" );
@@ -86,7 +101,7 @@ void SwDLL::Init()
SfxObjectFactory* pWDocFact = &SwWebDocShell::Factory();
SwModule* pModule = new SwModule( pWDocFact, pDocFact, pGlobDocFact );
- (*ppShlPtr) = pModule;
+ *ppShlPtr = pModule;
pWDocFact->SetDocumentServiceName(C2S("com.sun.star.text.WebDocument"));
@@ -96,26 +111,26 @@ void SwDLL::Init()
pDocFact->SetDocumentServiceName(C2S("com.sun.star.text.TextDocument"));
}
- // SvDraw-Felder registrieren
+ // register SvDraw-Fields
SdrRegisterFieldClasses();
- // 3D-Objekt-Factory eintragen
+ // register 3D-Objekt-Factory
E3dObjFactory();
- // form::component::Form-Objekt-Factory eintragen
+ // register form::component::Form-Objekt-Factory
FmFormObjFactory();
SdrObjFactory::InsertMakeObjectHdl( LINK( &aSwObjectFactory, SwObjectFactory, MakeObject ) );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "Init Core/UI/Filter" );
- //Initialisierung der Statics
+ // Initialisation of Statics
::_InitCore();
::_InitFilter();
::_InitUI();
pModule->InitAttrPool();
- //jetzt darf das SwModule seinen Pool anlegen
+ // now SWModule can create its Pool
// register your view-factories here
RegisterFactories();
@@ -127,30 +142,22 @@ void SwDLL::Init()
RegisterControls();
}
-
-
-/*************************************************************************
-|*
-|* Exit
-|*
-\************************************************************************/
-
-void SwDLL::Exit()
+SwDLL::~SwDLL()
{
- // called directly befor unloading the DLL
- // do whatever you want, Sw-DLL is accessible
-
- // der Pool muss vor den statics geloescht werden
+ // Pool has to be deleted before statics are
SW_MOD()->RemoveAttrPool();
::_FinitUI();
::_FinitFilter();
::_FinitCore();
- // Objekt-Factory austragen
+ // sign out Objekt-Factory
SdrObjFactory::RemoveMakeObjectHdl(LINK(&aSwObjectFactory, SwObjectFactory, MakeObject ));
- // the SwModule must be destroyed
+#if 0
+ // the SwModule must be destroyed
SwModule** ppShlPtr = (SwModule**) GetAppData(SHL_WRITER);
delete (*ppShlPtr);
(*ppShlPtr) = NULL;
+#endif
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/swdllimpl.hxx b/sw/source/ui/app/swdllimpl.hxx
new file mode 100644
index 000000000000..74724366b430
--- /dev/null
+++ b/sw/source/ui/app/swdllimpl.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SWDLL_IMPL_INCLUDE
+#define SWDLL_IMPL_INCLUDE
+
+class SwDLL
+{
+public:
+ static void RegisterFactories();
+ static void RegisterInterfaces();
+ static void RegisterControls();
+
+ SwDLL();
+ ~SwDLL();
+};
+
+#endif
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 9791a7e8e2aa..fcfc75c0e3b6 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <boost/scoped_ptr.hpp>
#include <hintids.hxx>
#include <sfx2/request.hxx>
@@ -47,6 +49,7 @@
#include <editeng/colritem.hxx>
#include <editeng/brshitem.hxx>
#include <vcl/msgbox.hxx>
+#include <svl/cjkoptions.hxx>
#include <swmodule.hxx>
#include <swtypes.hxx>
#include <usrpref.hxx>
@@ -58,7 +61,7 @@
#include <docsh.hxx>
#include <dbmgr.hxx>
#include <uinums.hxx>
-#include <prtopt.hxx> // fuer PrintOptions
+#include <prtopt.hxx> // for PrintOptions
#include <navicfg.hxx>
#include <doc.hxx>
#include <cmdid.h>
@@ -79,20 +82,17 @@ using namespace ::com::sun::star::view;
using namespace ::com::sun::star::lang;
-/*-----------------08/28/97 08:41pm-----------------
-
---------------------------------------------------*/
-void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
+void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell* pSh )
{
- // in FrameSets kann die tatsaechliche Sichtbarkeit von der Einstellung der ViewOptions abweichen
- sal_Bool bVScrollChanged = pPref->IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
- sal_Bool bHScrollChanged = pPref->IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
- sal_Bool bVAlignChanged = pPref->IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
+ // in FrameSets the actual visibility can differ from the ViewOption's setting
+ sal_Bool bVScrollChanged = rPref.IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
+ sal_Bool bHScrollChanged = rPref.IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
+ sal_Bool bVAlignChanged = rPref.IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
- pSh->SetUIOptions(*pPref);
+ pSh->SetUIOptions(rPref);
const SwViewOption* pNewPref = pSh->GetViewOptions();
- // Scrollbars an / aus
+ // Scrollbars on / off
if(bVScrollChanged)
{
pView->ShowVScrollbar(pNewPref->IsViewVScrollBar());
@@ -105,13 +105,13 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
pView->InvalidateBorder();
- // Lineale an / aus
+ // Rulers on / off
if(pNewPref->IsViewVRuler())
pView->CreateVLineal();
else
pView->KillVLineal();
- // TabWindow an/aus
+ // TabWindow on / off
if(pNewPref->IsViewHRuler())
pView->CreateTab();
else
@@ -120,11 +120,6 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
pView->GetPostItMgr()->PrepareView(true);
}
-/*--------------------------------------------------------------------
- Beschreibung: Aktuelle SwWrtShell
- --------------------------------------------------------------------*/
-
-
SwWrtShell* GetActiveWrtShell()
{
SwView *pActive = ::GetActiveView();
@@ -133,41 +128,31 @@ SwWrtShell* GetActiveWrtShell()
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung: Pointer auf die aktuelle Sicht
- --------------------------------------------------------------------*/
-
-
SwView* GetActiveView()
{
SfxViewShell* pView = SfxViewShell::Current();
return PTR_CAST( SwView, pView );
}
-/*--------------------------------------------------------------------
- Beschreibung: Ueber Views iterieren - static
- --------------------------------------------------------------------*/
SwView* SwModule::GetFirstView()
{
- // liefert nur sichtbare SwViews
+ // returns only sivible SwView
const TypeId aTypeId = TYPE(SwView);
SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
return pView;
}
-
SwView* SwModule::GetNextView(SwView* pView)
{
- DBG_ASSERT(PTR_CAST(SwView, pView),"keine SwView uebergeben");
+ OSL_ENSURE(PTR_CAST(SwView, pView),"return no SwView");
const TypeId aTypeId = TYPE(SwView);
SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId, sal_True);
return pNView;
}
/*------------------------------------------------------------------------
- Beschreibung: Neuer Master fuer die Einstellungen wird gesetzt;
- dieser wirkt sich auf die aktuelle Sicht und alle
- folgenden aus.
+ Description: New Master for the settings is set; this affects the
+ current view and all following.
------------------------------------------------------------------------*/
void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
@@ -181,9 +166,9 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
VIEWOPT_DEST_TEXT== nDest ? sal_False :
pCurrView && pCurrView->ISA(SwWebView) ));
- //per Uno soll nur die sdbcx::View, aber nicht das Module veraendert werden
+ // with Uno, only sdbcx::View, but not the Module should be changed
sal_Bool bViewOnly = VIEWOPT_DEST_VIEW_ONLY == nDest;
- //PreView abfruehstuecken
+ // fob PreView off
SwPagePreView* pPPView;
if( !pCurrView && 0 != (pPPView = PTR_CAST( SwPagePreView, SfxViewShell::Current())) )
{
@@ -208,39 +193,36 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
if( !pCurrView )
return;
- // Weitergabe an die CORE
+ // Passing on to CORE
sal_Bool bReadonly;
const SwDocShell* pDocSh = pCurrView->GetDocShell();
if (pDocSh)
bReadonly = pDocSh->IsReadOnly();
else //Use existing option if DocShell missing
bReadonly = pSh->GetViewOptions()->IsReadonly();
- SwViewOption* pViewOpt;
- if(!bViewOnly)
- pViewOpt = new SwViewOption( *pPref );
+ boost::scoped_ptr<SwViewOption> xViewOpt;
+ if (!bViewOnly)
+ xViewOpt.reset(new SwViewOption(*pPref));
else
- pViewOpt = new SwViewOption( rUsrPref );
- pViewOpt->SetReadonly( bReadonly );
- if( !(*pSh->GetViewOptions() == *pViewOpt) )
+ xViewOpt.reset(new SwViewOption(rUsrPref));
+ xViewOpt->SetReadonly( bReadonly );
+ if( !(*pSh->GetViewOptions() == *xViewOpt) )
{
- //Ist evtl. nur eine ViewShell
+ //is maybe only a ViewShell
pSh->StartAction();
- pSh->ApplyViewOptions( *pViewOpt );
- ((SwWrtShell*)pSh)->SetReadOnlyAvailable(pViewOpt->IsCursorInProtectedArea());
+ pSh->ApplyViewOptions( *xViewOpt );
+ ((SwWrtShell*)pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
pSh->EndAction();
}
if ( pSh->GetViewOptions()->IsReadonly() != bReadonly )
pSh->SetReadonlyOption(bReadonly);
- lcl_SetUIPrefs(pViewOpt, pCurrView, pSh);
+ lcl_SetUIPrefs(*xViewOpt, pCurrView, pSh);
- // zum Schluss wird das Idle-Flag wieder gesetzt
- // #42510#
+ // in the end the Idle-Flag is set again
pPref->SetIdle(sal_True);
}
-/* -----------------------------28.09.00 12:36--------------------------------
- ---------------------------------------------------------------------------*/
void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb )
{
SwMasterUsrPref* pPref;
@@ -264,7 +246,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb )
FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : eMetric;
SwView* pTmpView = SwModule::GetFirstView();
- // fuer alle MDI-Fenster das Lineal umschalten
+ // switch the ruler for all MDI-Windows
while(pTmpView)
{
if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView)))
@@ -276,9 +258,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb )
pTmpView = SwModule::GetNextView(pTmpView);
}
}
-/*-- 12.11.2008 14:47:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwModule::ApplyRulerMetric( FieldUnit eMetric, sal_Bool bHorizontal, sal_Bool bWeb )
{
SwMasterUsrPref* pPref;
@@ -313,9 +293,69 @@ void SwModule::ApplyRulerMetric( FieldUnit eMetric, sal_Bool bHorizontal, sal_Bo
pTmpView = SwModule::GetNextView(pTmpView);
}
}
-/*-----------------13.11.96 11.57-------------------
+/*-------------------------------------------------
+set the usrpref 's char unit attribute and set ruler
+'s unit as char if the "apply char unit" is checked
--------------------------------------------------*/
+void SwModule::ApplyUserCharUnit(sal_Bool bApplyChar, sal_Bool bWeb)
+{
+ SwMasterUsrPref* pPref;
+ if(bWeb)
+ {
+ if(!pWebUsrPref)
+ GetUsrPref(sal_True);
+ pPref = pWebUsrPref;
+ }
+ else
+ {
+ if(!pUsrPref)
+ GetUsrPref(sal_False);
+ pPref = pUsrPref;
+ }
+ sal_Bool bOldApplyCharUnit = pPref->IsApplyCharUnit();
+ sal_Bool bHasChanged = sal_False;
+ if(bOldApplyCharUnit != bApplyChar)
+ {
+ pPref->SetApplyCharUnit(bApplyChar);
+ bHasChanged = sal_True;
+ }
+
+ if( !bHasChanged )
+ return;
+
+ FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric();
+ FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric();
+ if(bApplyChar)
+ {
+ eHScrollMetric = FUNIT_CHAR;
+ eVScrollMetric = FUNIT_LINE;
+ }
+ else
+ {
+ SvtCJKOptions aCJKOptions;
+ if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eHScrollMetric == FUNIT_CHAR ))
+ eHScrollMetric = FUNIT_INCH;
+ else if ( eHScrollMetric == FUNIT_CHAR )
+ eHScrollMetric = FUNIT_CM;
+ if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eVScrollMetric == FUNIT_LINE ))
+ eVScrollMetric = FUNIT_INCH;
+ else if ( eVScrollMetric == FUNIT_LINE )
+ eVScrollMetric = FUNIT_CM;
+ }
+ SwView* pTmpView = SwModule::GetFirstView();
+ // switch rulers for all MDI-Windows
+ while(pTmpView)
+ {
+ if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView)))
+ {
+ pTmpView->ChangeVLinealMetric(eVScrollMetric);
+ pTmpView->ChangeTabMetric(eHScrollMetric);
+ }
+
+ pTmpView = SwModule::GetNextView(pTmpView);
+ }
+}
SwNavigationConfig* SwModule::GetNavigationConfig()
{
@@ -326,10 +366,6 @@ SwNavigationConfig* SwModule::GetNavigationConfig()
return pNavigationConfig;
}
-/*-----------------05.02.97 08.03-------------------
-
---------------------------------------------------*/
-
SwPrintOptions* SwModule::GetPrtOptions(sal_Bool bWeb)
{
if(bWeb && !pWebPrtOpt)
@@ -344,9 +380,6 @@ SwPrintOptions* SwModule::GetPrtOptions(sal_Bool bWeb)
return bWeb ? pWebPrtOpt : pPrtOpt;
}
-/*-----------------26.06.97 07.52-------------------
-
---------------------------------------------------*/
SwChapterNumRules* SwModule::GetChapterNumRules()
{
if(!pChapterNumRules)
@@ -354,17 +387,13 @@ SwChapterNumRules* SwModule::GetChapterNumRules()
return pChapterNumRules;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, sal_Bool /*bOnlyIfAvailable*/)
{
Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface();
Reference<XDispatchProvider> xDP(xFrame, uno::UNO_QUERY);
uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame(
- rtl::OUString::createFromAscii("_beamer"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")),
FrameSearchFlag::CHILDREN);
if (xBeamerFrame.is())
{ // the beamer has been opened by the SfxViewFrame
@@ -380,13 +409,10 @@ void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, sal_Bool /*bOnlyI
xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence()));
}
else {
- DBG_ERROR("no selection supplier in the beamer!");
+ OSL_FAIL("no selection supplier in the beamer!");
}
}
}
-/*--------------------------------------------------------------------
- Beschreibung: Redlining
- --------------------------------------------------------------------*/
sal_uInt16 SwModule::GetRedlineAuthor()
{
@@ -401,13 +427,9 @@ sal_uInt16 SwModule::GetRedlineAuthor()
return InsertRedlineAuthor( sActAuthor );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos)
{
- DBG_ASSERT(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
+ OSL_ENSURE(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
while (!(nPos<pAuthorNames->Count()))
{
InsertRedlineAuthor(String(RTL_CONSTASCII_USTRINGPARAM("nn")));
@@ -415,10 +437,6 @@ const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos)
return *pAuthorNames->GetObject(nPos);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor)
{
sal_uInt16 nPos = 0;
@@ -432,10 +450,6 @@ sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor)
return nPos;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet,
const AuthorCharAttr &rAttr )
{
@@ -448,8 +462,7 @@ void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet,
COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK,
COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK };
- aCol.SetColor( aColArr[ nAuthor % (sizeof( aColArr ) /
- sizeof( aColArr[0] )) ] );
+ aCol.SetColor( aColArr[ nAuthor % (SAL_N_ELEMENTS(aColArr)) ] );
}
sal_Bool bBackGr = COL_NONE == rAttr.nColor;
@@ -503,26 +516,18 @@ void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet,
rSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModule::GetInsertAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet)
{
lcl_FillAuthorAttr(nAuthor, rSet, pModuleConfig->GetInsertAuthorAttr());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModule::GetDeletedAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet)
{
lcl_FillAuthorAttr(nAuthor, rSet, pModuleConfig->GetDeletedAuthorAttr());
}
/*--------------------------------------------------------------------
- Beschreibung: Fuer zukuenftige Erweiterung:
+ Description: For future extension:
--------------------------------------------------------------------*/
void SwModule::GetFormatAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet )
@@ -530,19 +535,11 @@ void SwModule::GetFormatAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet )
lcl_FillAuthorAttr( nAuthor, rSet, pModuleConfig->GetFormatAuthorAttr() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwModule::GetRedlineMarkPos()
{
return pModuleConfig->GetMarkAlignMode();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwModule::IsInsTblFormatNum(sal_Bool bHTML) const
{
return pModuleConfig->IsInsTblFormatNum(bHTML);
@@ -553,41 +550,27 @@ sal_Bool SwModule::IsInsTblChangeNumFormat(sal_Bool bHTML) const
return pModuleConfig->IsInsTblChangeNumFormat(bHTML);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwModule::IsInsTblAlignNum(sal_Bool bHTML) const
{
return pModuleConfig->IsInsTblAlignNum(bHTML);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
const Color &SwModule::GetRedlineMarkColor()
{
return pModuleConfig->GetMarkAlignColor();
}
-/*-----------------03.03.98 16:47-------------------
-
---------------------------------------------------*/
const SwViewOption* SwModule::GetViewOption(sal_Bool bWeb)
{
return GetUsrPref( bWeb );
}
-// returne den definierten DocStat - WordDelimiter
const String& SwModule::GetDocStatWordDelim() const
{
return pModuleConfig->GetWordDelimiter();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
-// Durchreichen der Metric von der ModuleConfig (fuer HTML-Export)
+// Passing-through of the ModuleConfig's Metric (for HTML-Export)
sal_uInt16 SwModule::GetMetric( sal_Bool bWeb ) const
{
SwMasterUsrPref* pPref;
@@ -605,46 +588,36 @@ sal_uInt16 SwModule::GetMetric( sal_Bool bWeb ) const
}
return static_cast< sal_uInt16 >(pPref->GetMetric());
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
-// Update-Stati durchreichen
+// Pass-through Update-Stati
sal_uInt16 SwModule::GetLinkUpdMode( sal_Bool ) const
{
if(!pUsrPref)
GetUsrPref(sal_False);
return (sal_uInt16)pUsrPref->GetUpdateLinkMode();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwFldUpdateFlags SwModule::GetFldUpdateFlags( sal_Bool ) const
{
if(!pUsrPref)
GetUsrPref(sal_False);
return pUsrPref->GetFldUpdateFlags();
}
-/* -----------------------------28.09.00 14:18--------------------------------
- ---------------------------------------------------------------------------*/
void SwModule::ApplyFldUpdateFlags(SwFldUpdateFlags eFldFlags)
{
if(!pUsrPref)
GetUsrPref(sal_False);
pUsrPref->SetFldUpdateFlags(eFldFlags);
}
-/* -----------------------------28.09.00 14:18--------------------------------
- ---------------------------------------------------------------------------*/
void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode)
{
if(!pUsrPref)
GetUsrPref(sal_False);
pUsrPref->SetUpdateLinkMode(nNewLinkMode);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling,
sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain, sal_Bool bSmartTags )
{
@@ -667,8 +640,6 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling,
pViewShell->GetWin()->Invalidate();
}
}
-// pSpell->SetSpellWrongAgain( sal_False );
-// pSpell->SetSpellAllAgain( sal_False );
}
}
@@ -678,3 +649,5 @@ void SwModule::ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode)
GetUsrPref(sal_False);
pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 644faae08d26..0e50081d9faf 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <hintids.hxx>
-#ifndef _SWERROR_H
#include <swerror.h>
-#endif
#include <vcl/wrkwin.hxx>
#include <vcl/graph.hxx>
#include <svx/galbrws.hxx>
@@ -45,7 +44,7 @@
#include <svx/insctrl.hxx>
#include <svx/selctrl.hxx>
#include <svx/linectrl.hxx>
-#include <svx/tbxctl.hxx> //z-Zt falscher includeschutz!
+#include <svx/tbxctl.hxx> // at the moment wrong include-protection!
#include <svx/fillctrl.hxx>
#include <svx/tbcontrl.hxx>
#include <svx/verttexttbxctrl.hxx>
@@ -59,34 +58,28 @@
#include <svx/tbxcolor.hxx>
#include <svx/clipboardctl.hxx>
#include <svx/lboxctrl.hxx>
-#include <svx/hyprlink.hxx>
#include <svx/tbxcustomshapes.hxx>
#include <svx/imapdlg.hxx>
#include <svx/srchdlg.hxx>
#include <svx/hyperdlg.hxx>
#include <svx/extrusioncolorcontrol.hxx>
#include <svx/fontworkgallery.hxx>
+#include <svx/modctrl.hxx>
#include <com/sun/star/scanner/XScannerManager.hpp>
#include <com/sun/star/container/XSet.hpp>
#include <comphelper/processfactory.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swmodule.hxx>
#include <swevent.hxx>
#include <swacorr.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <dobjfac.hxx>
#include <init.hxx>
#include <pview.hxx>
#include <wview.hxx>
#include <wdocsh.hxx>
#include <globdoc.hxx>
-#ifndef _SRCVIEW_HXX //autogen
#include <srcview.hxx>
-#endif
#include <glshell.hxx>
#include <tabsh.hxx>
#include <listsh.hxx>
@@ -99,21 +92,11 @@
#include <beziersh.hxx>
#include <wtextsh.hxx>
#include <wfrmsh.hxx>
-#ifndef _DRFORMSH_HXX
#include <drformsh.hxx>
-#endif
-#ifndef _WGRFSH_HXX
#include <wgrfsh.hxx>
-#endif
-#ifndef _WOLESH_HXX
#include <wolesh.hxx>
-#endif
-#ifndef _WLISTSH_HXX
#include <wlistsh.hxx>
-#endif
-#ifndef _WTABSH_HXX
#include <wtabsh.hxx>
-#endif
#include <navipi.hxx>
#include <chartins.hxx>
#include <inputwin.hxx>
@@ -129,12 +112,8 @@
#include <workctrl.hxx>
#include <tbxanchr.hxx>
#include <fldwrap.hxx>
-#ifndef _REDLNDLG_HXX
#include <redlndlg.hxx>
-#endif
-#ifndef _SYNCBTN_HXX
#include <syncbtn.hxx>
-#endif
#include <mailmergechildwindow.hxx>
#include <modcfg.hxx>
#include <fontcfg.hxx>
@@ -144,27 +123,23 @@
#include <swatrset.hxx>
#include <idxmrk.hxx>
#include <dlelstnr.hxx>
-#ifndef _BARCFG_HXX
#include <barcfg.hxx>
-#endif
#include <svx/rubydialog.hxx>
-// OD 14.02.2003 #107424#
#include <svtools/colorcfg.hxx>
#include <editeng/acorrcfg.hxx>
#include <unotools/moduleoptions.hxx>
-#ifndef _AVMEDIA_MEDIAPPLAYER_HXX
#include <avmedia/mediaplayer.hxx>
-#endif
#include <avmedia/mediatoolbox.hxx>
#include <annotsh.hxx>
+#include <navsh.hxx>
#include <app.hrc>
#include <svx/xmlsecctrl.hxx>
ResMgr *pSwResMgr = 0;
-sal_Bool bNoInterrupt = sal_False;
+sal_Bool bNoInterrupt = sal_False;
#include <sfx2/app.hxx>
@@ -172,6 +147,8 @@ sal_Bool bNoInterrupt = sal_False;
#include <unomid.h>
+#include "swdllimpl.hxx"
+
using namespace com::sun::star;
@@ -180,8 +157,6 @@ TYPEINIT1( SwModule, SfxModule );
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-//************************************************************************
-
SwModule::SwModule( SfxObjectFactory* pWebFact,
SfxObjectFactory* pFact,
SfxObjectFactory* pGlobalFact )
@@ -212,7 +187,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
{
SetName( String::CreateFromAscii("StarWriter") );
pSwResMgr = GetResMgr();
- SvxErrorHandler::Get();
+ SvxErrorHandler::ensure();
pErrorHdl = new SfxErrorHandler( RID_SW_ERRHDL,
ERRCODE_AREA_SW,
ERRCODE_AREA_SW_END,
@@ -220,21 +195,18 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pModuleConfig = new SwModuleOptions;
- //Die brauchen wie sowieso
+ // We need them anyways
pToolbarConfig = new SwToolbarConfigItem( sal_False );
pWebToolbarConfig = new SwToolbarConfigItem( sal_True );
pStdFontConfig = new SwStdFontConfig;
- pAuthorNames = new SvStringsDtor(5, 1); // Alle Redlining-Autoren
+ pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors
- //JP 18.10.96: SvxAutocorrect gegen die SwAutocorrect austauschen
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- if( pACfg )
- {
- const SvxAutoCorrect* pOld = pACfg->GetAutoCorrect();
- pACfg->SetAutoCorrect(new SwAutoCorrect( *pOld ));
- }
+ // replace SvxAutocorrect with SwAutocorrect
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect();
+ rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld ));
StartListening( *SFX_APP() );
@@ -243,9 +215,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
// at the view options.
GetColorConfig();
}
-
-//************************************************************************
-
uno::Reference< scanner::XScannerManager >
SwModule::GetScannerManager()
{
@@ -258,8 +227,8 @@ SwModule::GetScannerManager()
m_xScannerManager =
uno::Reference< scanner::XScannerManager >(
xMgr->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.scanner.ScannerManager" ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.scanner.ScannerManager")) ),
uno::UNO_QUERY );
}
}
@@ -275,41 +244,33 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser()
{
m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
xMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LanguageGuessing"))),
uno::UNO_QUERY );
}
}
return m_xLanguageGuesser;
}
-//************************************************************************
-
SwModule::~SwModule()
{
- SetPool(0);
- SfxItemPool::Free(pAttrPool);
delete pErrorHdl;
EndListening( *SFX_APP() );
}
-//************************************************************************
-
void SwModule::CreateLngSvcEvtListener()
{
if (!xLngSvcEvtListener.is())
xLngSvcEvtListener = new SwLinguServiceEventListener;
}
-//************************************************************************
-
void SwDLL::RegisterFactories()
{
- //Diese Id's duerfen nicht geaendert werden. Mittels der Id's wird vom
- //Sfx die View (Dokumentansicht wiederherstellen) erzeugt.
+ // These Id's must not be changed. Through these Id's the View (resume Documentview)
+ // is created by Sfx.
if ( SvtModuleOptions().IsWriter() )
SwView::RegisterFactory ( 2 );
- SwWebView::RegisterFactory ( 5 );
+ SwWebView::RegisterFactory ( 5 );
if ( SvtModuleOptions().IsWriter() )
{
@@ -318,9 +279,6 @@ void SwDLL::RegisterFactories()
}
}
-//************************************************************************
-
-
void SwDLL::RegisterInterfaces()
{
SwModule* pMod = SW_MOD();
@@ -347,6 +305,7 @@ void SwDLL::RegisterInterfaces()
SwBezierShell::RegisterInterface(pMod);
SwGrfShell::RegisterInterface(pMod);
SwOleShell::RegisterInterface(pMod);
+ SwNavigationShell::RegisterInterface(pMod);
SwWebTextShell::RegisterInterface(pMod);
SwWebFrameShell::RegisterInterface(pMod);
SwWebGrfShell::RegisterInterface(pMod);
@@ -358,8 +317,6 @@ void SwDLL::RegisterInterfaces()
SwAnnotationShell::RegisterInterface(pMod);
}
-//************************************************************************
-
void SwDLL::RegisterControls()
{
SwModule* pMod = SW_MOD();
@@ -393,7 +350,6 @@ void SwDLL::RegisterControls()
SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod );
SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod );
-// SvxFontHeightToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod );
SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR, pMod );
SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2, pMod );
SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND, pMod );
@@ -422,6 +378,7 @@ void SwDLL::RegisterControls()
SwBookmarkControl::RegisterControl(FN_STAT_PAGE, pMod );
SwTemplateControl::RegisterControl(FN_STAT_TEMPLATE, pMod );
SwViewLayoutControl::RegisterControl( SID_ATTR_VIEWLAYOUT, pMod );
+ SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
SwTableOptimizeCtrl::RegisterControl(FN_OPTIMIZE_TABLE, pMod);
@@ -429,7 +386,6 @@ void SwDLL::RegisterControls()
SvxIMapDlgChildWindow::RegisterChildWindow( sal_False, pMod );
SvxSearchDialogWrapper::RegisterChildWindow( sal_False, pMod );
SvxHlinkDlgWrapper::RegisterChildWindow( sal_False, pMod );
- SvxHyperlinkDlgWrapper::RegisterChildWindow( sal_False, pMod, SFX_CHILDWIN_FORCEDOCK );
SvxFontWorkChildWindow::RegisterChildWindow( sal_False, pMod );
SwFldDlgWrapper::RegisterChildWindow( sal_False, pMod );
SwFldDataOnlyDlgWrapper::RegisterChildWindow( sal_False, pMod );
@@ -439,7 +395,6 @@ void SwDLL::RegisterControls()
SwRedlineAcceptChild::RegisterChildWindow( sal_False, pMod );
SwSyncChildWin::RegisterChildWindow( sal_True, pMod );
SwMailMergeChildWindow::RegisterChildWindow( sal_False, pMod );
-// SwSendMailChildWindow::RegisterChildWindow( sal_False, pMod );
SwInsertIdxMarkWrapper::RegisterChildWindow( sal_False, pMod );
SwInsertAuthMarkWrapper::RegisterChildWindow( sal_False, pMod );
SvxRubyChildWindow::RegisterChildWindow( sal_False, pMod);
@@ -475,22 +430,17 @@ void SwDLL::RegisterControls()
/*************************************************************************
|*
-|* Modul laden (nur Attrappe fuer das Linken der DLL)
+|* Load Module (only dummy for linking of the DLL)
|*
\************************************************************************/
-/* -----------------20.04.99 10:46-------------------
- *
- * --------------------------------------------------*/
void SwModule::InitAttrPool()
{
- DBG_ASSERT(!pAttrPool, "Pool ist schon da!");
+ OSL_ENSURE(!pAttrPool, "Pool already exists!");
pAttrPool = new SwAttrPool(0);
SetPool(pAttrPool);
}
-/* -----------------20.04.99 10:46-------------------
- *
- * --------------------------------------------------*/
+
void SwModule::RemoveAttrPool()
{
SetPool(0);
@@ -498,3 +448,4 @@ void SwModule::RemoveAttrPool()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/swwait.cxx b/sw/source/ui/app/swwait.cxx
index 95dd59900a13..e85e81732269 100644
--- a/sw/source/ui/app/swwait.cxx
+++ b/sw/source/ui/app/swwait.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,4 @@ SwWait::~SwWait()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx
index 13d40f258552..105691be41ce 100644
--- a/sw/source/ui/cctrl/actctrl.cxx
+++ b/sw/source/ui/cctrl/actctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
-#include <tools/list.hxx>
#include "actctrl.hxx"
-
-
void NumEditAction::Action()
{
aActionLink.Call( this );
@@ -64,10 +59,6 @@ long NumEditAction::Notify( NotifyEvent& rNEvt )
return nHandled;
}
-/*------------------------------------------------------------------------
- Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces
-------------------------------------------------------------------------*/
-
NoSpaceEdit::NoSpaceEdit( Window* pParent, const ResId& rResId)
: Edit(pParent, rResId),
sForbiddenChars(String::CreateFromAscii(" "))
@@ -90,9 +81,7 @@ void NoSpaceEdit::KeyInput(const KeyEvent& rEvt)
if(bCallParent)
Edit::KeyInput(rEvt);
}
-/* -----------------------------11.02.00 15:28--------------------------------
- ---------------------------------------------------------------------------*/
void NoSpaceEdit::Modify()
{
Selection aSel = GetSelection();
@@ -112,15 +101,11 @@ void NoSpaceEdit::Modify()
if(GetModifyHdl().IsSet())
GetModifyHdl().Call(this);
}
-/* -----------------25.06.2003 15:57-----------------
- --------------------------------------------------*/
ReturnActionEdit::~ReturnActionEdit()
{
}
-/* -----------------25.06.2003 15:58-----------------
- --------------------------------------------------*/
void ReturnActionEdit::KeyInput( const KeyEvent& rEvt)
{
const KeyCode aKeyCode = rEvt.GetKeyCode();
@@ -135,4 +120,4 @@ void ReturnActionEdit::KeyInput( const KeyEvent& rEvt)
Edit::KeyInput(rEvt);
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/cctrl/popbox.cxx b/sw/source/ui/cctrl/popbox.cxx
index 9d09a613283f..6e457738fcf2 100644
--- a/sw/source/ui/cctrl/popbox.cxx
+++ b/sw/source/ui/cctrl/popbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,29 +31,20 @@
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <swtypes.hxx>
#include <popbox.hxx>
#include <navipi.hxx>
-
-// --- class SwHelpToolBox ---------------------------------------------
-
-
SwHelpToolBox::SwHelpToolBox( SwNavigationPI* pParent, const ResId& rResId )
: ToolBox( pParent, rResId ),
DropTargetHelper( this )
{
}
-
void SwHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
{
- // Zuerst DoubleClick-Link auswerten
- // Dessen Returnwert entscheidet ueber andere Verarbeitung
- // Doppelclickhandler nur, wenn nicht auf einen Button geclickt wurde
+ // If doubleclick is detected use doubleclick handler
if(rEvt.GetButtons() == MOUSE_RIGHT &&
0 == GetItemId(rEvt.GetPosPixel()))
{
@@ -62,20 +54,14 @@ void SwHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
ToolBox::MouseButtonDown(rEvt);
}
-
long SwHelpToolBox::DoubleClick( ToolBox* pCaller )
{
- // kein Doppelklick auf einen Button
+ // No doubleclick on button
if( 0 == pCaller->GetCurItemId() && aDoubleClickLink.Call(0) )
return sal_True;
return sal_False;
}
-/*-----------------26.02.94 00:36-------------------
- dtor ueberladen
---------------------------------------------------*/
-
-
SwHelpToolBox::~SwHelpToolBox() {}
sal_Int8 SwHelpToolBox::AcceptDrop( const AcceptDropEvent& rEvt )
@@ -89,3 +75,4 @@ sal_Int8 SwHelpToolBox::ExecuteDrop( const ExecuteDropEvent& rEvt )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx
index ebb91b5f7ff7..e11ff0b7630e 100644
--- a/sw/source/ui/cctrl/swlbox.cxx
+++ b/sw/source/ui/cctrl/swlbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <unotools/charclass.hxx>
#include <swtypes.hxx>
#include <swlbox.hxx>
@@ -39,11 +40,7 @@ using namespace nsSwComboBoxStyle;
SV_IMPL_PTRARR(SwEntryLst, SwBoxEntry*)
-/*--------------------------------------------------------------------
- Beschreibung: Ein ListboxElement
- --------------------------------------------------------------------*/
-
-
+// Description: ListboxElement
SwBoxEntry::SwBoxEntry() :
bModified(sal_False),
bNew(sal_False),
@@ -51,7 +48,6 @@ SwBoxEntry::SwBoxEntry() :
{
}
-
SwBoxEntry::SwBoxEntry(const String& aNam, sal_uInt16 nIdx) :
bModified(sal_False),
bNew(sal_False),
@@ -60,23 +56,19 @@ SwBoxEntry::SwBoxEntry(const String& aNam, sal_uInt16 nIdx) :
{
}
-
SwBoxEntry::SwBoxEntry(const SwBoxEntry& rOld) :
bModified(rOld.bModified),
bNew(rOld.bNew),
aName(rOld.aName),
nId(rOld.nId)
{
-
}
-
-
SwComboBox::SwComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ):
ComboBox(pParent, rId),
nStyle(nStyleBits)
{
- // Verwaltung fuer die Stringlist aus der Resource aufbauen
+ // create administration for the resource's Stringlist
sal_uInt16 nSize = GetEntryCount();
for( sal_uInt16 i=0; i < nSize; ++i )
{
@@ -85,67 +77,39 @@ SwComboBox::SwComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits
}
}
-/*--------------------------------------------------------------------
- Beschreibung: Basisklasse Dtor
- --------------------------------------------------------------------*/
-
-
+// Basic class Dtor
SwComboBox::~SwComboBox()
{
-// das erledigen die Listen doch schon selbst im DTOR!
-// aEntryLst.DeleteAndDestroy(0, aEntryLst.Count());
-// aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count());
}
-/*--------------------------------------------------------------------
- Beschreibung: Eintrag in die ComboBox aufnehmen
- --------------------------------------------------------------------*/
-
-
void SwComboBox::InsertEntry(const SwBoxEntry& rEntry)
{
InsertSorted(new SwBoxEntry(rEntry));
}
-/*--------------------------------------------------------------------
- Beschreibung: Eintrag aus der Liste loeschen
- --------------------------------------------------------------------*/
-
-
void SwComboBox::RemoveEntry(sal_uInt16 nPos)
{
if(nPos >= aEntryLst.Count())
return;
- // Altes Element austragen
+ // Remove old element
SwBoxEntry* pEntry = aEntryLst[nPos];
aEntryLst.Remove(nPos, 1);
ComboBox::RemoveEntry(nPos);
- // keine neuen Eintraege in die Liste mit aufnehmen
+ // Don't add new entries to the list
if(pEntry->bNew)
return;
- // in DeleteListe eintragen
+ // add to DelEntryLst
aDelEntryLst.C40_INSERT(SwBoxEntry, pEntry, aDelEntryLst.Count());
}
-
-
-/*--------------------------------------------------------------------
- Beschreibung: Position by Name
- --------------------------------------------------------------------*/
-
sal_uInt16 SwComboBox::GetEntryPos(const SwBoxEntry& rEntry) const
{
return ComboBox::GetEntryPos(rEntry.aName);
}
-/*--------------------------------------------------------------------
- Beschreibung: Rund um die Entries
- --------------------------------------------------------------------*/
-
-
const SwBoxEntry& SwComboBox::GetEntry(sal_uInt16 nPos) const
{
if(nPos < aEntryLst.Count())
@@ -154,17 +118,11 @@ const SwBoxEntry& SwComboBox::GetEntry(sal_uInt16 nPos) const
return aDefault;
}
-/*--------------------------------------------------------------------
- Beschreibung: geloeschte Eintraege
- --------------------------------------------------------------------*/
-
-
sal_uInt16 SwComboBox::GetRemovedCount() const
{
return aDelEntryLst.Count();
}
-
const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const
{
if(nPos < aDelEntryLst.Count())
@@ -173,11 +131,6 @@ const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const
return aDefault;
}
-/*--------------------------------------------------------------------
- Beschreibung: Sortiert einfuegen
- --------------------------------------------------------------------*/
-
-
void SwComboBox::InsertSorted(SwBoxEntry* pEntry)
{
ComboBox::InsertEntry(pEntry->aName);
@@ -185,12 +138,6 @@ void SwComboBox::InsertSorted(SwBoxEntry* pEntry)
aEntryLst.C40_INSERT(SwBoxEntry, pEntry, nPos);
}
-
-/*--------------------------------------------------------------------
- Beschreibung: Je nach Option bestimmte Zeichen ausblenden
- --------------------------------------------------------------------*/
-
-
void SwComboBox::KeyInput( const KeyEvent& rKEvt )
{
sal_uInt16 nChar = rKEvt.GetCharCode();
@@ -208,13 +155,7 @@ void SwComboBox::KeyInput( const KeyEvent& rKEvt )
ComboBox::KeyInput(rKEvt);
}
-
-
-/*--------------------------------------------------------------------
- Beschreibung: Text nach Option konvertieren
- --------------------------------------------------------------------*/
-
-
+// Convert text according to option
String SwComboBox::GetText() const
{
String aTxt( ComboBox::GetText() );
@@ -229,3 +170,4 @@ String SwComboBox::GetText() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index ff4ec261b209..39287e7169bb 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,33 +36,21 @@
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <uitool.hxx>
#include <swtypes.hxx>
#include <wrtsh.hxx>
-#ifndef _BASESH_HXX
#include <basesh.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <break.hxx>
#include <pagedesc.hxx>
#include <poolfmt.hxx>
-#ifndef _BREAK_HRC
#include <break.hrc>
-#endif
-#ifndef _CHRDLG_HRC
#include <chrdlg.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
void SwBreakDlg::Apply()
@@ -83,7 +72,6 @@ void SwBreakDlg::Apply()
}
}
-
IMPL_LINK_INLINE_START( SwBreakDlg, ClickHdl, void *, EMPTYARG )
{
CheckEnable();
@@ -92,7 +80,7 @@ IMPL_LINK_INLINE_START( SwBreakDlg, ClickHdl, void *, EMPTYARG )
IMPL_LINK_INLINE_END( SwBreakDlg, ClickHdl, void *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: Handler fuer Aendern Seitenummer
+ Description: Handler for Change Page Number
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwBreakDlg, PageNumHdl, CheckBox *, pBox )
@@ -104,7 +92,7 @@ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumHdl, CheckBox *, pBox )
IMPL_LINK_INLINE_END( SwBreakDlg, PageNumHdl, CheckBox *, pBox )
/*------------------------------------------------------------------------
- Beschreibung: Durch Aendern der Seitennummer wird die Checkbox gecheckt.
+ Description: By changing the Page number the checkbox is checked.
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG )
@@ -115,18 +103,18 @@ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG )
IMPL_LINK_INLINE_END( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: Ok-Handler;
- prueft, ob die Seitenummer nPage eine legale Seitennummer
- ist (linke Seiten mit geraden Nummern etc. bei einer Seitenvorlage
- mit wechselnden Seiten)
+ Description: Ok-Handler;
+ checks whether pagenumber nPage is a legal pagenumber
+ (left pages with even numbers etc. for a page template
+ with alternating pages)
------------------------------------------------------------------------*/
IMPL_LINK( SwBreakDlg, OkHdl, Button *, EMPTYARG )
{
if(aPageNumBox.IsChecked()) {
- // wenn unterschiedliche Seitenvorlagen, testen auf Gueltigkeit
+ // In case of differing page descriptions, test validity
const sal_uInt16 nPos = aPageCollBox.GetSelectEntryPos();
- // auf Position 0 steht 'Ohne'.
+ // position 0 says 'Without'.
const SwPageDesc *pPageDesc;
if ( 0 != nPos && LISTBOX_ENTRY_NOTFOUND != nPos )
pPageDesc = rSh.FindPageDescByName( aPageCollBox.GetSelectEntry(),
@@ -134,7 +122,7 @@ IMPL_LINK( SwBreakDlg, OkHdl, Button *, EMPTYARG )
else
pPageDesc = &rSh.GetPageDesc(rSh.GetCurPageDesc());
- ASSERT(pPageDesc, Seitenvorlage nicht gefunden.);
+ OSL_ENSURE(pPageDesc, "Page description not found.");
const sal_uInt16 nUserPage = sal_uInt16(aPageNumEdit.GetValue());
sal_Bool bOk = sal_True;
switch(pPageDesc->GetUseOn())
@@ -192,7 +180,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
aPageNumEdit.SetModifyHdl(LINK(this,SwBreakDlg,PageNumModifyHdl));
- // Einfuegen der vorhandenen Seitenvorlagen in die Listbox
+ // Insert page description to Listbox
const sal_uInt16 nCount = rSh.GetPageDescCnt();
sal_uInt16 i;
@@ -216,7 +204,6 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
FreeResource();
}
-
void SwBreakDlg::CheckEnable()
{
sal_Bool bEnable = sal_True;
@@ -241,7 +228,7 @@ void SwBreakDlg::CheckEnable()
bEnable &= bPage;
if ( bEnable )
{
- // auf Position 0 steht 'Ohne' Seitenvorlage.
+ // position 0 says 'Without' page template.
const sal_uInt16 nPos = aPageCollBox.GetSelectEntryPos();
if ( 0 == nPos || LISTBOX_ENTRY_NOTFOUND == nPos )
bEnable = sal_False;
@@ -253,3 +240,5 @@ void SwBreakDlg::CheckEnable()
SwBreakDlg::~SwBreakDlg()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx
index f2099aabdda1..9a381071df56 100644
--- a/sw/source/ui/chrdlg/ccoll.cxx
+++ b/sw/source/ui/chrdlg/ccoll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "cmdid.h"
-#include <tools/list.hxx>
#include "swmodule.hxx"
#include "view.hxx"
#include "wrtsh.hxx"
#include "globals.hrc"
#include "helpid.h"
-
#include <sfx2/styfitem.hxx>
#include "uitool.hxx"
@@ -108,7 +105,7 @@ rtl::OUString GetCommandContextByIndex( sal_Int16 nIndex )
rtl::OUString aRes;
if (0 <= nIndex && nIndex < COND_COMMAND_COUNT)
{
- aRes = C2U( aCommandContext[ nIndex ] );
+ aRes = rtl::OUString::createFromAscii( aCommandContext[ nIndex ] );
}
return aRes;
}
@@ -152,7 +149,7 @@ CommandStruct SwCondCollItem::aCmds[] =
TYPEINIT1_AUTOFACTORY(SwCondCollItem, SfxPoolItem)
/****************************************************************************
- Item fuer den Transport der Bedingungstabelle
+ Item for the transport of the condition table
****************************************************************************/
@@ -161,33 +158,19 @@ SwCondCollItem::SwCondCollItem(sal_uInt16 _nWhich ) :
{
}
-/****************************************************************************
-
-****************************************************************************/
-
SwCondCollItem::~SwCondCollItem()
{
}
-/****************************************************************************
-
-****************************************************************************/
-
-
SfxPoolItem* SwCondCollItem::Clone( SfxItemPool * /*pPool*/ ) const
{
return new SwCondCollItem(*this);
}
-/****************************************************************************
-
-****************************************************************************/
-
-
int SwCondCollItem::operator==( const SfxPoolItem& rItem) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rItem), "unterschiedliche Typen" );
+ OSL_ENSURE( SfxPoolItem::operator==(rItem), "different types" );
sal_Bool bReturn = sal_True;
for(sal_uInt16 i = 0; i < COND_COMMAND_COUNT; i++)
if(sStyles[i] != ((SwCondCollItem&)rItem).sStyles[i])
@@ -199,38 +182,20 @@ int SwCondCollItem::operator==( const SfxPoolItem& rItem) const
return bReturn;
}
-/****************************************************************************
-
-****************************************************************************/
-
-
const String& SwCondCollItem::GetStyle(sal_uInt16 nPos) const
{
return nPos < COND_COMMAND_COUNT ? sStyles[nPos] : aEmptyStr;
}
-/****************************************************************************
-
-****************************************************************************/
-
-
void SwCondCollItem::SetStyle(const String* pStyle, sal_uInt16 nPos)
{
if( nPos < COND_COMMAND_COUNT )
sStyles[nPos] = pStyle ? *pStyle : aEmptyStr;
}
-
-/****************************************************************************
-
-****************************************************************************/
-
-
const CommandStruct* SwCondCollItem::GetCmds()
{
return aCmds;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/ccoll.src b/sw/source/ui/chrdlg/ccoll.src
index da20e56d0afd..8247888309cd 100644
--- a/sw/source/ui/chrdlg/ccoll.src
+++ b/sw/source/ui/chrdlg/ccoll.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "globals.hrc"
#include "chrdlg.hrc"
#include "ccoll.hrc"
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 15f6737b537c..fb5abe72b3a0 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,48 +36,29 @@
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svl/urihelper.hxx>
#include <svl/stritem.hxx>
#include <editeng/flstitem.hxx>
#include <svx/htmlmode.hxx>
#include <svl/cjkoptions.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <swtypes.hxx>
-#include <errhdl.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <uitool.hxx>
#include <fmtinfmt.hxx>
#include <macassgn.hxx>
-#ifndef _CHRDLG_HXX
-#include <chrdlg.hxx> // der Dialog
-#endif
+#include <chrdlg.hxx> // the dialog
#include <swmodule.hxx>
#include <poolfmt.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _CHRDLG_HRC
#include <chrdlg.hrc>
-#endif
-#ifndef _CHARDLG_HRC
#include <chardlg.hrc>
-#endif
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <SwStyleNameMapper.hxx>
@@ -93,11 +75,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::sfx2;
-/*--------------------------------------------------------------------
- Beschreibung: Der Traeger des Dialoges
- --------------------------------------------------------------------*/
-
-
SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
const String* pStr, sal_Bool bIsDrwTxtDlg) :
SfxTabDialog(pParent, SW_RES(DLG_CHAR), &rCoreSet, pStr != 0),
@@ -106,8 +83,6 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
{
FreeResource();
- // bspFonr fuer beide Bsp-TabPages
-
if(pStr)
{
String aTmp( GetText() );
@@ -117,7 +92,7 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
SetText(aTmp);
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 );
@@ -135,21 +110,15 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
else if(!aCJKOptions.IsDoubleLinesEnabled())
RemoveTabPage( TP_CHAR_TWOLN );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwCharDlg::~SwCharDlg()
{
}
/*--------------------------------------------------------------------
- Beschreibung: FontList setzen
+ Description: set FontList
--------------------------------------------------------------------*/
-
-
void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
@@ -186,10 +155,6 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
}
-/*-----------------14.08.96 11.28-------------------
-
---------------------------------------------------*/
-
SwCharURLPage::SwCharURLPage( Window* pParent,
const SfxItemSet& rCoreSet ) :
SfxTabPage( pParent, SW_RES( TP_CHAR_URL ), rCoreSet ),
@@ -245,38 +210,28 @@ SwCharURLPage::SwCharURLPage( Window* pParent,
TargetList* pList = new TargetList;
const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame();
rFrame.GetTargetList(*pList);
- sal_uInt16 nCount = (sal_uInt16)pList->Count();
- if( nCount )
+ if ( !pList->empty() )
{
- sal_uInt16 i;
+ size_t nCount = pList->size();
+ size_t i;
for ( i = 0; i < nCount; i++ )
{
- aTargetFrmLB.InsertEntry(*pList->GetObject(i));
+ aTargetFrmLB.InsertEntry( *pList->at( i ) );
}
- for ( i = nCount; i; i-- )
+ for ( i = nCount; i; )
{
- delete pList->GetObject( i - 1 );
+ delete pList->at( --i );
}
}
delete pList;
-
-
}
-/*-----------------15.08.96 09.04-------------------
-
---------------------------------------------------*/
-
SwCharURLPage::~SwCharURLPage()
{
delete pINetItem;
}
-/*-----------------14.08.96 11.31-------------------
-
---------------------------------------------------*/
-
void SwCharURLPage::Reset(const SfxItemSet& rSet)
{
const SfxPoolItem* pItem;
@@ -315,10 +270,6 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet)
}
}
-/*-----------------14.08.96 11.32-------------------
-
---------------------------------------------------*/
-
sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet)
{
::rtl::OUString sURL = aURLED.GetText();
@@ -338,7 +289,7 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet)
bModified |= aNameED.IsModified();
bModified |= aTargetFrmLB.GetSavedValue() != aTargetFrmLB.GetText();
- //zuerst die gueltigen Einstellungen setzen
+ // set valid settings first
String sEntry = aVisitedLB.GetSelectEntry();
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sEntry, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
aINetFmt.SetVisitedFmtId(nId);
@@ -368,21 +319,12 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet)
return bModified;
}
-
-/*-----------------14.08.96 11.30-------------------
-
---------------------------------------------------*/
-
SfxTabPage* SwCharURLPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwCharURLPage( pParent, rAttrSet ) );
}
-/*-----------------14.08.96 15.00-------------------
-
---------------------------------------------------*/
-
IMPL_LINK( SwCharURLPage, InsertFileHdl, PushButton *, EMPTYARG )
{
FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
@@ -393,9 +335,6 @@ IMPL_LINK( SwCharURLPage, InsertFileHdl, PushButton *, EMPTYARG )
}
return 0;
}
-/*-----------------14.08.96 15.00-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwCharURLPage, EventHdl, PushButton *, EMPTYARG )
{
@@ -405,3 +344,4 @@ IMPL_LINK( SwCharURLPage, EventHdl, PushButton *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/chrdlg.src b/sw/source/ui/chrdlg/chrdlg.src
index 297668f6093a..b3c8ff6f294e 100644
--- a/sw/source/ui/chrdlg/chrdlg.src
+++ b/sw/source/ui/chrdlg/chrdlg.src
@@ -42,7 +42,6 @@ InfoBox MSG_ILLEGAL_PAGENUM
{
BUTTONS = WB_OK ;
DEFBUTTON = WB_DEF_OK ;
- /* ### ACHTUNG: Neuer Text in Resource? Seitennummer kann nicht gesetzt werden. Auf linken Seiten dürfen nur gerade Seitenzahlen, auf rechten Seiten nur ungerade Seitenzahlen verwendet werden. : Seitennummer kann nicht gesetzt werden. Auf linken Seiten d³rfen nur gerade Seitenzahlen, auf rechten Seiten nur ungerade Seitenzahlen verwendet werden. */
Message [ en-US ] = "Page numbers cannot be applied to the current page. Even numbers can be used on left pages, odd numbers on right pages." ;
};
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 8f02d0cc8796..dd1cb640697f 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,11 +32,10 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
#include <hintids.hxx>
#define _SVSTDARR_STRINGSDTOR
#define _SVSTDARR_STRINGSISORTDTOR
+#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
#include "cmdid.h"
@@ -44,10 +44,7 @@
#include "wrtsh.hxx"
#include "globals.hrc"
-
-#ifndef _METRIC_HXX //autogen
#include <vcl/metric.hxx>
-#endif
#include <svl/stritem.hxx>
#include <editeng/fontitem.hxx>
#include <svx/htmlmode.hxx>
@@ -55,18 +52,11 @@
#include <editeng/svxfont.hxx>
#include <vcl/print.hxx>
#include <sfx2/printer.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <editeng/scripttypeitem.hxx>
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <comphelper/processfactory.hxx>
-#define _SVSTDARR_XUB_STRLEN
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
-#include <svl/svstdarr.hxx>
-
#include "charatr.hxx"
#include "viewopt.hxx"
#include "drpcps.hxx"
@@ -89,15 +79,11 @@ using namespace ::com::sun::star::lang;
// Globals ******************************************************************
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
RES_PARATR_DROP, RES_PARATR_DROP,
0
};
-
-
-// class SwDropCapsPict *****************************************************
-
class SwDropCapsPict : public Control
{
String maText;
@@ -112,9 +98,18 @@ class SwDropCapsPict : public Control
sal_Int32 mnLeading;
Printer* mpPrinter;
sal_Bool mbDelPrinter;
- SvULongs maTextWidth;
- SvXub_StrLens maScriptChg;
- SvUShorts maScriptType;
+ /// The _ScriptInfo structure holds information on where we change from one
+ /// script to another.
+ struct _ScriptInfo
+ {
+ sal_uLong textWidth; ///< Physical width of this segment.
+ sal_uInt16 scriptType; ///< Script type (e.g. Latin, Asian, Complex)
+ xub_StrLen changePos; ///< Character position where the script changes.
+ _ScriptInfo(sal_uLong txtWidth, sal_uInt16 scrptType, xub_StrLen position)
+ : textWidth(txtWidth), scriptType(scrptType), changePos(position) {}
+ bool operator<(_ScriptInfo other) { return changePos < other.changePos; }
+ };
+ std::vector<_ScriptInfo> maScriptChanges;
SvxFont maFont;
SvxFont maCJKFont;
SvxFont maCTLFont;
@@ -127,10 +122,18 @@ class SwDropCapsPict : public Control
inline void InitPrinter( void );
void _InitPrinter( void );
void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich );
+ void GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType);
+ bool GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType);
public:
- SwDropCapsPict(Window *pParent, const ResId &rResId) :
- Control(pParent, rResId), mpPrinter( NULL ), mbDelPrinter( sal_False ) {}
+ SwDropCapsPict(Window *pParent, const ResId &rResId)
+ : Control(pParent, rResId)
+ , mnTotLineH(0)
+ , mnLineH(0)
+ , mnTextH(0)
+ , mpPrinter( NULL )
+ , mbDelPrinter( sal_False )
+ {}
~SwDropCapsPict();
void UpdatePaintSettings( void ); // also invalidates control!
@@ -177,7 +180,7 @@ inline void SwDropCapsPict::InitPrinter( void )
}
/****************************************************************************
-Default-String aus Zeichenanzahl erzeugen (A, AB, ABC, ...)
+ Create Default-String from character-count (A, AB, ABC, ...)
****************************************************************************/
@@ -200,20 +203,46 @@ static void calcFontHeightAnyAscent( OutputDevice* _pWin, Font& _rFont, long& _n
}
}
-/****************************************************************************
-Pict: Dtor
-****************************************************************************/
-
-
SwDropCapsPict::~SwDropCapsPict()
{
if( mbDelPrinter )
delete mpPrinter;
}
-/****************************************************************************
-Pict: Update Font
-****************************************************************************/
+/// Get the details of the first script change.
+/// @param[out] start The character position of the start of the segment.
+/// @param[out] end The character position of the end of the segment.
+/// @param[out] scriptType The script type (Latin, Asian, Complex etc.)
+void SwDropCapsPict::GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType)
+{
+ start = 0;
+ if( maScriptChanges.empty() )
+ {
+ end = maText.Len();
+ scriptType = I18N_SCRIPTTYPE::LATIN;
+ }
+ else
+ {
+ end = maScriptChanges[ 0 ].changePos;
+ scriptType = maScriptChanges[ 0 ].scriptType;
+ }
+}
+
+/// Get the details of the first script change.
+/// @param[in,out] nIdx Index of the current script change.
+/// @param[out] start The character position of the start of the segment.
+/// @param[in,out] end The character position of the end of the segment.
+/// @param[out] scriptType The script type (Latin, Asian, Complex etc.)
+/// @returns True if there was a next segment, false if not.
+bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType)
+{
+ if (maScriptChanges.empty() || nIdx >= maScriptChanges.size() - 1 || end >= maText.Len())
+ return false;
+ start = maScriptChanges[nIdx++].changePos;
+ end = maScriptChanges[ nIdx ].changePos;
+ scriptType = maScriptChanges[ nIdx ].scriptType;
+ return true;
+}
#define LINES 10
#define BORDER 2
@@ -245,7 +274,7 @@ void SwDropCapsPict::UpdatePaintSettings( void )
SwDropCapsPage* pPage = ( SwDropCapsPage* ) GetParent();
if (!pPage->aTemplateBox.GetSelectEntryPos())
{
- // Font an Absatzanfang erfragen
+ // query the Font at paragraph's beginning
pPage->rSh.SttCrsrMove();
pPage->rSh.Push();
pPage->rSh.ClearMark();
@@ -266,11 +295,11 @@ void SwDropCapsPict::UpdatePaintSettings( void )
}
else
{
- // Font an Zeichenvorlage erfragen
+ // query Font at character template
SwCharFmt *pFmt = pPage->rSh.GetCharStyle(
pPage->aTemplateBox.GetSelectEntry(),
SwWrtShell::GETSTYLE_CREATEANY );
- ASSERT(pFmt, "Zeichenvorlage existiert nicht!");
+ OSL_ENSURE(pFmt, "character style doesn't exist!");
const SvxFontItem &rFmtFont = pFmt->GetFont();
aFont.SetFamily (rFmtFont.GetFamily());
@@ -334,13 +363,13 @@ void SwDropCapsPict::Paint(const Rectangle &/*rRect*/)
Size (aOutputSizePixel.Width () - 2 * BORDER,
aOutputSizePixel.Height() - 2 * BORDER))));
- ASSERT(mnLineH > 0, "So klein lassen wir uns nicht machen");
+ OSL_ENSURE(mnLineH > 0, "We cannot make it that small");
long nY0 = (aOutputSizePixel.Height() - (LINES * mnTotLineH)) / 2;
SetFillColor( maTextLineColor );
for (sal_uInt16 i = 0; i < LINES; ++i)
DrawRect(Rectangle(Point(BORDER, nY0 + i * mnTotLineH), Size(aOutputSizePixel.Width() - 2 * BORDER, mnLineH)));
- // Texthintergrund mit Abstand (240 twips ~ 1 Zeilenhoehe)
+ // Text background with gap (240 twips ~ 1 line height)
sal_uLong lDistance = mnDistance;
sal_uInt16 nDistW = (sal_uInt16) (sal_uLong) (((lDistance * 100) / 240) * mnTotLineH) / 100;
SetFillColor( maBackColor );
@@ -350,7 +379,7 @@ void SwDropCapsPict::Paint(const Rectangle &/*rRect*/)
aTextSize.Width() += nDistW;
DrawRect( Rectangle( Point( BORDER, nY0 ), aTextSize ) );
- // Text zeichnen
+ // draw Text
DrawPrev( Point( BORDER, nY0 - mnLeading ) );
}
@@ -365,20 +394,9 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
Font aOldFont = mpPrinter->GetFont();
sal_uInt16 nScript;
size_t nIdx = 0;
- xub_StrLen nStart = 0;
+ xub_StrLen nStart;
xub_StrLen nEnd;
- size_t nCnt = maScriptChg.size();
-
- if( nCnt )
- {
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
- {
- nEnd = maText.Len();
- nScript = I18N_SCRIPTTYPE::LATIN;
- }
+ GetFirstScriptSegment(nStart, nEnd, nScript);
do
{
SvxFont& rFnt = (nScript==I18N_SCRIPTTYPE::ASIAN) ? maCJKFont : ((nScript==I18N_SCRIPTTYPE::COMPLEX) ? maCTLFont : maFont);
@@ -386,14 +404,8 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
rFnt.DrawPrev( this, mpPrinter, aPt, maText, nStart, nEnd - nStart );
- aPt.X() += maTextWidth[ nIdx++ ];
- if( nEnd < maText.Len() && nIdx < nCnt )
- {
- nStart = nEnd;
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
+ aPt.X() += maScriptChanges[ nIdx ].textWidth;
+ if ( !GetNextScriptSegment(nIdx, nStart, nEnd, nScript) )
break;
}
while( sal_True );
@@ -406,19 +418,12 @@ void SwDropCapsPict::CheckScript( void )
return;
maScriptText = maText;
- size_t nCnt = maScriptChg.size();
- if( nCnt )
- {
- maScriptChg.clear();
- maScriptType.Remove( 0, nCnt );
- maTextWidth.Remove( 0, nCnt );
- nCnt = 0;
- }
+ maScriptChanges.clear();
if( !xBreak.is() )
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
xBreak = Reference< I18N::XBreakIterator >(xMSF->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) ),UNO_QUERY);
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),UNO_QUERY);
}
if( xBreak.is() )
{
@@ -436,9 +441,7 @@ void SwDropCapsPict::CheckScript( void )
do
{
nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
- maScriptChg.push_back( nChg );
- maScriptType.Insert( nScript, nCnt );
- maTextWidth.Insert( sal_uLong(0), nCnt++ );
+ maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) );
if( nChg < maText.Len() )
nScript = xBreak->getScriptType( maText, nChg );
@@ -454,19 +457,9 @@ Size SwDropCapsPict::CalcTextSize( void )
sal_uInt16 nScript;
size_t nIdx = 0;
- xub_StrLen nStart = 0;
+ xub_StrLen nStart;
xub_StrLen nEnd;
- size_t nCnt = maScriptChg.size();
- if( nCnt )
- {
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
- {
- nEnd = maText.Len();
- nScript = I18N_SCRIPTTYPE::LATIN;
- }
+ GetFirstScriptSegment(nStart, nEnd, nScript);
long nTxtWidth = 0;
long nCJKHeight = 0;
long nCTLHeight = 0;
@@ -480,8 +473,8 @@ Size SwDropCapsPict::CalcTextSize( void )
( ( nScript == I18N_SCRIPTTYPE::COMPLEX )? maCTLFont : maFont );
sal_uLong nWidth = rFnt.GetTxtSize( mpPrinter, maText, nStart, nEnd-nStart ).Width();
- if( nIdx < maTextWidth.Count() )
- maTextWidth[ nIdx++ ] = nWidth;
+ if( nIdx < maScriptChanges.size() )
+ maScriptChanges[ nIdx ].textWidth = nWidth;
nTxtWidth += nWidth;
switch(nScript)
{
@@ -495,13 +488,7 @@ Size SwDropCapsPict::CalcTextSize( void )
calcFontHeightAnyAscent( this, maFont, nHeight, nAscent );
}
- if( nEnd < maText.Len() && nIdx < nCnt )
- {
- nStart = nEnd;
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
+ if ( !GetNextScriptSegment(nIdx, nStart, nEnd, nScript) )
break;
}
while( sal_True );
@@ -536,11 +523,6 @@ void SwDropCapsPict::_InitPrinter()
}
}
-/****************************************************************************
-Dlg: Ctor
-****************************************************************************/
-
-
SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet ) :
SfxSingleTabDialog(pParent, rSet, 0)
@@ -551,20 +533,10 @@ SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet ) :
SetTabPage(pNewPage);
}
-/****************************************************************************
-Dlg: Dtor
-****************************************************************************/
-
-
SwDropCapsDlg::~SwDropCapsDlg()
{
}
-/****************************************************************************
-Page: Ctor
-****************************************************************************/
-
-
SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_DROPCAPS), rSet),
@@ -597,16 +569,16 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False;
- //Im Vorlagendialog kann der Text nicht beeinflusst werden
+ // In the template dialog the text is not influenceable
aTextText.Enable( !bFormat );
aTextEdit.Enable( !bFormat );
- // Metriken
+ // Metrics
SetMetric( aDistanceField, GetDfltMetric(bHtmlMode) );
pPict->SetBorderStyle( WINDOW_BORDER_MONO );
- // Handler installieren
+ // Install handler
Link aLk = LINK(this, SwDropCapsPage, ModifyHdl);
aDropCapsField.SetModifyHdl( aLk );
aLinesField .SetModifyHdl( aLk );
@@ -617,17 +589,11 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
aWholeWordCB .SetClickHdl (LINK(this, SwDropCapsPage, WholeWordHdl ));
}
-/****************************************************************************
-Page: Dtor
-****************************************************************************/
-
-
SwDropCapsPage::~SwDropCapsPage()
{
delete pPict;
}
-
int SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
{
if ( _pSet )
@@ -640,7 +606,6 @@ int SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
Page: Factory
****************************************************************************/
-
SfxTabPage* SwDropCapsPage::Create(Window *pParent,
const SfxItemSet &rSet)
{
@@ -651,7 +616,6 @@ SfxTabPage* SwDropCapsPage::Create(Window *pParent,
Page: FillItemSet-Overload
****************************************************************************/
-
sal_Bool SwDropCapsPage::FillItemSet(SfxItemSet &rSet)
{
if(bModified)
@@ -663,10 +627,9 @@ sal_Bool SwDropCapsPage::FillItemSet(SfxItemSet &rSet)
Page: Reset-Overload
****************************************************************************/
-
void SwDropCapsPage::Reset(const SfxItemSet &rSet)
{
- // Zeichen, Zeilen, Abstand und Text
+ // Characters, lines, gap and text
SwFmtDrop aFmtDrop((SwFmtDrop &) rSet.Get(RES_PARATR_DROP));
if (aFmtDrop.GetLines() > 1)
{
@@ -685,12 +648,13 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet)
::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), sal_True);
aTemplateBox.InsertEntry(SW_RESSTR(SW_STR_NONE), 0);
- // Vorlage defaulten
+
+ // Reset format
aTemplateBox.SelectEntryPos(0);
if (aFmtDrop.GetCharFmt())
aTemplateBox.SelectEntry(aFmtDrop.GetCharFmt()->GetName());
- // Controls enablen
+ // Enable controls
aDropCapsBox.Check(aFmtDrop.GetLines() > 1);
const sal_uInt16 nVal = sal_uInt16(aDropCapsField.GetValue());
if (bFormat)
@@ -712,7 +676,7 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet)
}
/****************************************************************************
-Page: Click-Handler der CheckBox
+Page: CheckBox's Click-Handler
****************************************************************************/
@@ -747,7 +711,7 @@ IMPL_LINK( SwDropCapsPage, ClickHdl, Button *, EMPTYARG )
}
/****************************************************************************
-Page: Click-Handler der CheckBox
+Page: CheckBox's Click-Handler
****************************************************************************/
@@ -763,7 +727,7 @@ IMPL_LINK( SwDropCapsPage, WholeWordHdl, CheckBox *, EMPTYARG )
}
/****************************************************************************
-Page: Modify-Handler der SpinFields
+Page: SpinFields' Modify-Handler
****************************************************************************/
@@ -771,7 +735,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
{
String sPreview;
- // Ggf. Text setzen
+ // set text if applicable
if (pEdit == &aDropCapsField)
{
sal_uInt16 nVal;
@@ -801,7 +765,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
if (bSetText)
aTextEdit.SetText(sPreview);
}
- else if (pEdit == &aTextEdit) // Ggf. Anzahl setzen
+ else if (pEdit == &aTextEdit) // set quantity if applicable
{
sal_uInt16 nTmp = aTextEdit.GetText().Len();
aDropCapsField.SetValue(Max((sal_uInt16)1, nTmp));
@@ -809,7 +773,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
sPreview = aTextEdit.GetText().Copy(0, nTmp);
}
- // Bild anpassen
+ // adjust image
if (pEdit == &aDropCapsField || pEdit == &aTextEdit)
pPict->SetText (sPreview);
else if (pEdit == &aLinesField)
@@ -823,7 +787,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
}
/****************************************************************************
-Page: Select-Handler der Template-Box.
+Page: Template-Box' Select-Handler.
*****************************************************************************/
@@ -835,13 +799,11 @@ IMPL_LINK_INLINE_START( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG )
-
sal_uInt16* SwDropCapsPage::GetRanges()
{
return aPageRg;
}
-
void SwDropCapsPage::FillSet( SfxItemSet &rSet )
{
if(bModified)
@@ -851,13 +813,13 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
sal_Bool bOn = aDropCapsBox.IsChecked();
if(bOn)
{
- // Anzahl, Zeilen, Abstand
+ // quantity, lines, gap
aFmt.GetChars() = (sal_uInt8) aDropCapsField.GetValue();
aFmt.GetLines() = (sal_uInt8) aLinesField.GetValue();
aFmt.GetDistance() = (sal_uInt16) aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP));
aFmt.GetWholeWord() = aWholeWordCB.IsChecked();
- // Vorlage
+ // template
if (aTemplateBox.GetSelectEntryPos())
aFmt.SetCharFmt(rSh.GetCharStyle(aTemplateBox.GetSelectEntry()));
}
@@ -868,14 +830,14 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
aFmt.GetDistance() = 0;
}
- // Attribute setzen
+ // set attributes
const SfxPoolItem* pOldItem;
if(0 == (pOldItem = GetOldItem( rSet, FN_FORMAT_DROPCAPS )) ||
aFmt != *pOldItem )
rSet.Put(aFmt);
- // Harte Textformatierung
- // Bug 24974: In Gestalter/Vorlagenkatoplog macht das keinen Sinn!!
+ // hard text formatting
+ // Bug 24974: in designer/template catalog this doesn't make sense!!
if( !bFormat && aDropCapsBox.IsChecked() )
{
String sText(aTextEdit.GetText());
@@ -892,3 +854,4 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/drpcps.src b/sw/source/ui/chrdlg/drpcps.src
index 458d83a5d079..82cdc5ecf445 100644
--- a/sw/source/ui/chrdlg/drpcps.src
+++ b/sw/source/ui/chrdlg/drpcps.src
@@ -25,7 +25,6 @@
*
************************************************************************/
- // #include *****************************************************************
#include "globals.hrc"
#include "chrdlg.hrc"
#include "drpcps.hrc"
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 20b99cc492fb..0b3de84f24b9 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,8 +33,6 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
#include "cmdid.h"
#include "swtypes.hxx"
#include "hintids.hxx"
@@ -41,28 +40,24 @@
#include "helpid.h"
#include <sfx2/objsh.hxx>
#include <svx/htmlmode.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
#include <fmtline.hxx>
#include <numpara.hxx>
#include <numpara.hrc>
-// --> OD 2008-04-14 #outlinelevel#
+
#include <app.hrc>
-// <--
+
// Globals ******************************************************************
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT,
0
};
-/*-----------------31.01.98 08:34-------------------
---------------------------------------------------*/
SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
const SfxItemSet& rAttr ) :
SfxTabPage(pParent, SW_RES(TP_NUMPARA), rAttr),
@@ -80,9 +75,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
aRestartParaCountCB ( this, SW_RES( CB_RESTART_PARACOUNT ) ),
aRestartFT ( this, SW_RES( FT_RESTART_NO ) ),
aRestartNF ( this, SW_RES( NF_RESTART_PARA ) ),
- // --> OD 2008-04-14 #outlinelevel#
msOutlineNumbering( SW_RES( STR_OUTLINE_NUMBERING ) ),
- // <--
bModified(sal_False),
bCurNumrule(sal_False)
{
@@ -114,36 +107,24 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
aNewStartNF.SetAccessibleName(aNewStartNumberCB.GetText());
aNewStartNF.SetAccessibleRelationLabeledBy(&aNewStartNumberCB);
}
-/*-----------------31.01.98 08:34-------------------
---------------------------------------------------*/
SwParagraphNumTabPage::~SwParagraphNumTabPage()
{
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
SfxTabPage* SwParagraphNumTabPage::Create( Window* pParent,
const SfxItemSet& rSet )
{
return new SwParagraphNumTabPage(pParent, rSet);
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
sal_uInt16* SwParagraphNumTabPage::GetRanges()
{
return aPageRg;
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
{
- //<-#outline level, added by zhaojianwei
if( aOutlineLvLB.GetSelectEntryPos() != aOutlineLvLB.GetSavedValue())
{
sal_uInt16 aOutlineLv = aOutlineLvLB.GetSelectEntryPos();
@@ -154,7 +135,7 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
delete pOutlineLv;
bModified = sal_True;
}
- //<-end
+
if( aNumberStyleLB.GetSelectEntryPos() != aNumberStyleLB.GetSavedValue())
{
String aStyle;
@@ -193,9 +174,6 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
return bModified;
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
{
sal_Bool bHasNumberStyle = sal_False;
@@ -223,7 +201,7 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
if(!aStyle.Len())
aStyle = aNumberStyleLB.GetEntry(0);
- if( aStyle.EqualsAscii("Outline"))// == String::CreateFromAscii("Outline")) //maybe need modify,zhaojianwei
+ if( aStyle.EqualsAscii("Outline"))
{
aNumberStyleLB.InsertEntry( msOutlineNumbering );
aNumberStyleLB.SelectEntry( msOutlineNumbering );
@@ -297,23 +275,18 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
bModified = sal_False;
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
void SwParagraphNumTabPage::DisableOutline()
{
aOutlineLvFT.Disable();
aOutlineLvLB.Disable();
}
+
void SwParagraphNumTabPage::DisableNumbering()
{
aNumberStyleFT.Disable();
aNumberStyleLB.Disable();
}
-/*-----------------31.01.98 08:38-------------------
-
---------------------------------------------------*/
void SwParagraphNumTabPage::EnableNewStart()
{
aNewStartCB.Show();
@@ -321,9 +294,6 @@ void SwParagraphNumTabPage::EnableNewStart()
aNewStartNF.Show();
}
-/*-----------------31.01.98 08:56-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwParagraphNumTabPage, NewStartHdl_Impl, CheckBox*, EMPTYARG )
{
sal_Bool bEnable = aNewStartCB.IsChecked();
@@ -332,9 +302,6 @@ IMPL_LINK( SwParagraphNumTabPage, NewStartHdl_Impl, CheckBox*, EMPTYARG )
return 0;
}
-/*-----------------05.02.98 10:01-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwParagraphNumTabPage, LineCountHdl_Impl, CheckBox* , EMPTYARG)
{
aRestartParaCountCB.Enable(aCountParaCB.IsChecked());
@@ -347,15 +314,8 @@ IMPL_LINK( SwParagraphNumTabPage, LineCountHdl_Impl, CheckBox* , EMPTYARG)
return 0;
}
-/*-----------------05.02.98 13:39-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox )
{
-// String dd=aNumberStyleLB.GetSavedValue();
-// if( msOutlineNumbering == dd)
- {
- }
sal_Bool bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0;
aNewStartCB.Enable(bEnable);
NewStartHdl_Impl(&aNewStartCB);
@@ -364,3 +324,4 @@ IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/numpara.src b/sw/source/ui/chrdlg/numpara.src
index a0747655ee03..67ce361330e9 100644
--- a/sw/source/ui/chrdlg/numpara.src
+++ b/sw/source/ui/chrdlg/numpara.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "globals.hrc"
#include "chrdlg.hrc"
#include "numpara.hrc"
diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src
index 1384e4ae8fa3..8194ebbb799e 100644
--- a/sw/source/ui/chrdlg/paradlg.src
+++ b/sw/source/ui/chrdlg/paradlg.src
@@ -44,7 +44,6 @@ TabDialog DLG_PARA
PageItem
{
Identifier = TP_PARA_STD ;
- /* ### ACHTUNG: Neuer Text in Resource? Einzüge und Abstände : Einz³ge und Abstõnde */
Text [ en-US ] = "Indents & Spacing" ;
PageResID = TP_PARA_STD ;
};
@@ -57,7 +56,6 @@ TabDialog DLG_PARA
PageItem
{
Identifier = TP_PARA_EXT ;
- /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/
Text [ en-US ] = "Text Flow" ;
PageResID = TP_PARA_EXT ;
};
@@ -112,7 +110,6 @@ TabDialog DLG_DRAWPARA
PageItem
{
Identifier = TP_PARA_STD ;
- /* ### ACHTUNG: Neuer Text in Resource? Einzüge und Abstände : Einz³ge und Abstõnde */
Text [ en-US ] = "Indents & Spacing" ;
PageResID = TP_PARA_STD ;
};
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index e91f2d67d880..5198c14ce76e 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,8 +65,6 @@
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <svx/flagsdef.hxx>
-// STATIC DATA -----------------------------------------------------------
-
SwParaDlg::SwParaDlg(Window *pParent,
SwView& rVw,
@@ -89,7 +88,7 @@ SwParaDlg::SwParaDlg(Window *pParent,
sal_Bool bHtmlMode = static_cast< sal_Bool >(nHtmlMode & HTMLMODE_ON);
if(pTitle)
{
- // Update des Titels
+ // Update title
String aTmp( GetText() );
aTmp += SW_RESSTR(STR_TEXTCOLL_HEADER);
aTmp += *pTitle;
@@ -98,19 +97,19 @@ SwParaDlg::SwParaDlg(Window *pParent,
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_STD, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!bDrawParaDlg && (!bHtmlMode || pHtmlOpt->IsPrintLayoutExtension()))
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!bDrawParaDlg && (!bHtmlMode || rHtmlOpt.IsPrintLayoutExtension()))
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_EXT, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
}
@@ -120,8 +119,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
SvtCJKOptions aCJKOptions;
if(!bHtmlMode && aCJKOptions.IsAsianTypographyEnabled())
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
}
else
@@ -133,8 +132,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
RemoveTabPage(TP_TABULATOR);
else
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
AddTabPage( TP_TABULATOR, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
}
@@ -154,8 +153,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
}
if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES)))
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
}
else
@@ -164,8 +163,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
}
if(!bHtmlMode || (nHtmlMode & HTMLMODE_PARA_BORDER))
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
}
else
@@ -177,17 +176,17 @@ SwParaDlg::SwParaDlg(Window *pParent,
}
-__EXPORT SwParaDlg::~SwParaDlg()
+SwParaDlg::~SwParaDlg()
{
}
-void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
+void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
{
SwWrtShell& rSh = rView.GetWrtShell();
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden
+ // Table borders cannot get any shade in Writer
if (nId == TP_BORDER)
{
aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
@@ -216,8 +215,7 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
}
else if( TP_PARA_EXT == nId )
{
- // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in
- // einer Tabelle steht
+ // pagebreak only when the cursor is in the body-area and not in a table
const sal_uInt16 eType = rSh.GetFrmType(0,sal_True);
if( !(FRMTYPE_BODY & eType) ||
rSh.GetSelectionType() & nsSelectionType::SEL_TBL )
@@ -241,12 +239,11 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
}
else if( TP_NUMPARA == nId)
{
- //-->#outline level,added by zhaojianwei
SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl();
if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
{
((SwParagraphNumTabPage&)rPage).DisableOutline() ;
- }//<-end
+ }
((SwParagraphNumTabPage&)rPage).EnableNewStart();
ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
@@ -267,3 +264,4 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/swbreak.src b/sw/source/ui/chrdlg/swbreak.src
index 2646ed141fec..c75e7d67ddf6 100644
--- a/sw/source/ui/chrdlg/swbreak.src
+++ b/sw/source/ui/chrdlg/swbreak.src
@@ -36,7 +36,6 @@ ModalDialog DLG_BREAK
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 161 , 114 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Umbruch einfügen : Umbruch einf³gen */
Text [ en-US ] = "Insert Break" ;
Moveable = TRUE ;
OKButton BT_OK
@@ -119,7 +118,6 @@ ModalDialog DLG_BREAK
HelpID = "sw:CheckBox:DLG_BREAK:CB_PAGENUM";
Pos = MAP_APPFONT ( 12 , 79 ) ;
Size = MAP_APPFONT ( 84 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Seitennummer ~ändern : Seitennummer ~õndern */
Text [ en-US ] = "Change page ~number" ;
TabStop = TRUE ;
};
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 01aa945712cd..b37bd7b49382 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,17 +33,13 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
#include "cmdid.h"
-#include <tools/list.hxx>
#include "swmodule.hxx"
#include "view.hxx"
#include "wrtsh.hxx"
#include "globals.hrc"
#include "helpid.h"
-
#include <sfx2/styfitem.hxx>
#include "uitool.hxx"
@@ -59,22 +56,17 @@
#include "swuiccoll.hxx"
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
FN_COND_COLL, FN_COND_COLL,
0
};
-// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
+// Warning! This table is indicated directly in code (0, 1, ...)
static long nTabs[] =
{ 2, // Number of Tabs
0, 100
};
-/****************************************************************************
-Page: Ctor
-****************************************************************************/
-
-
SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
: SfxTabPage(pParent, SW_RES(TP_CONDCOLL), rSet),
@@ -103,7 +95,7 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
aAssignPB.SetAccessibleRelationMemberOf(&aConditionFL);
aTbLinks.SetAccessibleRelationLabeledBy(&aConditionCB);
- // Handler installieren
+ // Install handlers
aConditionCB.SetClickHdl( LINK(this, SwCondCollPage, OnOffHdl));
aTbLinks.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl ));
aStyleLB.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl ));
@@ -116,26 +108,25 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
aTbLinks.SetStyle(aTbLinks.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
aTbLinks.SetSelectionMode( SINGLE_SELECTION );
aTbLinks.SetTabs( &nTabs[0], MAP_APPFONT );
- aTbLinks.Resize(); // OS: Hack fuer richtige Selektion
+ aTbLinks.Resize(); // OS: Hack for the right selection
aTbLinks.SetSpaceBetweenEntries( 0 );
aTbLinks.SetHelpId(HID_COND_COLL_TABLIST);
SfxStyleFamilies aFamilies(SW_RES(DLG_STYLE_DESIGNER));
const SfxStyleFamilyItem* pFamilyItem = 0;
- sal_uInt16 nCount = aFamilies.Count();
- sal_uInt16 i;
- for( i = 0; i < nCount; ++i)
+ size_t nCount = aFamilies.size();
+ for( size_t i = 0; i < nCount; ++i )
{
- if(SFX_STYLE_FAMILY_PARA == (sal_uInt16)(pFamilyItem = aFamilies.GetObject(i))->GetFamily())
+ if(SFX_STYLE_FAMILY_PARA == (sal_uInt16)(pFamilyItem = aFamilies.at( i ))->GetFamily())
break;
}
const SfxStyleFilter& rFilterList = pFamilyItem->GetFilterList();
- for( i = 0; i < rFilterList.Count(); ++i)
+ for( size_t i = 0; i < rFilterList.size(); ++i )
{
- aFilterLB.InsertEntry(rFilterList.GetObject(i)->aName);
- sal_uInt16* pFilter = new sal_uInt16(rFilterList.GetObject(i)->nFlags);
+ aFilterLB.InsertEntry( rFilterList[ i ]->aName);
+ sal_uInt16* pFilter = new sal_uInt16(rFilterList[i]->nFlags);
aFilterLB.SetEntryData(i, pFilter);
}
aFilterLB.SelectEntryPos(1);
@@ -149,7 +140,7 @@ Page: Dtor
****************************************************************************/
-__EXPORT SwCondCollPage::~SwCondCollPage()
+SwCondCollPage::~SwCondCollPage()
{
for(sal_uInt16 i = 0; i < aFilterLB.GetEntryCount(); ++i)
delete (sal_uInt16*)aFilterLB.GetEntryData(i);
@@ -157,7 +148,7 @@ __EXPORT SwCondCollPage::~SwCondCollPage()
}
-int __EXPORT SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
+int SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
{
if( _pSet )
FillItemSet(*_pSet);
@@ -170,7 +161,7 @@ Page: Factory
****************************************************************************/
-SfxTabPage* __EXPORT SwCondCollPage::Create(Window *pParent, const SfxItemSet &rSet)
+SfxTabPage* SwCondCollPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwCondCollPage(pParent, rSet);
}
@@ -180,7 +171,7 @@ Page: FillItemSet-Overload
****************************************************************************/
-sal_Bool __EXPORT SwCondCollPage::FillItemSet(SfxItemSet &rSet)
+sal_Bool SwCondCollPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bModified = sal_True;
SwCondCollItem aCondItem;
@@ -198,7 +189,7 @@ Page: Reset-Overload
****************************************************************************/
-void __EXPORT SwCondCollPage::Reset(const SfxItemSet &/*rSet*/)
+void SwCondCollPage::Reset(const SfxItemSet &/*rSet*/)
{
if(bNewTemplate)
aConditionCB.Enable();
@@ -241,22 +232,11 @@ void __EXPORT SwCondCollPage::Reset(const SfxItemSet &/*rSet*/)
}
-/****************************************************************************
-
-****************************************************************************/
-
-
-sal_uInt16* __EXPORT SwCondCollPage::GetRanges()
+sal_uInt16* SwCondCollPage::GetRanges()
{
return aPageRg;
}
-
-/****************************************************************************
-
-****************************************************************************/
-
-
IMPL_LINK( SwCondCollPage, OnOffHdl, CheckBox*, pBox )
{
const sal_Bool bEnable = pBox->IsChecked();
@@ -273,11 +253,6 @@ IMPL_LINK( SwCondCollPage, OnOffHdl, CheckBox*, pBox )
return 0;
}
-/****************************************************************************
-
-****************************************************************************/
-
-
IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn)
{
SvLBoxEntry* pE = aTbLinks.FirstSelected();
@@ -285,7 +260,7 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn)
if( !pE || LISTBOX_ENTRY_NOTFOUND ==
( nPos = aTbLinks.GetModel()->GetAbsPos( pE ) ) )
{
- ASSERT( pE, "wo kommt der leere Eintrag her?" );
+ OSL_ENSURE( pE, "where's the empty entry from?" );
return 0;
}
@@ -307,11 +282,6 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn)
return 0;
}
-/****************************************************************************
-
-****************************************************************************/
-
-
IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox)
{
if(pBox == &aFilterLB)
@@ -322,6 +292,7 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox)
SfxStyleSheetBasePool* pPool = rSh.GetView().GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, nSearchFlags);
const SfxStyleSheetBase* pBase = pPool->First();
+
while( pBase )
{
if(!pFmt || pBase->GetName() != pFmt->GetName())
@@ -349,13 +320,10 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox)
return 0;
}
-/****************************************************************************
-
-****************************************************************************/
-
-
void SwCondCollPage::SetCollection( SwFmt* pFormat, sal_Bool bNew )
{
pFmt = pFormat;
bNewTemplate = bNew;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx
index 263cb9703ef5..f433d2d3d104 100644
--- a/sw/source/ui/chrdlg/tblnumfm.cxx
+++ b/sw/source/ui/chrdlg/tblnumfm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,19 +33,12 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
-
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <svx/numinf.hxx>
#include <swtypes.hxx>
#include <tblnumfm.hxx>
-#ifndef _CHRDLG_HRC
#include <chrdlg.hrc>
-#endif
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
@@ -54,10 +48,11 @@
SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialog( pParent, rSet, 0 )
{
- // TabPage erzeugen
+ // Create TabPage
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
+
if ( fnCreatePage )
{
SfxTabPage* pNewPage = (*fnCreatePage)( this, rSet );
@@ -68,9 +63,9 @@ SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet)
}
}
-
SwNumFmtDlg::~SwNumFmtDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx
index a271d50fd6dd..9fcc614f6de8 100644
--- a/sw/source/ui/config/barcfg.cxx
+++ b/sw/source/ui/config/barcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <wrtsh.hxx>
@@ -47,9 +48,6 @@ using namespace com::sun::star::uno;
#define SEL_TYPE_BEZIER 3
#define SEL_TYPE_GRAPHIC 4
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) :
ConfigItem(bWeb ? C2U("Office.WriterWeb/ObjectBar") : C2U("Office.Writer/ObjectBar"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE)
@@ -60,7 +58,7 @@ SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) :
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -74,15 +72,11 @@ SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) :
}
}
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwToolbarConfigItem::~SwToolbarConfigItem()
{
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
sal_Int32 lcl_getArrayIndex(int nSelType)
{
sal_Int32 nRet = -1;
@@ -101,9 +95,7 @@ sal_Int32 lcl_getArrayIndex(int nSelType)
nRet = SEL_TYPE_GRAPHIC;
return nRet;
}
-/* -----------------------------10.10.00 14:38--------------------------------
- ---------------------------------------------------------------------------*/
void SwToolbarConfigItem::SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId )
{
sal_Int32 nProp = lcl_getArrayIndex(nSelType);
@@ -113,9 +105,7 @@ void SwToolbarConfigItem::SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId )
SetModified();
}
}
-/* -----------------------------10.10.00 13:33--------------------------------
- ---------------------------------------------------------------------------*/
Sequence<OUString> SwToolbarConfigItem::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -133,9 +123,7 @@ Sequence<OUString> SwToolbarConfigItem::GetPropertyNames()
pNames[i] = OUString::createFromAscii(aPropNames[i]);
return aNames;
}
-/* -----------------------------10.10.00 13:36--------------------------------
- ---------------------------------------------------------------------------*/
void SwToolbarConfigItem::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -150,3 +138,4 @@ void SwToolbarConfigItem::Commit()
void SwToolbarConfigItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/caption.cxx b/sw/source/ui/config/caption.cxx
index 25a3c85e1ee4..405a97694250 100644
--- a/sw/source/ui/config/caption.cxx
+++ b/sw/source/ui/config/caption.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include "numrule.hxx"
#include "caption.hxx"
@@ -37,15 +38,11 @@
#define VERSION_01 1
#define CAPTION_VERSION VERSION_01
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleId) :
bUseCaption(sal_False),
eObjType(eType),
nNumType(SVX_NUM_ARABIC),
- sNumberSeparator( ::rtl::OUString::createFromAscii(". ") ),
+ sNumberSeparator(RTL_CONSTASCII_USTRINGPARAM((". "))),
nPos(1),
nLevel(0),
sSeparator( String::CreateFromAscii( ": " ) ),
@@ -56,27 +53,15 @@ InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleI
aOleId = *pOleId;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
InsCaptionOpt::InsCaptionOpt(const InsCaptionOpt& rOpt)
{
*this = rOpt;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
InsCaptionOpt::~InsCaptionOpt()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
InsCaptionOpt& InsCaptionOpt::operator=( const InsCaptionOpt& rOpt )
{
bUseCaption = rOpt.bUseCaption;
@@ -96,87 +81,14 @@ InsCaptionOpt& InsCaptionOpt::operator=( const InsCaptionOpt& rOpt )
return *this;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool InsCaptionOpt::operator==( const InsCaptionOpt& rOpt ) const
{
return (eObjType == rOpt.eObjType &&
- aOleId == rOpt.aOleId); // Damit gleiche Ole-IDs nicht mehrfach eingefuegt
- // werden koennen, auf nichts weiteres vergleichen
-
-
-/* &&
- sCategory == rOpt.sCategory &&
- nNumType == rOpt.nNumType &&
- sCaption == rOpt.sCaption &&
- nPos == rOpt.nPos &&
- nLevel == rOpt.nLevel &&
- cSeparator == rOpt.cSeparator);*/
-}
-
-/*************************************************************************
-|*
-|* InsCaptionOpt::operator>>()
-|*
-|* Beschreibung Stream-Leseoperator
-|*
-*************************************************************************/
-
-/*SvStream& operator>>( SvStream& rIStream, InsCaptionOpt& rCapOpt )
-{
- rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding();
- sal_uInt16 nVal;
- sal_uInt8 cVal;
- sal_uInt8 nVersion;
-
- rIStream >> nVersion;
- rIStream >> cVal; rCapOpt.UseCaption() = cVal != 0;
- rIStream >> nVal; rCapOpt.eObjType = (SwCapObjType)nVal;
- rIStream >> rCapOpt.aOleId;
-
- rIStream.ReadByteString( rCapOpt.sCategory, eEncoding );
- rIStream >> nVal; rCapOpt.nNumType = nVal;
- rIStream.ReadByteString( rCapOpt.sCaption, eEncoding );
- rIStream >> nVal; rCapOpt.nPos = nVal;
- rIStream >> nVal; rCapOpt.nLevel = nVal;
+ aOleId == rOpt.aOleId); // So that identical Ole-IDs can't be added multiple
+ // times, don't compare against anything else.
- rIStream >> cVal;
- rCapOpt.sSeparator = UniString(
- ByteString(static_cast< char >(cVal)) , eEncoding).GetChar(0);
- return rIStream;
}
-*/
-/*************************************************************************
-|*
-|* InsCaptionOpt::operator<<()
-|*
-|* Beschreibung Stream-Schreiboperator
-|*
-*************************************************************************/
-
-/*SvStream& operator<<( SvStream& rOStream, const InsCaptionOpt& rCapOpt )
-{
- rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding();
- rOStream << (sal_uInt8)CAPTION_VERSION
- << (sal_uInt8)rCapOpt.UseCaption()
- << (sal_uInt16)rCapOpt.eObjType
- << rCapOpt.aOleId;
- rOStream.WriteByteString( rCapOpt.sCategory, eEncoding );
-
- rOStream << (sal_uInt16)rCapOpt.nNumType;
-
- rOStream.WriteByteString( rCapOpt.sCaption, eEncoding );
-
- sal_uInt8 cSep = ByteString(rCapOpt.sSeparator, eEncoding).GetChar(0);
- rOStream << (sal_uInt16)rCapOpt.nPos
- << (sal_uInt16)rCapOpt.nLevel
- << cSep;
-
- return rOStream;
-}
-*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx
index 8197190b6c83..aae530ad1f73 100644
--- a/sw/source/ui/config/cfgitems.cxx
+++ b/sw/source/ui/config/cfgitems.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,9 @@
#include "precompiled_sw.hxx"
-#ifndef __SBX_SBXVARIABLE_HXX //autogen
#include <basic/sbxvar.hxx>
-#endif
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <editeng/svxenum.hxx>
@@ -46,14 +43,11 @@
#include "cfgitems.hxx"
#include "crstate.hxx"
-
-
TYPEINIT1_AUTOFACTORY(SwDocDisplayItem, SfxPoolItem)
TYPEINIT1_AUTOFACTORY(SwElemItem, SfxPoolItem)
TYPEINIT1_AUTOFACTORY(SwAddPrinterItem, SfxPoolItem)
TYPEINIT1_AUTOFACTORY(SwShadowCursorItem, SfxPoolItem)
-
SwDocDisplayItem::SwDocDisplayItem( sal_uInt16 _nWhich ) :
SfxPoolItem(_nWhich),
aIndexBackgrndCol(COL_GRAY)
@@ -70,20 +64,15 @@ SwDocDisplayItem::SwDocDisplayItem( sal_uInt16 _nWhich ) :
};
-/*------------OS 12.01.95 -------------------------------------------
- Item fuer Einstellungsdialog, Seite Dokumentansicht
+/*-------------------------------------------------------------------
+ Item for the Settings dialog, page document view
--------------------------------------------------------------------*/
-
SwDocDisplayItem::SwDocDisplayItem( const SwDocDisplayItem& rDocDisplayItem ):
SfxPoolItem(rDocDisplayItem)
{
*this = rDocDisplayItem;
};
-/*----------------------- -------------------------------------------
-
---------------------------------------------------------------------*/
-
SwDocDisplayItem::SwDocDisplayItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich )
{
@@ -96,24 +85,16 @@ SwDocDisplayItem::SwDocDisplayItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich
bFldHiddenText = rVOpt.IsShowHiddenField();
bManualBreak = rVOpt.IsLineBreak(sal_True);
bShowHiddenPara = rVOpt.IsShowHiddenPara();
-
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SfxPoolItem* SwDocDisplayItem::Clone( SfxItemPool* ) const
{
return new SwDocDisplayItem( *this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
int SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
const SwDocDisplayItem& rItem = (SwDocDisplayItem&)rAttr;
@@ -128,12 +109,6 @@ int SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const
bShowHiddenPara == rItem.bShowHiddenPara );
}
-
-/*-----------------31.08.96 14.14-------------------
-
---------------------------------------------------*/
-
-
void SwDocDisplayItem::operator=( const SwDocDisplayItem& rDocDisplayItem)
{
bParagraphEnd = rDocDisplayItem.bParagraphEnd ;
@@ -147,9 +122,6 @@ void SwDocDisplayItem::operator=( const SwDocDisplayItem& rDocDisplayItem)
bShowHiddenPara = rDocDisplayItem.bShowHiddenPara ;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDocDisplayItem::FillViewOptions( SwViewOption& rVOpt) const
{
rVOpt.SetParagraph (bParagraphEnd );
@@ -163,10 +135,6 @@ void SwDocDisplayItem::FillViewOptions( SwViewOption& rVOpt) const
rVOpt.SetShowHiddenPara(bShowHiddenPara );
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwElemItem::SwElemItem( sal_uInt16 _nWhich ) :
SfxPoolItem(_nWhich)
{
@@ -186,18 +154,12 @@ SwElemItem::SwElemItem( sal_uInt16 _nWhich ) :
bFieldName =
bNotes = sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwElemItem::SwElemItem( const SwElemItem& rElemItem ):
SfxPoolItem(rElemItem)
{
*this = rElemItem;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwElemItem::SwElemItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich) :
SfxPoolItem( _nWhich )
@@ -220,22 +182,14 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich) :
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxPoolItem* SwElemItem::Clone( SfxItemPool* ) const
{
return new SwElemItem( *this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
int SwElemItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
const SwElemItem& rItem = (SwElemItem&)rAttr;
@@ -256,11 +210,6 @@ int SwElemItem::operator==( const SfxPoolItem& rAttr ) const
bNotes == rItem.bNotes );
}
-/*-----------------31.08.96 14.13-------------------
-
---------------------------------------------------*/
-
-
void SwElemItem::operator=( const SwElemItem& rElemItem)
{
bHorzScrollbar = rElemItem. bHorzScrollbar ;
@@ -280,10 +229,6 @@ void SwElemItem::operator=( const SwElemItem& rElemItem)
bNotes = rElemItem.bNotes ;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const
{
rVOpt.SetViewHScrollBar(bHorzScrollbar );
@@ -304,11 +249,9 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const
rVOpt.SetPostIts (bNotes );
}
-
/*--------------------------------------------------------------------
- Beschreibung: CopyCTOR
+ Description: CopyCTOR
--------------------------------------------------------------------*/
-
SwAddPrinterItem::SwAddPrinterItem( const SwAddPrinterItem& rAddPrinterItem ):
SfxPoolItem(rAddPrinterItem),
SwPrintData( rAddPrinterItem )
@@ -316,47 +259,39 @@ SwAddPrinterItem::SwAddPrinterItem( const SwAddPrinterItem& rAddPrinterItem ):
}
/*--------------------------------------------------------------------
- Beschreibung: CTOR fuer leeres Item
+ Description: CTOR for empty Item
--------------------------------------------------------------------*/
-
SwAddPrinterItem::SwAddPrinterItem( sal_uInt16 _nWhich):
SfxPoolItem(_nWhich)
{
}
+
/*--------------------------------------------------------------------
- Beschreibung: CTOR aus SwPrintOptions
+ Description: CTOR from SwPrintOptions
--------------------------------------------------------------------*/
-
SwAddPrinterItem::SwAddPrinterItem( sal_uInt16 _nWhich, const SwPrintData& rPrtData ) :
SfxPoolItem(_nWhich)
{
SwPrintData::operator=(rPrtData);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SfxPoolItem* SwAddPrinterItem::Clone( SfxItemPool* ) const
{
return new SwAddPrinterItem( *this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
int SwAddPrinterItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
const SwAddPrinterItem& rItem = (SwAddPrinterItem&)rAttr;
return SwPrintData::operator==(rItem);
}
-/*-----------------03.11.97 10:00-------------------
- Item fuer Einstellungsdialog, ShadowCursorSeite
---------------------------------------------------*/
+/*--------------------------------------------------
+ Item for Settings dialog, ShadowCursorPage
+--------------------------------------------------*/
SwShadowCursorItem::SwShadowCursorItem( sal_uInt16 _nWhich )
: SfxPoolItem( _nWhich ),
eMode( FILL_TAB )
@@ -404,11 +339,7 @@ void SwShadowCursorItem::FillViewOptions( SwViewOption& rVOpt ) const
rVOpt.SetShdwCrsrFillMode( eMode );
}
-#ifdef DBG_UTIL
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
+#if OSL_DEBUG_LEVEL > 1
SwTestItem::SwTestItem( const SwTestItem& rTestItem ):
SfxPoolItem(rTestItem)
{
@@ -424,22 +355,14 @@ SwTestItem::SwTestItem( const SwTestItem& rTestItem ):
bTest10=rTestItem.bTest10;
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxPoolItem* SwTestItem::Clone( SfxItemPool* ) const
{
return new SwTestItem( *this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
int SwTestItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
const SwTestItem& rItem = (const SwTestItem&) rAttr;
@@ -458,3 +381,5 @@ int SwTestItem::operator==( const SfxPoolItem& rAttr ) const
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/config.hrc b/sw/source/ui/config/config.hrc
index 197e6482d7a1..33209779ed0c 100644
--- a/sw/source/ui/config/config.hrc
+++ b/sw/source/ui/config/config.hrc
@@ -29,9 +29,9 @@
#include "rcid.hrc"
-// Dialoge fuer die Konfiguration
+// dialogs for configuration
-// Strings fuer die Konfiguration
+// strings for configuration
#define STR_CFG_SIGNATUR (RC_CONFIG_BEGIN + 0)
#define DLG_CONFIG_VIEW (RC_CONFIG_BEGIN + 1)
#define DLG_CONFIG_MISC (RC_CONFIG_BEGIN + 2)
diff --git a/sw/source/ui/config/dbconfig.cxx b/sw/source/ui/config/dbconfig.cxx
index ade5163a5921..97761f63cd46 100644
--- a/sw/source/ui/config/dbconfig.cxx
+++ b/sw/source/ui/config/dbconfig.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <dbconfig.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <swdbdata.hxx>
@@ -42,7 +43,7 @@ using rtl::OUString;
using namespace com::sun::star::uno;
/*--------------------------------------------------------------------
- Beschreibung: Ctor
+ Description: Ctor
--------------------------------------------------------------------*/
const Sequence<OUString>& SwDBConfig::GetPropertyNames()
@@ -67,9 +68,7 @@ const Sequence<OUString>& SwDBConfig::GetPropertyNames()
}
return aNames;
}
-/* -----------------------------06.09.00 16:44--------------------------------
- ---------------------------------------------------------------------------*/
SwDBConfig::SwDBConfig() :
ConfigItem(C2U("Office.DataAccess"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -77,17 +76,13 @@ SwDBConfig::SwDBConfig() :
pBibImpl(0)
{
};
-/* -----------------------------06.09.00 16:50--------------------------------
- ---------------------------------------------------------------------------*/
SwDBConfig::~SwDBConfig()
{
delete pAdrImpl;
delete pBibImpl;
}
-/* -----------------------------20.02.01 12:32--------------------------------
- ---------------------------------------------------------------------------*/
void SwDBConfig::Load()
{
const Sequence<OUString>& rNames = GetPropertyNames();
@@ -101,7 +96,7 @@ void SwDBConfig::Load()
}
Sequence<Any> aValues = GetProperties(rNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed");
if(aValues.getLength() == rNames.getLength())
{
for(int nProp = 0; nProp < rNames.getLength(); nProp++)
@@ -118,18 +113,14 @@ void SwDBConfig::Load()
}
}
}
-/* -----------------------------20.02.01 12:36--------------------------------
- ---------------------------------------------------------------------------*/
const SwDBData& SwDBConfig::GetAddressSource()
{
if(!pAdrImpl)
Load();
return *pAdrImpl;
}
-/* -----------------29.11.2002 11:43-----------------
- *
- * --------------------------------------------------*/
+
const SwDBData& SwDBConfig::GetBibliographySource()
{
if(!pBibImpl)
@@ -141,3 +132,4 @@ void SwDBConfig::Commit() {}
void SwDBConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx
index 140b8da8c42c..efc3c670fb15 100644
--- a/sw/source/ui/config/fontcfg.cxx
+++ b/sw/source/ui/config/fontcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <fontcfg.hxx>
#include <i18npool/mslangid.hxx>
#include <vcl/outdev.hxx>
@@ -44,18 +44,13 @@ using namespace utl;
using rtl::OUString;
using namespace com::sun::star::uno;
-/* -----------------07.10.2002 12:15-----------------
- *
- * --------------------------------------------------*/
inline LanguageType lcl_LanguageOfType(sal_Int16 nType, sal_Int16 eWestern, sal_Int16 eCJK, sal_Int16 eCTL)
{
return LanguageType(
nType < FONT_STANDARD_CJK ? eWestern :
nType >= FONT_STANDARD_CTL ? eCTL : eCJK);
}
-/* -----------------------------08.09.00 15:52--------------------------------
- ---------------------------------------------------------------------------*/
Sequence<OUString> SwStdFontConfig::GetPropertyNames()
{
Sequence<OUString> aNames;
@@ -104,9 +99,6 @@ Sequence<OUString> SwStdFontConfig::GetPropertyNames()
}
return aNames;
}
-/*-----------------03.09.96 15.00-------------------
-
---------------------------------------------------*/
SwStdFontConfig::SwStdFontConfig() :
utl::ConfigItem(C2U("Office.Writer"))
@@ -129,7 +121,7 @@ SwStdFontConfig::SwStdFontConfig() :
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -151,9 +143,7 @@ SwStdFontConfig::SwStdFontConfig() :
}
}
}
-/* -----------------------------08.09.00 15:58--------------------------------
- ---------------------------------------------------------------------------*/
void SwStdFontConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -184,14 +174,11 @@ void SwStdFontConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/* -----------------------------08.09.00 15:56--------------------------------
- ---------------------------------------------------------------------------*/
SwStdFontConfig::~SwStdFontConfig()
-{}
-/*-----------------18.01.97 10.05-------------------
+{
+}
---------------------------------------------------*/
sal_Bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const
{
sal_Bool bSame = sal_False;
@@ -250,9 +237,6 @@ sal_Bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const
return bSame;
}
-/* -----------------11.01.99 13:16-------------------
- * Standards auslesen
- * --------------------------------------------------*/
String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
{
String sRet;
@@ -280,10 +264,6 @@ String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
case FONT_INDEX_CTL :
nFontId = DEFAULTFONT_CTL_TEXT;
break;
-// case FONT_STANDARD:
-// case FONT_LIST :
-// case FONT_CAPTION :
-// case FONT_INDEX :
default:
nFontId = DEFAULTFONT_LATIN_TEXT;
}
@@ -291,9 +271,6 @@ String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
return aFont.GetName();
}
-/*-- 11.10.2005 10:43:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang)
{
sal_Int32 nRet = FONTSIZE_DEFAULT;
@@ -303,7 +280,10 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp
case FONT_OUTLINE_CJK:
case FONT_OUTLINE_CTL:
nRet = FONTSIZE_OUTLINE;
- break;
+ break;
+ case FONT_STANDARD_CJK:
+ nRet = FONTSIZE_CJK_DEFAULT;
+ break;
}
if( eLang == LANGUAGE_THAI && nFontType >= FONT_STANDARD_CTL )
{
@@ -312,12 +292,9 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp
return nRet;
}
-/*-- 11.10.2005 10:50:06---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight )
{
- DBG_ASSERT( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()");
+ OSL_ENSURE( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()");
if( nFontType < DEF_FONT_COUNT && nDefaultFontHeight[nFontType] != nHeight)
{
SvtLinguOptions aLinguOpt;
@@ -343,12 +320,9 @@ void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight )
}
}
-/*-- 08.11.2005 14:18:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang )
{
- DBG_ASSERT(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()");
+ OSL_ENSURE(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()");
sal_Int32 nRet = nDefaultFontHeight[nFont + FONT_PER_GROUP * nScriptType];
if(nRet <= 0)
return GetDefaultHeightFor(nFont + FONT_PER_GROUP * nScriptType, eLang);
@@ -357,3 +331,4 @@ sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType
void SwStdFontConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index b8a34bad578b..60206c39bb4c 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <svtools/headbar.hxx>
#include <mmconfigitem.hxx>
#include <mailmergehelper.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
#include "com/sun/star/mail/MailServiceType.hpp"
@@ -59,9 +58,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::mail;
using namespace ::com::sun::star::beans;
using ::rtl::OUString;
-/*-- 06.05.2004 12:04:11---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwTestAccountSettingsDialog : public SfxModalDialog
{
FixedInfo m_aInfoFI;
@@ -99,9 +96,7 @@ public:
SwTestAccountSettingsDialog(SwMailConfigPage* pParent);
~SwTestAccountSettingsDialog();
};
-/*-- 19.08.2004 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwAuthenticationSettingsDialog : public SfxModalDialog
{
CheckBox m_aAuthenticationCB;
@@ -146,9 +141,6 @@ public:
~SwAuthenticationSettingsDialog();
};
-/*-- 06.05.2004 10:59:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailConfigPage::SwMailConfigPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage(pParent, SW_RES(TP_MAILCONFIG), rSet),
#ifdef MSC
@@ -181,23 +173,17 @@ SwMailConfigPage::SwMailConfigPage( Window* pParent, const SfxItemSet& rSet ) :
m_aServerAuthenticationPB.SetClickHdl(LINK(this, SwMailConfigPage, AuthenticationHdl));
m_aTestPB.SetClickHdl(LINK(this, SwMailConfigPage, TestHdl));
}
-/*-- 06.05.2004 10:59:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailConfigPage::~SwMailConfigPage()
{
delete m_pConfigItem;
}
-/*-- 06.05.2004 10:59:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwMailConfigPage::Create( Window* pParent, const SfxItemSet& rAttrSet)
{
return new SwMailConfigPage(pParent, rAttrSet);
}
-/*-- 06.05.2004 10:59:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailConfigPage::FillItemSet( SfxItemSet& /*rSet*/ )
{
if(m_aDisplayNameED.GetText() != m_aDisplayNameED.GetSavedValue())
@@ -220,9 +206,7 @@ sal_Bool SwMailConfigPage::FillItemSet( SfxItemSet& /*rSet*/ )
m_pConfigItem->Commit();
return sal_True;
}
-/*-- 06.05.2004 10:59:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailConfigPage::Reset( const SfxItemSet& /*rSet*/ )
{
m_aDisplayNameED.SetText(m_pConfigItem->GetMailDisplayName());
@@ -245,9 +229,7 @@ void SwMailConfigPage::Reset( const SfxItemSet& /*rSet*/ )
m_aPortNF .SaveValue();
m_aSecureCB .SaveValue();
}
-/*-- 06.05.2004 10:59:41---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox)
{
sal_Bool bEnable = pBox->IsChecked();
@@ -255,26 +237,20 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox)
m_aReplyToED.Enable(bEnable);
return 0;
}
-/*-- 06.05.2004 10:59:41---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailConfigPage, AuthenticationHdl, PushButton*, EMPTYARG)
{
SwAuthenticationSettingsDialog aDlg(this, *m_pConfigItem);
aDlg.Execute();
return 0;
}
-/*-- 06.05.2004 10:59:42---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailConfigPage, TestHdl, PushButton*, EMPTYARG)
{
SwTestAccountSettingsDialog(this).Execute();
return 0;
}
-/*-- 06.05.2004 12:11:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent) :
SfxModalDialog(pParent, SW_RES(DLG_MM_TESTACCOUNTSETTINGS)),
#ifdef MSC
@@ -292,7 +268,7 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare
#ifdef MSC
#pragma warning (default : 4355)
#endif
- m_aImageList( SW_RES( GetSettings().GetStyleSettings().GetHighContrastMode() ? ILIST_HC : ILIST) ),
+ m_aImageList( SW_RES(ILIST) ),
m_sTask( SW_RES( ST_TASK )),
m_sStatus( SW_RES( ST_STATUS )),
m_sEstablish( SW_RES( ST_ESTABLISH )),
@@ -338,23 +314,17 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare
Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this );
}
-/*-- 06.05.2004 12:11:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTestAccountSettingsDialog::~SwTestAccountSettingsDialog()
{
}
-/*-- 06.05.2004 12:15:43---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwTestAccountSettingsDialog, StopHdl, PushButton*, EMPTYARG)
{
m_bStop = true;
return 0;
}
-/*-- 07.06.2004 12:44:50---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*, EMPTYARG)
{
pThis->EnterWait();
@@ -362,9 +332,7 @@ IMPL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*, EMPTYARG)
pThis->LeaveWait();
return 0;
}
-/*-- 07.06.2004 12:45:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTestAccountSettingsDialog::Test()
{
uno::Reference<XMultiServiceFactory> rMgr = ::comphelper::getProcessServiceFactory();
@@ -406,7 +374,7 @@ void SwTestAccountSettingsDialog::Test()
new SwConnectionContext(
m_pParent->m_pConfigItem->GetInServerName(),
m_pParent->m_pConfigItem->GetInServerPort(),
- ::rtl::OUString::createFromAscii( "Insecure" ));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure")));
xInMailService->connect(xConnectionContext, xAuthenticator);
}
if(m_bStop)
@@ -436,8 +404,7 @@ void SwTestAccountSettingsDialog::Test()
new SwConnectionContext(
m_pParent->m_aServerED.GetText(),
sal::static_int_cast< sal_Int16, sal_Int64 >(m_pParent->m_aPortNF.GetValue()),
- ::rtl::OUString::createFromAscii(
- m_pParent->m_aSecureCB.IsChecked() ? "Ssl" : "Insecure"));
+ m_pParent->m_aSecureCB.IsChecked() ? OUString(RTL_CONSTASCII_USTRINGPARAM("Ssl")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure")));
xMailService->connect(xConnectionContext, xAuthenticator);
bIsLoggedIn = xMailService->isConnected();
if( xInMailService.is() )
@@ -447,7 +414,7 @@ void SwTestAccountSettingsDialog::Test()
}
catch(uno::Exception&)
{
- DBG_ERROR("exception caught");
+ OSL_FAIL("exception caught");
}
}
@@ -473,24 +440,18 @@ void SwTestAccountSettingsDialog::Test()
m_eErrorsED.SetText( m_sErrorServer );
}
}
-/*-- 18.08.2004 12:18:38---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailConfigDlg::SwMailConfigDlg(Window* pParent, SfxItemSet& rSet ) :
SfxSingleTabDialog(pParent, rSet, 0)
{
- // TabPage erzeugen
+ // create TabPage
SetTabPage(SwMailConfigPage::Create( this, rSet ));
}
-/*-- 18.08.2004 12:18:38---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailConfigDlg::~SwMailConfigDlg()
{
}
-/*-- 19.08.2004 14:33:58---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(
SwMailConfigPage* pParent, SwMailMergeConfigItem& rItem) :
SfxModalDialog(pParent, SW_RES(DLG_MM_SERVERAUTHENTICATION)),
@@ -553,15 +514,11 @@ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(
CheckBoxHdl_Impl( &m_aAuthenticationCB );
}
-/*-- 19.08.2004 14:33:58---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAuthenticationSettingsDialog::~SwAuthenticationSettingsDialog()
{
}
-/*-- 19.08.2004 14:33:59---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwAuthenticationSettingsDialog, OKHdl_Impl, OKButton*, EMPTYARG)
{
rConfigItem.SetAuthentication( m_aAuthenticationCB.IsChecked() );
@@ -577,9 +534,7 @@ IMPL_LINK( SwAuthenticationSettingsDialog, OKHdl_Impl, OKButton*, EMPTYARG)
EndDialog(RET_OK);
return 0;
}
-/*-- 19.08.2004 14:33:59---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwAuthenticationSettingsDialog, CheckBoxHdl_Impl, CheckBox*, pBox)
{
sal_Bool bChecked = pBox->IsChecked();
@@ -589,9 +544,7 @@ IMPL_LINK( SwAuthenticationSettingsDialog, CheckBoxHdl_Impl, CheckBox*, pBox)
return 0;
}
-/*-- 19.08.2004 14:33:59---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, RadioButton*, EMPTYARG)
{
sal_Bool bSeparate = m_aSeparateAuthenticationRB.IsChecked();
@@ -620,3 +573,5 @@ IMPL_LINK( SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, RadioButton*, EM
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/mailconfigpage.hrc b/sw/source/ui/config/mailconfigpage.hrc
index a7115878ccf5..7ff97978f968 100644
--- a/sw/source/ui/config/mailconfigpage.hrc
+++ b/sw/source/ui/config/mailconfigpage.hrc
@@ -61,7 +61,6 @@
#define ST_FAILED 44
#define ST_ERROR_SERVER 46
#define ILIST 47
-#define ILIST_HC 48
#define CB_AUTHENTICATION 50
#define RB_SEP_AUTHENTICATION 51
diff --git a/sw/source/ui/config/mailconfigpage.src b/sw/source/ui/config/mailconfigpage.src
index 726754fa694e..523f25e8e5f9 100644
--- a/sw/source/ui/config/mailconfigpage.src
+++ b/sw/source/ui/config/mailconfigpage.src
@@ -230,13 +230,6 @@ ModalDialog DLG_MM_TESTACCOUNTSETTINGS
MaskColor = IMAGE_MASK_COLOR;
IMGLIST_IDS;
};
-
- ImageList ILIST_HC
- {
- Prefix = "sch";
- MaskColor = IMAGE_MASK_COLOR ;
- IMGLIST_IDS;
- };
String ST_TASK
{
Text[ en-US ] = "Task";
diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx
index 69414515a404..737d22d16660 100644
--- a/sw/source/ui/config/modcfg.cxx
+++ b/sw/source/ui/config/modcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,18 +35,14 @@
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
#include <svl/mailenum.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <editeng/svxenum.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <tools/globname.hxx>
#include <swtypes.hxx>
#include <itabenum.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
#include <fldupde.hxx>
#include <unotools/syslocaleoptions.hxx>
#include <caption.hxx>
@@ -64,9 +61,7 @@ using namespace com::sun::star::uno;
#define GLOB_NAME_CHART 4
SV_IMPL_PTRARR_SORT(InsCapOptArr, InsCaptionOptPtr)
-/* -----------------03.11.98 13:46-------------------
- *
- * --------------------------------------------------*/
+
InsCaptionOpt* InsCaptionOptArr::Find(const SwCapObjType eType, const SvGlobalName *pOleId) const
{
for (sal_uInt16 i = 0; i < Count(); i++ )
@@ -82,16 +77,12 @@ InsCaptionOpt* InsCaptionOptArr::Find(const SwCapObjType eType, const SvGlobalNa
return 0;
}
-/* -----------------03.11.98 15:05-------------------
- *
- * --------------------------------------------------*/
-
const InsCaptionOpt* SwModuleOptions::GetCapOption(
sal_Bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId)
{
if(bHTML)
{
- DBG_ERROR("no caption option in sw/web!");
+ OSL_FAIL("no caption option in sw/web!");
return 0;
}
else
@@ -108,17 +99,13 @@ const InsCaptionOpt* SwModuleOptions::GetCapOption(
}
}
-/* -----------------03.11.98 15:05-------------------
- *
- * --------------------------------------------------*/
-
sal_Bool SwModuleOptions::SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt)
{
sal_Bool bRet = sal_False;
if(bHTML)
{
- DBG_ERROR("no caption option in sw/web!");
+ OSL_FAIL("no caption option in sw/web!");
}
else if (pOpt)
{
@@ -152,9 +139,7 @@ sal_Bool SwModuleOptions::SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt
return bRet;
}
-/*-----------------13.01.97 12.44-------------------
---------------------------------------------------*/
SwModuleOptions::SwModuleOptions() :
aInsertConfig(sal_False),
aWebInsertConfig(sal_True),
@@ -163,9 +148,7 @@ SwModuleOptions::SwModuleOptions() :
bHideFieldTips(sal_False)
{
}
-/* -----------------------------19.01.01 12:26--------------------------------
- ---------------------------------------------------------------------------*/
String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFromUI)
{
String sReturn;
@@ -205,7 +188,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro
nVal -= 'a' - 10;
else
{
- DBG_ERROR( "ungueltiger Hex-Wert" );
+ OSL_FAIL("wrong hex value" );
bValidData = sal_False;
break;
}
@@ -218,7 +201,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro
break;
}
- default: // Unbekannt, daher nur Backslash einfuegen
+ default: // Unknown, so insert backslash
sReturn += '\\';
i--;
break;
@@ -253,9 +236,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro
}
return sReturn;
}
-/* -----------------------------10.10.00 16:22--------------------------------
- ---------------------------------------------------------------------------*/
const Sequence<OUString>& SwRevisionConfig::GetPropertyNames()
{
static Sequence<OUString> aNames;
@@ -280,9 +261,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames()
}
return aNames;
}
-/*-- 10.10.00 16:22:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwRevisionConfig::SwRevisionConfig() :
ConfigItem(C2U("Office.Writer/Revision"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE)
@@ -299,15 +278,11 @@ SwRevisionConfig::SwRevisionConfig() :
Load();
}
-/*-- 10.10.00 16:22:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwRevisionConfig::~SwRevisionConfig()
{
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr)
{
sal_Int32 nRet = 0;
@@ -332,7 +307,7 @@ sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr)
}
return nRet;
}
-//-----------------------------------------------------------------------------
+
void SwRevisionConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwRevisionConfig::Commit()
@@ -359,9 +334,7 @@ void SwRevisionConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_ConvertCfgToAttr(sal_Int32 nVal, AuthorCharAttr& rAttr, sal_Bool bDelete = sal_False)
{
rAttr.nItemId = rAttr.nAttr = 0;
@@ -393,7 +366,7 @@ void SwRevisionConfig::Load()
const Sequence<OUString>& aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -417,9 +390,7 @@ void SwRevisionConfig::Load()
}
}
}
-/* -----------------------------10.10.00 16:22--------------------------------
- ---------------------------------------------------------------------------*/
enum InsertConfigProp
{
INS_PROP_TABLE_HEADER = 0,
@@ -628,15 +599,13 @@ const Sequence<OUString>& SwInsertConfig::GetPropertyNames()
OUString* pWebNames = aWebNames.getArray();
int i;
for(i = 0; i < nCount; i++)
- pNames[i] = C2U(aPropNames[i]);
+ pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]);
for(i = 0; i < nWebCount; i++)
- pWebNames[i] = C2U(aPropNames[i]);
+ pWebNames[i] = rtl::OUString::createFromAscii(aPropNames[i]);
}
return bIsWeb ? aWebNames : aNames;
}
-/*-- 10.10.00 16:22:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwInsertConfig::SwInsertConfig(sal_Bool bWeb) :
ConfigItem(bWeb ? C2U("Office.WriterWeb/Insert") : C2U("Office.Writer/Insert"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -657,17 +626,13 @@ SwInsertConfig::SwInsertConfig(sal_Bool bWeb) :
Load();
}
-/*-- 10.10.00 16:22:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwInsertConfig::~SwInsertConfig()
{
delete pCapOptions;
delete pOLEMiscOpt;
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_Int32 nOffset)
{
switch(nOffset)
@@ -689,7 +654,7 @@ void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_
case 9: pValues[nProp] <<= rOpt.CopyAttributes(); break; //ApplyAttributes
}
}
-//-----------------------------------------------------------------------------
+
void SwInsertConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwInsertConfig::Commit()
@@ -867,9 +832,7 @@ void SwInsertConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp, sal_Int32 nOffset)
{
switch(nOffset)
@@ -936,13 +899,13 @@ void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp, sal_I
break;
}
}
-//-----------------------------------------------------------------------------
+
void SwInsertConfig::Load()
{
const Sequence<OUString>& aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
InsCaptionOpt* pWriterTableOpt = 0;
@@ -1167,9 +1130,7 @@ void SwInsertConfig::Load()
aInsTblOpts.mnInsMode = nInsTblFlags;
}
}
-/* -----------------------------10.10.00 16:22--------------------------------
- ---------------------------------------------------------------------------*/
const Sequence<OUString>& SwTableConfig::GetPropertyNames()
{
const int nCount = 8;
@@ -1190,24 +1151,18 @@ const Sequence<OUString>& SwTableConfig::GetPropertyNames()
pNames[i] = OUString::createFromAscii(aPropNames[i]);
return aNames;
}
-/*-- 10.10.00 16:22:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTableConfig::SwTableConfig(sal_Bool bWeb) :
ConfigItem(bWeb ? C2U("Office.WriterWeb/Table") : C2U("Office.Writer/Table"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE)
{
Load();
}
-/*-- 10.10.00 16:22:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTableConfig::~SwTableConfig()
{
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTableConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwTableConfig::Commit()
@@ -1233,15 +1188,13 @@ void SwTableConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 10.10.00 16:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTableConfig::Load()
{
const Sequence<OUString>& aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -1264,9 +1217,7 @@ void SwTableConfig::Load()
}
}
}
-/*-- 18.01.01 17:02:47---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMiscConfig::SwMiscConfig() :
ConfigItem(C2U("Office.Writer"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -1281,15 +1232,11 @@ SwMiscConfig::SwMiscConfig() :
{
Load();
}
-/*-- 18.01.01 17:02:47---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMiscConfig::~SwMiscConfig()
{
}
-/*-- 18.01.01 17:02:47---------------------------------------------------
- -----------------------------------------------------------------------*/
const Sequence<OUString>& SwMiscConfig::GetPropertyNames()
{
static Sequence<OUString> aNames;
@@ -1314,13 +1261,11 @@ const Sequence<OUString>& SwMiscConfig::GetPropertyNames()
};
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
- pNames[i] = C2U(aPropNames[i]);
+ pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]);
}
return aNames;
}
-/*-- 18.01.01 17:02:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMiscConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwMiscConfig::Commit()
@@ -1353,15 +1298,13 @@ void SwMiscConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 18.01.01 17:02:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMiscConfig::Load()
{
const Sequence<OUString>& aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
OUString sTmp;
@@ -1390,3 +1333,5 @@ void SwMiscConfig::Load()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index e54ef583d50c..9b4de6e12634 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,9 +44,7 @@
#include "optcomp.hrc"
#include "globals.hrc"
#include <tools/urlobj.hxx>
-#ifndef _UTL__HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <vcl/msgbox.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
@@ -182,15 +181,11 @@ SwCompatibilityOptPage::SwCompatibilityOptPage( Window* pParent, const SfxItemSe
m_aOptionsLB.SetSizePixel( aNewSz );
}
-// -----------------------------------------------------------------------
-
SwCompatibilityOptPage::~SwCompatibilityOptPage()
{
delete m_pImpl;
}
-// -----------------------------------------------------------------------
-
void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry )
{
static const String sOpenOfficeName = String::CreateFromAscii("OpenOffice.org");
@@ -216,8 +211,6 @@ void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry )
}
}
-// -----------------------------------------------------------------------
-
sal_uLong convertBools2Ulong_Impl
(
bool _bUsePrtMetrics,
@@ -272,8 +265,6 @@ sal_uLong convertBools2Ulong_Impl
return nRet;
}
-// -----------------------------------------------------------------------
-
void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
{
// init objectshell and detect document name
@@ -406,8 +397,6 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
}
}
-// -----------------------------------------------------------------------
-
IMPL_LINK( SwCompatibilityOptPage, SelectHdl, ListBox*, EMPTYARG )
{
sal_uInt16 nPos = m_aFormattingLB.GetSelectEntryPos();
@@ -417,8 +406,6 @@ IMPL_LINK( SwCompatibilityOptPage, SelectHdl, ListBox*, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
-
IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG )
{
QueryBox aBox( this, WinBits( WB_YES_NO | WB_DEF_YES ), m_sUseAsDefaultQuery );
@@ -449,7 +436,7 @@ IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG )
case COPT_EXPAND_WORDSPACE: pItem->m_bExpandWordSpace = bChecked; break;
default:
{
- DBG_ERRORFILE( "SwCompatibilityOptPage::UseAsDefaultHdl(): wrong option" );
+ OSL_FAIL("SwCompatibilityOptPage::UseAsDefaultHdl(): wrong option" );
}
}
}
@@ -463,12 +450,10 @@ IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG )
return 0;
}
-// -----------------------------------------------------------------------
-
void SwCompatibilityOptPage::SetCurrentOptions( sal_uLong nOptions )
{
sal_uLong nCount = m_aOptionsLB.GetEntryCount();
- DBG_ASSERT( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" );
+ OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" );
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
sal_Bool bChecked = ( ( nOptions & 0x00000001 ) == 0x00000001 );
@@ -477,8 +462,6 @@ void SwCompatibilityOptPage::SetCurrentOptions( sal_uLong nOptions )
}
}
-// -----------------------------------------------------------------------
-
sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const
{
sal_uLong nRet = 0;
@@ -501,8 +484,6 @@ sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const
return nRet;
}
-// -----------------------------------------------------------------------
-
void SwCompatibilityOptPage::WriteOptions()
{
m_aConfigItem.Clear();
@@ -517,15 +498,11 @@ void SwCompatibilityOptPage::WriteOptions()
pItem->m_bExpandWordSpace );
}
-// -----------------------------------------------------------------------
-
SfxTabPage* SwCompatibilityOptPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
{
return new SwCompatibilityOptPage( pParent, rAttrSet );
}
-// -----------------------------------------------------------------------
-
sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& )
{
sal_Bool bModified = sal_False;
@@ -533,7 +510,7 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& )
{
sal_uLong nSavedOptions = m_nSavedOptions;
sal_uLong nCount = m_aOptionsLB.GetEntryCount();
- DBG_ASSERT( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" );
+ OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" );
bool bSetParaSpaceMax = false;
@@ -571,11 +548,6 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& )
m_pWrtShell->SetAddParaSpacingToTableCells( bChecked );
bModified = sal_True;
}
- else if ( COPT_ADD_TABLESPACING == nOption )
- {
- m_pWrtShell->SetAddParaSpacingToTableCells( bChecked );
- bModified = sal_True;
- }
else if ( COPT_USE_OBJECTPOSITIONING == nOption )
{
m_pWrtShell->SetUseFormerObjectPositioning( bChecked );
@@ -615,8 +587,6 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& )
return bModified;
}
-// -----------------------------------------------------------------------
-
void SwCompatibilityOptPage::Reset( const SfxItemSet& )
{
m_aOptionsLB.SelectEntryPos( 0 );
@@ -626,3 +596,4 @@ void SwCompatibilityOptPage::Reset( const SfxItemSet& )
m_nSavedOptions = nOptions;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index 5d93219fed98..4ae710af5ea0 100644
--- a/sw/source/ui/config/optdlg.hrc
+++ b/sw/source/ui/config/optdlg.hrc
@@ -25,7 +25,7 @@
*
************************************************************************/
-/* TabPage Ansicht*/
+/* TabPage View */
#define FL_DISP 1
#define FL_NOPRINT 2
#define FL_WINDOW 3
@@ -69,7 +69,7 @@
#define CB_TEST10 34
#define FL_TEST 35
-#define CB_FLD_HIDDEN_PARA 36 //Mittendrin, damit die HelpIds zum FPII kompatibel bleiben
+#define CB_FLD_HIDDEN_PARA 36 // right in the middle of it, so that HelpIds stay compatible to FPII
#define CB_SMOOTH_SCROLL 37
#define BT_OK 38
@@ -125,7 +125,7 @@
#define CB_TEXT_PLACEHOLDER 94
-// Tabpage Grundschriften
+// Tabpage Basic Fonts
#define FT_STANDARD 90
#define LB_STANDARD 91
#define FT_TITLE 92
@@ -150,7 +150,7 @@
#define LB_LABEL_SIZE 111
#define LB_INDEX_SIZE 112
-//Tabpage Tabelle
+//Tabpage Table
#define CB_HEADER 101
#define CB_REPEAT_HEADER 102
#define CB_DONT_SPLIT 103
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 400b3439b795..72079d27e3cd 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -38,7 +38,7 @@
/**************************************************************************/
/* */
-/* TabPage Ansicht/Inhalt */
+/* TabPage View/Content */
/* */
/**************************************************************************/
TabPage TP_CONTENT_OPT
@@ -59,7 +59,7 @@ TabPage TP_CONTENT_OPT
HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_CROSS";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Guides ~while moving";
+ Text [ en-US ] = "Helplines ~While Moving";
};
CheckBox CB_HANDLE
{
@@ -471,7 +471,7 @@ TabPage TP_STD_FONT
FixedText FT_SIZE
{
Pos = MAP_APPFONT ( 204 , 14 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
+ Size = MAP_APPFONT ( 40 , 8 ) ;
Text [ en-US ] = "Size";
};
MetricBox LB_STANDARD_SIZE
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 0bae918f3c4f..74dfbc5085d2 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,9 +72,8 @@
using namespace ::com::sun::star;
-/* -----------------22.10.98 15:12-------------------
- *
- * --------------------------------------------------*/
+#include <svl/eitem.hxx>
+
SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage( pParent, SW_RES( TP_OPTLOAD_PAGE ), rSet ),
@@ -94,6 +94,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
aTabFT ( this, SW_RES( FT_TAB ) ),
aTabMF ( this, SW_RES( MF_TAB ) ),
aUseSquaredPageMode ( this, SW_RES( CB_USE_SQUARE_PAGE_MODE ) ),
+ aUseCharUnit ( this , SW_RES( CB_USE_CHAR_UNIT ) ),
pWrtShell ( NULL ),
bHTMLMode ( sal_False ),
@@ -117,7 +118,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
case FUNIT_PICA:
case FUNIT_INCH:
{
- // nur diese Metriken benutzen
+ // use only these metrics
sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
}
@@ -136,32 +137,23 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
SvtCJKOptions aCJKOptions;
if(!aCJKOptions.IsAsianTypographyEnabled())
+ {
aUseSquaredPageMode.Hide();
+ aUseCharUnit.Hide();
+ }
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
SwLoadOptPage::~SwLoadOptPage()
{
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwLoadOptPage::Create( Window* pParent,
+SfxTabPage* SwLoadOptPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return new SwLoadOptPage(pParent, rAttrSet );
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
-sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
+sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
{
sal_Bool bRet = sal_False;
SwModule* pMod = SW_MOD();
@@ -201,7 +193,7 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
const sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos();
if ( nMPos != aMetricLB.GetSavedValue() )
{
- // Doppel-Cast fuer VA3.0
+ // Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
@@ -214,6 +206,15 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
bRet = sal_True;
}
+ sal_Bool bIsUseCharUnitFlag = aUseCharUnit.IsChecked();
+ SvtCJKOptions aCJKOptions;
+ bIsUseCharUnitFlag = bIsUseCharUnitFlag && aCJKOptions.IsAsianTypographyEnabled();
+ if( bIsUseCharUnitFlag != aUseCharUnit.GetSavedValue())
+ {
+ rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bIsUseCharUnitFlag ));
+ bRet = sal_True;
+ }
+
sal_Bool bIsSquaredPageModeFlag = aUseSquaredPageMode.IsChecked();
if ( bIsSquaredPageModeFlag != aUseSquaredPageMode.GetSavedValue() )
{
@@ -229,10 +230,8 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet )
return bRet;
}
-/*-----------------18.01.97 12.42-------------------
---------------------------------------------------*/
-void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet)
+void SwLoadOptPage::Reset( const SfxItemSet& rSet)
{
const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref(sal_False);
const SfxPoolItem* pItem;
@@ -300,17 +299,25 @@ void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet)
aUseSquaredPageMode.Check( bSquaredPageMode );
aUseSquaredPageMode.SaveValue();
}
+
+ if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, sal_False, &pItem))
+ {
+ sal_Bool bUseCharUnit = ((const SfxBoolItem*)pItem)->GetValue();
+ aUseCharUnit.Check(bUseCharUnit);
+ }
+ else
+ {
+ aUseCharUnit.Check(pUsrPref->IsApplyCharUnit());
+ }
+ aUseCharUnit.SaveValue();
}
-/*-----------------13.01.97 14.44-------------------
- Metric des Deftabstops umschalten
---------------------------------------------------*/
IMPL_LINK(SwLoadOptPage, MetricHdl, ListBox*, EMPTYARG)
{
const sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos();
if(nMPos != USHRT_MAX)
{
- // Doppel-Cast fuer VA3.0
+ // Double-Cast for VA3.0
FieldUnit eFieldUnit = (FieldUnit)(long)aMetricLB.GetEntryData( nMPos );
sal_Bool bModified = aTabMF.IsModified();
long nVal = bModified ?
@@ -324,9 +331,6 @@ IMPL_LINK(SwLoadOptPage, MetricHdl, ListBox*, EMPTYARG)
return 0;
}
-/*********************************************************************/
-/* */
-/*********************************************************************/
IMPL_LINK(SwLoadOptPage, CaptionHdl, PushButton*, EMPTYARG)
{
@@ -336,29 +340,17 @@ IMPL_LINK(SwLoadOptPage, CaptionHdl, PushButton*, EMPTYARG)
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet) :
SfxSingleTabDialog(pParent, rSet, 0)
{
- // TabPage erzeugen
+ // create TabPage
SetTabPage((SwCaptionOptPage*) SwCaptionOptPage::Create(this, rSet));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwCaptionOptDlg::~SwCaptionOptDlg()
{
}
-/* -----------------22.10.98 15:12-------------------
- *
- * --------------------------------------------------*/
-
SwCaptionPreview::SwCaptionPreview( Window* pParent, const ResId& rResId )
: Window( pParent, rResId )
{
@@ -391,7 +383,6 @@ void SwCaptionPreview::Paint( const Rectangle& rRect )
DrawText( Point( 4, 6 ), maText );
}
-
SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet )
: SfxTabPage(pParent, SW_RES(TP_OPTCAPTION_PAGE), rSet),
aCheckFT (this, SW_RES(FT_OBJECTS )),
@@ -513,36 +504,24 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet )
aCheckLB.SetDeselectHdl( LINK(this, SwCaptionOptPage, SaveEntryHdl) );
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
SwCaptionOptPage::~SwCaptionOptPage()
{
DelUserData();
delete pMgr;
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
SfxTabPage* SwCaptionOptPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return new SwCaptionOptPage(pParent, rAttrSet );
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& )
{
sal_Bool bRet = sal_False;
SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
- SaveEntry(aCheckLB.FirstSelected()); // Aktuellen Eintrag uebernehmen
+ SaveEntry(aCheckLB.FirstSelected()); // apply current entry
SvLBoxEntry* pEntry = aCheckLB.First();
@@ -562,10 +541,6 @@ sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& )
return bRet;
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
{
const SfxPoolItem* pItem;
@@ -598,7 +573,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
aAny = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
if ( !( aAny >>= sTemp ) )
{
- DBG_ERRORFILE( "Couldn't get PRODUCTVERSION variable" );
+ OSL_FAIL("Couldn't get PRODUCTVERSION variable" );
}
else
{
@@ -608,7 +583,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
}
else
{
- DBG_ERRORFILE( "Couldn't get PRODUCTNAME variable" );
+ OSL_FAIL("Couldn't get PRODUCTNAME variable" );
}
SvObjectServerList aObjS;
@@ -632,10 +607,6 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
ModifyHdl();
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos,
const SwCapObjType eObjType, const SvGlobalName *pOleId)
{
@@ -651,10 +622,6 @@ void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos,
aCheckLB.SetEntryData(nPos, new InsCaptionOpt(eObjType, pOleId));
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
void SwCaptionOptPage::DelUserData()
{
SvLBoxEntry* pEntry = aCheckLB.First();
@@ -667,10 +634,6 @@ void SwCaptionOptPage::DelUserData()
}
}
-/* -----------------26.10.98 11:06-------------------
- *
- * --------------------------------------------------*/
-
IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG )
{
SvLBoxEntry* pSelEntry = aCheckLB.FirstSelected();
@@ -796,24 +759,16 @@ IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG )
return 0;
}
-/* -----------------26.10.98 11:06-------------------
- *
- * --------------------------------------------------*/
-
IMPL_LINK( SwCaptionOptPage, SaveEntryHdl, SvxCheckListBox *, EMPTYARG )
{
SvLBoxEntry* pEntry = aCheckLB.GetHdlEntry();
- if (pEntry) // Alles speichern
+ if (pEntry) // save all
SaveEntry(pEntry);
return 0;
}
-/* -----------------05.11.98 16:23-------------------
- *
- * --------------------------------------------------*/
-
void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry)
{
if (pEntry)
@@ -846,19 +801,10 @@ void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry)
}
}
-/* -----------------26.10.98 11:06-------------------
- *
- * --------------------------------------------------*/
-
IMPL_LINK( SwCaptionOptPage, ModifyHdl, Edit *, EMPTYARG )
{
String sFldTypeName = aCategoryBox.GetText();
-/*
- SwFieldType* pType = sFldTypeName.Len() ? pMgr->GetFldType(RES_SETEXPFLD, sFldTypeName) : 0;
- ((SfxSingleTabDialog*)GetParent())->GetOKButton()->Enable( (!pType || ((SwSetExpFieldType*)pType)->GetType() == GSE_SEQ)
- && sFldTypeName.Len() != 0 );
-*/
SfxSingleTabDialog *pDlg = (SfxSingleTabDialog *)GetParent();
PushButton *pBtn = pDlg->GetOKButton();
if (pBtn)
@@ -874,19 +820,13 @@ IMPL_LINK( SwCaptionOptPage, ModifyHdl, Edit *, EMPTYARG )
return 0;
}
-/* -----------------26.10.98 10:58-------------------
- *
- * --------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwCaptionOptPage, SelectHdl, ListBox *, EMPTYARG )
{
DrawSample();
return 0;
}
IMPL_LINK_INLINE_END( SwCaptionOptPage, SelectHdl, ListBox *, EMPTYARG )
-/*-- 02.11.2007 10:00:36---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox )
{
DrawSample();
@@ -895,9 +835,6 @@ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox )
aNumberingSeparatorED.Enable( nPos == 1 );
return 0;
}
-/* -----------------26.10.98 10:58-------------------
- *
- * --------------------------------------------------*/
void SwCaptionOptPage::DrawSample()
{
@@ -907,7 +844,7 @@ void SwCaptionOptPage::DrawSample()
{
//#i61007# order of captions
bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1;
- // Nummer
+ // number
sal_uInt16 nNumFmt = (sal_uInt16)(sal_uLong)aFormatBox.GetEntryData(
aFormatBox.GetSelectEntryPos() );
if( SVX_NUM_NUMBER_NONE != nNumFmt )
@@ -915,7 +852,7 @@ void SwCaptionOptPage::DrawSample()
//#i61007# order of captions
if( !bOrderNumberingFirst )
{
- // Kategorie
+ // category
aStr += aCategoryBox.GetText();
aStr += ' ';
}
@@ -963,10 +900,7 @@ void SwCaptionOptPage::DrawSample()
aPreview.SetPreviewText( aStr );
}
-/*------------------------------------------------------------------------
- Beschreibung: ComboBox ohne Spaces
-------------------------------------------------------------------------*/
-
+// Description: ComboBox without Spaces
void CaptionComboBox::KeyInput(const KeyEvent& rEvt)
{
if( rEvt.GetKeyCode().GetCode() != KEY_SPACE )
@@ -975,3 +909,4 @@ void CaptionComboBox::KeyInput(const KeyEvent& rEvt)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optload.hrc b/sw/source/ui/config/optload.hrc
index b396b2d9f9f0..201c83d2af51 100644
--- a/sw/source/ui/config/optload.hrc
+++ b/sw/source/ui/config/optload.hrc
@@ -41,6 +41,7 @@
#define FT_TAB 21
#define MF_TAB 22
#define CB_USE_SQUARE_PAGE_MODE 23
+#define CB_USE_CHAR_UNIT 24
// SwCaptionOptPage -----------------------------
diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src
index be6473632b56..b5e51ef665ae 100644
--- a/sw/source/ui/config/optload.src
+++ b/sw/source/ui/config/optload.src
@@ -147,6 +147,15 @@ TabPage TP_OPTLOAD_PAGE
Text [ en-US ] = "Use square page mode for text grid";
Text [ zh-CN ] = "使用稿纸模å¼";
};
+
+ CheckBox CB_USE_CHAR_UNIT
+ {
+ Pos = MAP_APPFONT ( 12 , 130) ;
+ Size = MAP_APPFONT ( 109 , 10 ) ;
+ Text [ en-US ] = "Enable char unit";
+ Text [ x-comment ] = " ";
+ };
+
};
/**************************************************************************/
/* */
@@ -412,6 +421,8 @@ StringArray STR_ARR_METRIC
< "Miles" ; FUNIT_MILE ; > ;
< "Pica" ; FUNIT_PICA ; > ;
< "Point" ; FUNIT_POINT ; > ;
+ < "Char" ; FUNIT_CHAR ; >;
+ < "Line" ; FUNIT_LINE ; >;
};
};
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 84ab51621609..f44c8db71657 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <uitool.hxx>
-#include <cfgitems.hxx>
+#include <cfgitems.hxx> //Items for Sw-pages
#include <poolfmt.hxx>
#include <uiitems.hxx>
#include <initui.hxx>
@@ -84,17 +85,8 @@
#include <vcl/svapp.hxx>
-
using namespace ::com::sun::star;
-
-/*******************************************************
- ******************************************************/
-
-/*-----------------31.08.96 10.16-------------------
- TabPage Anzeige/Inhalt
---------------------------------------------------*/
-
SwContentOptPage::SwContentOptPage( Window* pParent,
const SfxItemSet& rCoreSet ) :
SfxTabPage( pParent, SW_RES( TP_CONTENT_OPT ), rCoreSet ),
@@ -159,38 +151,41 @@ SwContentOptPage::SwContentOptPage( Window* pParent,
case FUNIT_POINT:
case FUNIT_PICA:
case FUNIT_INCH:
+ case FUNIT_CHAR: // add two units , 'character' and 'line' , their ticks are not fixed
+ case FUNIT_LINE:
{
- // nur diese Metriken benutzen
- sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
- aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
- aVMetric.InsertEntry( sMetric );
- aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
- aHMetric.InsertEntry( sMetric );
- aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ // only use these metrics
+ // a horizontal ruler has not the 'line' unit
+ // there isn't 'line' unit in HTML format
+ if ( eFUnit != FUNIT_LINE )
+ {
+ sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
+ aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
+ aHMetric.InsertEntry( sMetric );
+ aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ }
+ // a vertical ruler has not the 'character' unit
+ if ( eFUnit != FUNIT_CHAR )
+ {
+ sal_uInt16 nPos = aVMetric.InsertEntry( sMetric );
+ aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ }
}
default:;//prevent warning
}
}
}
-/*-----------------31.08.96 13.58-------------------
-
---------------------------------------------------*/
SwContentOptPage::~SwContentOptPage()
{
}
-/*-----------------31.08.96 13.58-------------------
-
---------------------------------------------------*/
SfxTabPage* SwContentOptPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwContentOptPage(pParent, rAttrSet);
}
-/* -----------------------------07.04.01 16:57--------------------------------
- ---------------------------------------------------------------------------*/
static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
{
const SfxPoolItem* pItem;
@@ -208,9 +203,7 @@ static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemS
}
rMetric.SaveValue();
}
-/*-----------------31.08.96 13.58-------------------
---------------------------------------------------*/
void SwContentOptPage::Reset(const SfxItemSet& rSet)
{
const SwElemItem* pElemAttr = 0;
@@ -242,9 +235,6 @@ void SwContentOptPage::Reset(const SfxItemSet& rSet)
AnyRulerHdl(&aAnyRulerCB);
}
-/*-----------------31.08.96 13.58-------------------
-
---------------------------------------------------*/
sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
{
const SwElemItem* pOldAttr = (const SwElemItem*)
@@ -277,7 +267,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
sal_uInt16 nGlobalMetricPos = nMPos;
if ( nMPos != aMetricLB.GetSavedValue() )
{
- // Doppel-Cast fuer VA3.0
+ // Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
@@ -286,7 +276,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
nMPos = aHMetric.GetSelectEntryPos();
if ( nMPos != aHMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
{
- // Doppel-Cast fuer VA3.0
+ // Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aHMetric.GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( FN_HSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
@@ -294,24 +284,20 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
nMPos = aVMetric.GetSelectEntryPos();
if ( nMPos != aVMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
{
- // Doppel-Cast fuer VA3.0
+ // Double-Cast for VA3.0
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aVMetric.GetEntryData( nMPos );
rSet.Put( SfxUInt16Item( FN_VSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
bRet = sal_True;
}
return bRet;
}
-/* -----------------------------05.03.2002 15:07------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwContentOptPage, VertRulerHdl, CheckBox*, pBox)
{
aVRulerRightCBox.Enable(pBox->IsEnabled() && pBox->IsChecked());
return 0;
}
-/* -----------------20.09.2002 11:30-----------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox)
{
sal_Bool bChecked = pBox->IsChecked();
@@ -322,16 +308,14 @@ IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox)
VertRulerHdl(&aVRulerCBox);
return 0;
}
-/*----------------- OS 27.01.95 -----------------------
- TabPage Drucker Zusatzeinstellungen
+/*------------------------------------------------------
+ TabPage Printer additional settings
-------------------------------------------------------*/
SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
const SfxItemSet& rCoreSet) :
SfxTabPage( pParent, SW_RES( TP_OPTPRINT_PAGE ), rCoreSet),
aFL1 (this, SW_RES(FL_1)),
aGrfCB (this, SW_RES(CB_PGRF)),
-// aTabCB (this, SW_RES(CB_PTAB)),
-// aDrawCB (this, SW_RES(CB_PDRAW)),
aCtrlFldCB (this, SW_RES(CB_CTRLFLD)),
aBackgroundCB (this, SW_RES(CB_BACKGROUND)),
aBlackFontCB (this, SW_RES(CB_BLACK_FONT)),
@@ -341,7 +325,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aFL2 (this, SW_RES(FL_2)),
aLeftPageCB (this, SW_RES(CB_LEFTP)),
aRightPageCB (this, SW_RES(CB_RIGHTP)),
-// aReverseCB (this, SW_RES(CB_REVERSE)),
aProspectCB (this, SW_RES(CB_PROSPECT)),
aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)),
aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)),
@@ -352,7 +335,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aEndPageRB (this, SW_RES(RB_PAGEEND)),
aFL4 (this, SW_RES(FL_4)),
aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)),
-// aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)),
aPaperFromSetupCB(this, SW_RES(CB_PAPERFROMSETUP)),
aFaxFT (this, SW_RES(FT_FAX)),
aFaxLB (this, SW_RES(LB_FAX)),
@@ -366,14 +348,11 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aGrfCB.SetClickHdl( aLk );
aRightPageCB.SetClickHdl( aLk );
aLeftPageCB.SetClickHdl( aLk );
-// aTabCB.SetClickHdl( aLk );
-// aDrawCB.SetClickHdl( aLk );
aCtrlFldCB.SetClickHdl( aLk );
aBackgroundCB.SetClickHdl( aLk );
aBlackFontCB.SetClickHdl( aLk );
aPrintHiddenTextCB.SetClickHdl( aLk );
aPrintTextPlaceholderCB.SetClickHdl( aLk );
-// aReverseCB.SetClickHdl( aLk );
aProspectCB.SetClickHdl( aLk );
aProspectCB_RTL.SetClickHdl( aLk );
aPaperFromSetupCB.SetClickHdl( aLk );
@@ -382,27 +361,20 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aEndRB.SetClickHdl( aLk );
aOnlyRB.SetClickHdl( aLk );
aNoRB.SetClickHdl( aLk );
-// aSingleJobsCB.SetClickHdl( aLk );
aFaxLB.SetSelectHdl( LINK( this, SwAddPrinterTabPage, SelectHdl ) );
const SfxPoolItem* pItem;
if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
&& ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
{
-// aDrawCB .Hide();
aLeftPageCB .Hide();
aRightPageCB .Hide();
aPrintHiddenTextCB.Hide();
aPrintTextPlaceholderCB.Hide();
-// aReverseCB.SetPosPixel(aLeftPageCB.GetPosPixel());
aProspectCB.SetPosPixel(aLeftPageCB.GetPosPixel());
Point aPt( aRightPageCB.GetPosPixel() );
aPt.setX(aPt.getX() + 15); // indent
aProspectCB_RTL.SetPosPixel(aPt);
-// aBlackFontCB.SetPosPixel(aBackgroundCB.GetPosPixel());
-// aPrintHiddenTextCB.SetPosPixel(aBlackFontCB.GetPosPixel());
-// aBackgroundCB.SetPosPixel(aCtrlFldCB.GetPosPixel());
-// aCtrlFldCB.SetPosPixel(aDrawCB.GetPosPixel());
// hide aPrintEmptyPagesCB and move everything below up accordingly
long nDeltaY = aPaperFromSetupCB.GetPosPixel().getY() - aPrintEmptyPagesCB.GetPosPixel().getY();
@@ -422,8 +394,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aProspectCB_RTL.Show(aCTLOptions.IsCTLFontEnabled());
}
-//------------------------------------------------------------------------
-
void SwAddPrinterTabPage::SetPreview(sal_Bool bPrev)
{
bPreview = bPrev;
@@ -442,15 +412,11 @@ void SwAddPrinterTabPage::SetPreview(sal_Bool bPrev)
}
}
-//------------------------------------------------------------------------
-
SfxTabPage* SwAddPrinterTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwAddPrinterTabPage( pParent, rAttrSet ) );
}
-//------------------------------------------------------------------------
-
sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet )
{
@@ -490,8 +456,6 @@ sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet )
}
return bAttrModified;
}
-//------------------------------------------------------------------------
-
void SwAddPrinterTabPage::Reset( const SfxItemSet& )
{
@@ -502,8 +466,6 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& )
(const SfxPoolItem**)&pAddPrinterAttr ))
{
aGrfCB.Check( pAddPrinterAttr->bPrintGraphic || pAddPrinterAttr->bPrintDraw );
-// aTabCB.Check( pAddPrinterAttr->bPrintTable);
-// aDrawCB.Check( pAddPrinterAttr->bPrintDraw);
aCtrlFldCB.Check( pAddPrinterAttr->bPrintControl);
aBackgroundCB.Check( pAddPrinterAttr->bPrintPageBackground);
aBlackFontCB.Check( pAddPrinterAttr->bPrintBlackFont);
@@ -511,12 +473,10 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& )
aPrintTextPlaceholderCB.Check(pAddPrinterAttr->bPrintTextPlaceholder);
aLeftPageCB.Check( pAddPrinterAttr->bPrintLeftPages);
aRightPageCB.Check( pAddPrinterAttr->bPrintRightPages);
-// aReverseCB.Check( pAddPrinterAttr->bPrintReverse);
aPaperFromSetupCB.Check(pAddPrinterAttr->bPaperFromSetup);
aPrintEmptyPagesCB.Check(pAddPrinterAttr->bPrintEmptyPages);
aProspectCB.Check( pAddPrinterAttr->bPrintProspect);
aProspectCB_RTL.Check( pAddPrinterAttr->bPrintProspectRTL);
-// aSingleJobsCB.Check( pAddPrinterAttr->bPrintSingleJobs);
aNoRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_NONE ) ;
aOnlyRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ONLY ) ;
@@ -535,15 +495,11 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& )
else
aProspectCB_RTL.Enable( sal_False );
}
-//-----------------------------------------------------------------------
-
void SwAddPrinterTabPage::Init()
{
}
-//------------------------------------------------------------------------
-
IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
{
@@ -560,9 +516,6 @@ IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG
}
IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
-//------------------------------------------------------------------------
-
-
void SwAddPrinterTabPage::SetFax( const SvStringsDtor& rFaxLst )
{
aFaxLB.InsertEntry(sNone);
@@ -571,9 +524,6 @@ void SwAddPrinterTabPage::SetFax( const SvStringsDtor& rFaxLst )
aFaxLB.SelectEntryPos(0);
}
-//------------------------------------------------------------------------
-
-
IMPL_LINK_INLINE_START( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG )
{
bAttrModified=sal_True;
@@ -583,7 +533,6 @@ IMPL_LINK_INLINE_END( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG )
void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet)
{
- //SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_FAX_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pListItem,SfxBoolItem,SID_FAX_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pPreviewItem,SfxBoolItem,SID_PREVIEWFLAG_TYPE,sal_False);
if (pPreviewItem)
@@ -602,24 +551,12 @@ void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet)
aFaxList.Insert(rpString, 0);
}
SetFax( aFaxList );
-/* SvStringsDtor aFaxList;
- const List *pList = (pListItem)->GetList();
- sal_uInt32 nCount = pList->Count();
- for(sal_uInt32 i = 0; i < nCount ; i++)
- {
- String* pString = (String*)(pList->GetObject(i));
- String* &rpString = pString;
- aFaxList.Insert(rpString, 0 );
- }
- SetFax(aFaxList);
-*/
}
}
-/*-----------------03.09.96 11.53-------------------
+
+/*--------------------------------------------------
Tabpage Standardfonts
--------------------------------------------------*/
-
-
SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
const SfxItemSet& rSet ) :
SfxTabPage( pParent, SW_RES( TP_STD_FONT ), rSet),
@@ -700,28 +637,18 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
aDocOnlyCB.Check(SW_MOD()->GetModuleConfig()->IsDefaultFontInCurrDocOnly());
}
-/*-----------------03.09.96 11.53-------------------
-
---------------------------------------------------*/
-
SwStdFontTabPage::~SwStdFontTabPage()
{
if(bDeletePrinter)
delete pPrt;
}
-/*-----------------03.09.96 11.53-------------------
-
---------------------------------------------------*/
SfxTabPage* SwStdFontTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return new SwStdFontTabPage(pParent, rAttrSet);
}
-/*-----------------03.09.96 11.53-------------------
-
---------------------------------------------------*/
void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
SfxPrinter* pPrt, const String& rStyle,
sal_uInt16 nFontWhich)
@@ -733,9 +660,7 @@ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
}
-/*-- 11.10.2005 15:47:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
sal_Int32 nHeight, sal_uInt16 nFontHeightWhich)
{
@@ -744,9 +669,7 @@ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType);
pColl->SetFmtAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
}
-/*-----------------03.09.96 11.53-------------------
---------------------------------------------------*/
sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& )
{
sal_Bool bNotDocOnly = !aDocOnlyCB.IsChecked();
@@ -821,7 +744,6 @@ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& )
aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFmtAttr(nFontWhich);
-// lcl_SetColl(pWrtShell, RES_POOLCOLL_STANDARD, pPrinter, sStandard);
bMod = sal_True;
}
if(bStandardHeightChanged)
@@ -885,9 +807,6 @@ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& )
return sal_False;
}
-/*-----------------03.09.96 11.53-------------------
-
---------------------------------------------------*/
void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
{
const SfxPoolItem* pLang;
@@ -1080,11 +999,6 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
aIndexHeightLB. SaveValue();
}
-/*-----------------07.09.96 12.28-------------------
-
---------------------------------------------------*/
-
-
IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG )
{
sal_uInt8 nFontOffset = nFontGroup * FONT_PER_GROUP;
@@ -1118,9 +1032,6 @@ IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG )
return 0;
}
-/*-----------------17.01.97 15.43-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox )
{
@@ -1149,9 +1060,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox )
return 0;
}
-/*-- 11.10.2005 15:11:23---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox )
{
if(pBox == &aStandardHeightLB)
@@ -1179,9 +1087,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox )
return 0;
}
-/*-- 28.09.2005 13:22:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
{
FontSizeBox* pHeightLB = 0;
@@ -1219,9 +1124,6 @@ void SwStdFontTabPage::PageCreated (SfxAllItemSet aSet)
if (pFlagItem)
SetFontMode(sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue()));
}
-/*-----------------18.01.97 12.14-------------------
- Optionen Tabelle
---------------------------------------------------*/
SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage(pParent, SW_RES(TP_OPTTABLE_PAGE), rSet),
@@ -1269,28 +1171,16 @@ SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet&
aHeaderCB.SetClickHdl(aLnk);
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
SwTableOptionsTabPage::~SwTableOptionsTabPage()
{
}
-/*-----------------18.01.97 12.43-------------------
-
---------------------------------------------------*/
-
SfxTabPage* SwTableOptionsTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return new SwTableOptionsTabPage(pParent, rAttrSet );
}
-/*-----------------18.01.97 12.42-------------------
-
---------------------------------------------------*/
-
sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& )
{
sal_Bool bRet = sal_False;
@@ -1318,12 +1208,12 @@ sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& )
if(eMode != pModOpt->GetTblMode())
{
pModOpt->SetTblMode(eMode);
- // der Tabellen-Tastatur-Modus hat sich geaendert, das soll
- // jetzt auch die aktuelle Tabelle erfahren
+ // the table-keyboard-mode has changed, now the current
+ // table should know about that too.
if(pWrtShell && nsSelectionType::SEL_TBL & pWrtShell->GetSelectionType())
{
pWrtShell->SetTblChgMode(eMode);
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{ FN_TABLE_MODE_FIX,
FN_TABLE_MODE_FIX_PROP,
FN_TABLE_MODE_VARIABLE,
@@ -1377,9 +1267,7 @@ sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& )
return bRet;
}
-/*-----------------18.01.97 12.42-------------------
---------------------------------------------------*/
void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet)
{
const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
@@ -1410,46 +1298,10 @@ void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet)
bHTMLMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
}
- //bestimmte Controls fuer HTML verstecken
+ // hide certain controls for html
if(bHTMLMode)
{
-/* Point aPos(aCaptionFL.GetPosPixel());
- long nYDiff = aTableFL.GetPosPixel().Y() - aPos.Y();
- aTableFL.SetPosPixel(aPos);
-
- aPos = aHeaderCB.GetPosPixel();
- aPos.Y() -= nYDiff;
- aHeaderCB.SetPosPixel(aPos);
-
- aPos = aRepeatHeaderCB.GetPosPixel();
- aPos.Y() -= nYDiff;
- aRepeatHeaderCB.SetPosPixel(aPos);
-
- aPos = aDontSplitCB.GetPosPixel(); // hier muss eine Luecke geschlossen werden
- aPos.Y() -= nYDiff;
- aBorderCB.SetPosPixel(aPos);
- aPos = aTableInsertFL.GetPosPixel();
- aPos.Y() -= nYDiff;
- aTableInsertFL.SetPosPixel(aPos);
-
- aPos = aNumFormattingCB.GetPosPixel();
- aPos.Y() -= nYDiff;
- aNumFormattingCB.SetPosPixel(aPos);
-
- aPos = aNumFmtFormattingCB.GetPosPixel();
- aPos.Y() -= nYDiff;
- aNumFmtFormattingCB.SetPosPixel(aPos);
-
- aPos = aNumAlignmentCB.GetPosPixel();
- aPos.Y() -= nYDiff;
- aNumAlignmentCB.SetPosPixel(aPos);
-
- aCaptionFL.Hide();
- aCaptionCB.Hide();
- aCaptionFT.Hide();
- aCaptionPB.Hide();
-*/
aDontSplitCB.Hide();
}
@@ -1475,9 +1327,7 @@ void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet)
CheckBoxHdl(0);
}
-/*-----------------18.01.97 12.42-------------------
---------------------------------------------------*/
IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG)
{
aNumFmtFormattingCB.Enable(aNumFormattingCB.IsChecked());
@@ -1492,11 +1342,6 @@ void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet)
if (pWrtSh)
SetWrtShell(pWrtSh->GetValue());
}
-/* */
-
-/*-----------------31.10.97 17:55-------------------
- TabPage fuer ShadowCrsr
---------------------------------------------------*/
SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( Window* pParent,
const SfxItemSet& rSet )
@@ -1572,7 +1417,6 @@ SwShdwCrsrOptionsTabPage::~SwShdwCrsrOptionsTabPage()
{
}
-
SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet )
{
return new SwShdwCrsrOptionsTabPage( pParent, rSet );
@@ -1628,7 +1472,7 @@ sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet )
SwDocDisplayItem aDisp;
if(pOldAttr)
aDisp = *pOldAttr;
- //
+
aDisp.bParagraphEnd = aParaCB .IsChecked();
aDisp.bTab = aTabCB .IsChecked();
aDisp.bSpace = aSpacesCB .IsChecked();
@@ -1686,18 +1530,17 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet )
}
}
-/*-----------------31.10.97 17:55-------------------
- TabPage fuer Redlining
+/*--------------------------------------------------
+ TabPage for Redlining
--------------------------------------------------*/
-
struct CharAttr
{
sal_uInt16 nItemId;
sal_uInt16 nAttr;
};
-// Editieren entspricht Einfuegen-Attributen
-static CharAttr __FAR_DATA aRedlineAttr[] =
+// Edit corresponds to Paste-attributes
+static CharAttr aRedlineAttr[] =
{
{ SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_NOT_MAPPED },
{ SID_ATTR_CHAR_WEIGHT, WEIGHT_BOLD },
@@ -1724,9 +1567,8 @@ static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 };
static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
/*-----------------------------------------------------------------------
- Beschreibung: Markierungsvorschau
+ Description: Preview of selection
-----------------------------------------------------------------------*/
-
SwMarkPreview::SwMarkPreview( Window *pParent, const ResId& rResID ) :
Window(pParent, rResID),
@@ -1740,7 +1582,7 @@ SwMarkPreview::SwMarkPreview( Window *pParent, const ResId& rResID ) :
const Size aSz(GetOutputSizePixel());
- // Seite
+ // Page
aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
sal_uLong nOutWPix = aPage.GetWidth();
@@ -1789,15 +1631,15 @@ void SwMarkPreview::DataChanged( const DataChangedEvent& rDCEvt )
void SwMarkPreview::Paint(const Rectangle &/*rRect*/)
{
- // Schatten zeichnen
+ // draw shadow
Rectangle aShadow(aPage);
aShadow += Point(3, 3);
DrawRect( aShadow, m_aShadowCol, m_aTransCol );
- // Seite zeichnen
+ // draw page
DrawRect( aPage, m_aBgCol, m_aLineCol );
- // Separator zeichnen
+ // draw separator
Rectangle aPageSeparator(aPage);
aPageSeparator.SetSize(Size(2, aPageSeparator.GetHeight()));
aPageSeparator.Move(aPage.GetWidth() / 2 - 1, 0);
@@ -1811,23 +1653,23 @@ void SwMarkPreview::Paint(const Rectangle &/*rRect*/)
switch (nMarkPos)
{
- case 1: // Links
+ case 1: // left
aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
break;
- case 2: // Rechts
+ case 2: // right
aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
break;
- case 3: // Aussen
+ case 3: // outside
break;
- case 4: // Innen
+ case 4: // inside
aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
break;
- case 0: // Keine
+ case 0: // none
default:
return;
}
@@ -1837,10 +1679,10 @@ void SwMarkPreview::Paint(const Rectangle &/*rRect*/)
void SwMarkPreview::PaintPage(const Rectangle &rRect)
{
- // PrintArea zeichnen
+ // draw PrintArea
DrawRect(rRect, m_aTransCol, m_aPrintAreaCol );
- // Testabsatz zeichnen
+ // draw Testparagraph
sal_uLong nLTxtBorder = 4;
sal_uLong nRTxtBorder = 4;
sal_uLong nTTxtBorder = 4;
@@ -1857,8 +1699,7 @@ void SwMarkPreview::PaintPage(const Rectangle &rRect)
nStep = aTextLine.GetHeight() + 2;
nLines = (sal_uInt16)(rRect.GetHeight() / (aTextLine.GetHeight() + 2)) - 1;
- // Text simulieren
- //
+ // simulate text
for (sal_uInt16 i = 0; i < nLines; ++i)
{
if (i == (nLines - 1))
@@ -2095,7 +1936,7 @@ sal_Bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet& )
nOldMarkColor != pOpt->GetMarkAlignColor().GetColor() ||
nOldMarkMode != pOpt->GetMarkAlignMode())
{
- // Alle Dokumente aktualisieren
+ // update all documents
TypeId aType(TYPE(SwDocShell));
SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
@@ -2117,12 +1958,12 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
const AuthorCharAttr &rDeletedAttr = pOpt->GetDeletedAuthorAttr();
const AuthorCharAttr &rChangedAttr = pOpt->GetFormatAuthorAttr();
- // Preview initialisieren
+ // initialise preview
InitFontStyle(aInsertedPreviewWN);
InitFontStyle(aDeletedPreviewWN);
InitFontStyle(aChangedPreviewWN);
- // Farblistboxen initialisieren
+ // initialise colour list box
String sColor;
aInsertColorLB.SetUpdateMode(sal_False);
aDeletedColorLB.SetUpdateMode(sal_False);
@@ -2137,11 +1978,11 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
aDeletedColorLB.InsertEntry(sAuthor);
aChangedColorLB.InsertEntry(sAuthor);
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
sal_uInt16 i;
- for( i = 0; i < pColorTbl->Count(); ++i )
+ for( i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
@@ -2221,7 +2062,7 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
}
aMarkPosLB.SelectEntryPos(nPos);
- // Einstellungen in Preview anzeigen
+ // show settings in preview
AttribHdl(&aInsertLB);
ColorHdl(&aInsertColorLB);
AttribHdl(&aDeletedLB);
@@ -2461,12 +2302,7 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
}
-#ifdef DBG_UTIL
-/*******************************************************
- ******************************************************/
-/*----------------- OS 11.01.95 -----------------------
- TabPage Testeinstellungen
--------------------------------------------------------*/
+#if OSL_DEBUG_LEVEL > 1
void lcl_SetPosSize(Window& rWin, Point aPos, Size aSize)
{
@@ -2530,17 +2366,11 @@ SwTestTabPage::SwTestTabPage( Window* pParent,
}
-
-//------------------------------------------------------------------------
-
-
SfxTabPage* SwTestTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwTestTabPage( pParent, rAttrSet ) );
}
-//------------------------------------------------------------------------
-
sal_Bool SwTestTabPage::FillItemSet( SfxItemSet& rCoreSet )
{
@@ -2562,8 +2392,6 @@ sal_Bool SwTestTabPage::FillItemSet( SfxItemSet& rCoreSet )
}
return bAttrModified;
}
-//------------------------------------------------------------------------
-
void SwTestTabPage::Reset( const SfxItemSet& )
{
@@ -2585,8 +2413,6 @@ void SwTestTabPage::Reset( const SfxItemSet& )
aTest10CBox.Check(pTestAttr->bTest10);
}
}
-//------------------------------------------------------------------------
-
void SwTestTabPage::Init()
{
@@ -2603,8 +2429,6 @@ void SwTestTabPage::Init()
aTest9CBox.SetClickHdl( aLk );
aTest10CBox.SetClickHdl( aLk );
}
-//------------------------------------------------------------------------
-
IMPL_LINK_INLINE_START( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
{
@@ -2615,3 +2439,5 @@ IMPL_LINK_INLINE_END( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx
index cc6f0a4368c0..d3ecdc2c4a70 100644
--- a/sw/source/ui/config/prtopt.cxx
+++ b/sw/source/ui/config/prtopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <unotools/configmgr.hxx>
#include <prtopt.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -42,7 +43,7 @@ using rtl::OUString;
using namespace com::sun::star::uno;
/*--------------------------------------------------------------------
- Beschreibung: Ctor
+ Description: Ctor
--------------------------------------------------------------------*/
Sequence<OUString> SwPrintOptions::GetPropertyNames()
@@ -77,9 +78,7 @@ Sequence<OUString> SwPrintOptions::GetPropertyNames()
}
return aNames;
}
-/* -----------------------------06.09.00 16:44--------------------------------
- ---------------------------------------------------------------------------*/
SwPrintOptions::SwPrintOptions(sal_Bool bWeb) :
ConfigItem(bWeb ? C2U("Office.WriterWeb/Print") : C2U("Office.Writer/Print"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -94,7 +93,7 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) :
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -138,15 +137,11 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) :
bPrintDraw = bPrintGraphic;
}
-/* -----------------------------06.09.00 16:50--------------------------------
- ---------------------------------------------------------------------------*/
SwPrintOptions::~SwPrintOptions()
{
}
-/* -----------------------------06.09.00 16:43--------------------------------
- ---------------------------------------------------------------------------*/
void SwPrintOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
@@ -195,3 +190,4 @@ void SwPrintOptions::Commit()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index 640471e441f1..665ed2c168cf 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,23 +29,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <hintids.hxx>
#include <svl/urihelper.hxx>
#include <unotools/pathoptions.hxx>
#include <tools/stream.hxx>
-#ifndef _SFX_INIMGR_HXX
-#endif
#include <sfx2/docfile.hxx>
#include <svl/itemiter.hxx>
#include <editeng/brshitem.hxx>
-
#include <tools/resid.hxx>
#include <fmtornt.hxx>
-#include <swtypes.hxx> // Leerstring
+#include <swtypes.hxx> // empty string
#include <wrtsh.hxx>
#include <uinums.hxx>
#include <poolfmt.hxx>
@@ -66,21 +61,16 @@ using namespace ::com::sun::star;
#define NUMRULE_FILENAME "numrule.cfg"
#define CHAPTER_FILENAME "chapter.cfg"
-/*------------------------------------------------------------------------
- Beschreibung: Ops. zum Laden / Speichern
-------------------------------------------------------------------------*/
-
-
SV_IMPL_PTRARR( _SwNumFmtsAttrs, SfxPoolItem* )
// SwNumRulesWithName ----------------------------------------------------
// PUBLIC METHODES -------------------------------------------------------
/*------------------------------------------------------------------------
- Beschreibung: Speichern einer Regel
- Parameter: rCopy -- die zu speichernde Regel
- nIdx -- Position, an der die Regel zu speichern ist.
- Eine alte Regel an dieser Position wird ueberschrieben.
+ Description: Saving a rule
+ Parameter: rCopy -- the rule to save
+ nIdx -- position, where the rule is to be saved.
+ An old rule at that position will be overwritten.
------------------------------------------------------------------------*/
SwBaseNumRules::SwBaseNumRules( const String& rFileName )
@@ -92,9 +82,6 @@ SwBaseNumRules::SwBaseNumRules( const String& rFileName )
Init();
}
-/*-----------------26.06.97 08.30-------------------
-
---------------------------------------------------*/
SwBaseNumRules::~SwBaseNumRules()
{
if( bModified )
@@ -114,9 +101,6 @@ SwBaseNumRules::~SwBaseNumRules()
delete pNumRules[i];
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
void SwBaseNumRules::Init()
{
for(sal_uInt16 i = 0; i < nMaxRules; ++i )
@@ -131,29 +115,21 @@ void SwBaseNumRules::Init()
}
}
-/*-----------------26.06.97 08.30-------------------
-
---------------------------------------------------*/
-
void SwBaseNumRules::ApplyNumRules(const SwNumRulesWithName &rCopy, sal_uInt16 nIdx)
{
- ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.);
+ OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert.");
if( !pNumRules[nIdx] )
pNumRules[nIdx] = new SwNumRulesWithName( rCopy );
else
*pNumRules[nIdx] = rCopy;
}
-// PROTECTED METHODES ----------------------------------------------------
-/*------------------------------------------------------------------------
- Beschreibung: Speichern
-------------------------------------------------------------------------*/
-
-sal_Bool /**/ SwBaseNumRules::Store(SvStream &rStream)
+// PROTECTED METHODS ----------------------------------------------------
+sal_Bool SwBaseNumRules::Store(SvStream &rStream)
{
rStream << ACT_NUM_VERSION;
- // Schreiben, welche Positionen durch eine Regel belegt sind
- // Anschliessend Schreiben der einzelnen Rules
+ // Write, what positions are occupied by a rule
+ // Then write each of the rules
for(sal_uInt16 i = 0; i < nMaxRules; ++i)
{
if(pNumRules[i])
@@ -167,24 +143,17 @@ sal_Bool /**/ SwBaseNumRules::Store(SvStream &rStream)
return sal_True;
}
-
-
-/*------------------------------------------------------------------------
- Beschreibung: Speichern / Laden
-------------------------------------------------------------------------*/
-
-
int SwBaseNumRules::Load(SvStream &rStream)
{
int rc = 0;
rStream >> nVersion;
- // wegen eines kleinen aber schweren Fehlers schreibt die PreFinal die
- // gleiche VERSION_40A wie das SP2 #55402#
+ // due to a small but serious mistake, PreFinal writes the same VERION_40A as SP2
+ // #55402#
if(VERSION_40A == nVersion)
{
- DBG_ERROR("Version 364 ist nicht eindeutig #55402#");
+ OSL_FAIL("Version 364 is not clear #55402#");
}
else if( VERSION_30B == nVersion || VERSION_31B == nVersion ||
ACT_NUM_VERSION >= nVersion )
@@ -205,35 +174,21 @@ int SwBaseNumRules::Load(SvStream &rStream)
return rc;
}
-/*-----------------26.06.97 08.34-------------------
-
---------------------------------------------------*/
-
-/*------------------------------------------------------------------------*/
-
-
SwChapterNumRules::SwChapterNumRules() :
SwBaseNumRules(C2S(CHAPTER_FILENAME))
{
}
-/*------------------------------------------------------------------------*/
-
SwChapterNumRules::~SwChapterNumRules()
{
}
-/*-----------------26.06.97 08.23-------------------
-
---------------------------------------------------*/
void SwChapterNumRules::ApplyNumRules(const SwNumRulesWithName &rCopy, sal_uInt16 nIdx)
{
bModified = sal_True;
SwBaseNumRules::ApplyNumRules(rCopy, nIdx);
}
-/*------------------------------------------------------------------------*/
-
SwNumRulesWithName::SwNumRulesWithName( const SwNumRule &rCopy,
const String &rName )
: aName(rName)
@@ -248,28 +203,18 @@ SwNumRulesWithName::SwNumRulesWithName( const SwNumRule &rCopy,
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
SwNumRulesWithName::SwNumRulesWithName( const SwNumRulesWithName& rCopy )
{
memset( aFmts, 0, sizeof( aFmts ));
*this = rCopy;
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
SwNumRulesWithName::~SwNumRulesWithName()
{
for( int n = 0; n < MAXLEVEL; ++n )
delete aFmts[ n ];
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName &rCopy)
{
if( this != &rCopy )
@@ -289,9 +234,6 @@ const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName
return *this;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion )
{
CharSet eEncoding = gsl_getSystemTextEncoding();
@@ -302,10 +244,9 @@ SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion )
{
if( VERSION_30B == nVersion )
c = 1;
- // wegen eines kleinen aber schweren Fehlers schreibt die PreFinal die
- // gleiche VERSION_40A wie das SP2 #55402#
+ // due to a small but serious mistake, PreFinal writes the same VERION_40A as SP2
+ // #55402#
else if(nVersion < VERSION_40A && n > 5)
-// else if(nVersion < VERSION_50A && n > 5)
c = 0;
else
rStream >> c;
@@ -317,16 +258,10 @@ SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion )
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const
{
- // --> OD 2008-02-11 #newlistlevelattrs#
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
rChg = SwNumRule( aName, numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
rChg.SetAutoRule( sal_False );
_SwNumFmtGlobal* pFmt;
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -338,9 +273,6 @@ void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
void SwNumRulesWithName::Store( SvStream &rStream )
{
CharSet eEncoding = gsl_getSystemTextEncoding();
@@ -358,15 +290,11 @@ void SwNumRulesWithName::Store( SvStream &rStream )
rStream << (char)0;
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const SwNumFmt& rFmt )
: aFmt( rFmt ), nCharPoolId( USHRT_MAX )
{
- // relative Abstaende ?????
+ // relative gaps?????
SwCharFmt* pFmt = rFmt.GetCharFmt();
if( pFmt )
@@ -390,10 +318,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const SwNumFmt& rFmt )
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const _SwNumFmtGlobal& rFmt )
:
aFmt( rFmt.aFmt ),
@@ -404,10 +328,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const _SwNumFmtGlobal& rFm
aItems.Insert( rFmt.aItems[ --n ]->Clone(), aItems.Count() );
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
sal_uInt16 nVersion )
: nCharPoolId( USHRT_MAX )
@@ -416,7 +336,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
{
sal_uInt16 nUS;
sal_Char cChar;
- short nShort;
sal_Bool bFlag;
String sStr;
@@ -445,8 +364,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
rStream >> nL; aFmt.SetLSpace( lNumIndent );
rStream >> nL; aFmt.SetFirstLineOffset( (short)nL );
}
- else // alter StartWert war ein Byte
+ else // old start-value was a Byte
{
+ short nShort;
rStream >> nUS; aFmt.SetStart( nUS );
rStream.ReadByteString(sStr, eEncoding);
aFmt.SetPrefix( sStr );
@@ -538,18 +458,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
}
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNumRulesWithName::_SwNumFmtGlobal::~_SwNumFmtGlobal()
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream )
{
@@ -597,14 +508,14 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream )
{
SfxPoolItem* pItem = aItems[ --n ];
sal_uInt16 nIVers = pItem->GetVersion( SOFFICE_FILEFORMAT_50 );
- ASSERT( nIVers != USHRT_MAX,
+ OSL_ENSURE( nIVers != USHRT_MAX,
"Was'n das: Item-Version USHRT_MAX in der aktuellen Version" );
rStream << pItem->Which()
<< nIVers;
pItem->Store( rStream, nIVers );
}
- // Erweiterungen fuer Version 40A
+ // Extensions for 40A
if( SVX_NUM_BITMAP == aFmt.GetNumberingType() )
{
@@ -629,23 +540,19 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream )
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh,
SwNumFmt& rNew ) const
{
SwCharFmt* pFmt = 0;
if( sCharFmtName.Len() )
{
- // suche erstmal ueber den Namen
+ // at first, look for the name
sal_uInt16 nArrLen = rSh.GetCharFmtCount();
for( sal_uInt16 i = 1; i < nArrLen; ++i )
{
pFmt = &rSh.GetCharFmt( i );
if( COMPARE_EQUAL == pFmt->GetName().CompareTo( sCharFmtName ))
- // ist vorhanden, also belasse die Attribute wie sie sind!
+ // exists, so leave attributes as they are!
break;
pFmt = 0;
}
@@ -660,7 +567,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh,
else
pFmt = rSh.GetCharFmtFromPool( nCharPoolId );
- if( !pFmt->GetDepends() ) // Attribute setzen
+ if( !pFmt->GetDepends() ) // set attributes
for( sal_uInt16 n = aItems.Count(); n; )
pFmt->SetFmtAttr( *aItems[ --n ] );
}
@@ -671,3 +578,4 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh,
((SwNumFmt&)aFmt).SetCharFmt( 0 );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx
index c8b6bd7d3ab1..2d5acfa0c9a4 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include <tools/stream.hxx>
#include <unotools/syslocale.hxx>
+#include <svl/cjkoptions.hxx>
#include "swtypes.hxx"
#include "hintids.hxx"
@@ -46,10 +48,11 @@
#include <unomid.h>
using namespace utl;
-using namespace rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy)
{
@@ -67,12 +70,20 @@ SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) :
aLayoutConfig(bWeb, *this),
aGridConfig(bWeb, *this),
aCursorConfig(*this),
- pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0)
+ pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0),
+ bApplyCharUnit(sal_False)
{
MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+ SvtCJKOptions aCJKOptions;
eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH;
- eHScrollMetric = eUserMetric;
- eVScrollMetric = eUserMetric;
+
+ sal_Bool bCJKEnabled = aCJKOptions.IsAsianTypographyEnabled();
+ bApplyCharUnit = bCJKEnabled;
+ eHScrollMetric = bApplyCharUnit ? FUNIT_CHAR : eUserMetric;
+ eVScrollMetric = bApplyCharUnit ? FUNIT_LINE : eUserMetric;
+
+ bIsHScrollMetricSet = bApplyCharUnit;
+ bIsVScrollMetricSet = bApplyCharUnit;
aContentConfig.Load();
aLayoutConfig.Load();
@@ -81,16 +92,12 @@ SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) :
if(pWebColorConfig)
pWebColorConfig->Load();
}
-/* -----------------------------13.02.01 09:48--------------------------------
- ---------------------------------------------------------------------------*/
SwMasterUsrPref::~SwMasterUsrPref()
{
delete pWebColorConfig;
}
-/*-- 28.09.00 09:55:32---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence<OUString> SwContentViewConfig::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -107,13 +114,13 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames()
"NonprintingCharacter/Space", // 9
"NonprintingCharacter/Break", // 10
"NonprintingCharacter/ProtectedSpace", // 11
- "NonprintingCharacter/Tab", // 12 //not in Writer/Web
- "NonprintingCharacter/HiddenText", // 13
- "NonprintingCharacter/HiddenParagraph", // 14
- "NonprintingCharacter/HiddenCharacter", // 15
- "Update/Link", // 16
- "Update/Field", // 17
- "Update/Chart" // 18
+ "NonprintingCharacter/Tab", // 12 //not in Writer/Web
+ "NonprintingCharacter/HiddenText", // 13
+ "NonprintingCharacter/HiddenParagraph", // 14
+ "NonprintingCharacter/HiddenCharacter", // 15
+ "Update/Link", // 16
+ "Update/Field", // 17
+ "Update/Chart" // 18
};
@@ -126,9 +133,7 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames()
}
return aNames;
}
-/*-- 28.09.00 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwContentViewConfig::SwContentViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Content") : C2U("Office.Writer/Content")),
rParent(rPar),
@@ -137,22 +142,16 @@ SwContentViewConfig::SwContentViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar)
Load();
EnableNotification( GetPropertyNames() );
}
-/*-- 28.09.00 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwContentViewConfig::~SwContentViewConfig()
{
}
-/*-- 09.02.07 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwContentViewConfig::Notify( const Sequence< OUString > & /*rPropertyNames*/ )
{
Load();
}
-/*-- 28.09.00 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwContentViewConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -190,15 +189,13 @@ void SwContentViewConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 28.09.00 09:55:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwContentViewConfig::Load()
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -238,9 +235,7 @@ void SwContentViewConfig::Load()
}
}
}
-/*-- 28.09.00 09:55:34---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -266,8 +261,9 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
"ViewLayout/Columns", //17
"ViewLayout/BookMode", //18
"Other/IsSquaredPageMode" //19
+ "Other/ApplyCharUnit" //20
};
- const int nCount = bWeb ? 15 : 20;
+ const int nCount = bWeb ? 15 : 21;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -276,9 +272,7 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
}
return aNames;
}
-/*-- 28.09.00 09:55:34---------------------------------------------------
- -----------------------------------------------------------------------*/
SwLayoutViewConfig::SwLayoutViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Layout") : C2U("Office.Writer/Layout"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -286,15 +280,11 @@ SwLayoutViewConfig::SwLayoutViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
bWeb(bIsWeb)
{
}
-/*-- 28.09.00 09:55:35---------------------------------------------------
- -----------------------------------------------------------------------*/
SwLayoutViewConfig::~SwLayoutViewConfig()
{
}
-/*-- 28.09.00 09:55:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwLayoutViewConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -335,19 +325,18 @@ void SwLayoutViewConfig::Commit()
case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns",
case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
+ case 20: rVal <<= (sal_Bool) rParent.IsApplyCharUnit(); break; // "Other/IsSquaredPageMode",
}
}
PutProperties(aNames, aValues);
}
-/*-- 28.09.00 09:55:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwLayoutViewConfig::Load()
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -391,6 +380,7 @@ void SwLayoutViewConfig::Load()
case 17: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
case 19: rParent.SetDefaultPageMode(bSet,sal_True); break;// "Other/IsSquaredPageMode",
+ case 20: rParent.SetApplyCharUnit(bSet); break;// "Other/ApplyUserChar"
}
}
}
@@ -399,9 +389,6 @@ void SwLayoutViewConfig::Load()
void SwLayoutViewConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/* -----------------------------19.01.01 13:07--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<OUString> SwGridConfig::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -423,9 +410,7 @@ Sequence<OUString> SwGridConfig::GetPropertyNames()
}
return aNames;
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
SwGridConfig::SwGridConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Grid") : C2U("Office.Writer/Grid"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -433,15 +418,11 @@ SwGridConfig::SwGridConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) :
bWeb(bIsWeb)
{
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
SwGridConfig::~SwGridConfig()
{
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
void SwGridConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -467,15 +448,13 @@ void SwGridConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
void SwGridConfig::Load()
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
Size aSnap(rParent.GetSnapSize());
@@ -505,9 +484,6 @@ void SwGridConfig::Load()
void SwGridConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/* -----------------------------19.01.01 13:07--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<OUString> SwCursorConfig::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -520,27 +496,21 @@ Sequence<OUString> SwCursorConfig::GetPropertyNames()
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
- pNames[i] = C2U(aPropNames[i]);
+ pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]);
return aNames;
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
SwCursorConfig::SwCursorConfig(SwMasterUsrPref& rPar) :
ConfigItem(C2U("Office.Writer/Cursor"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
rParent(rPar)
{
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
SwCursorConfig::~SwCursorConfig()
{
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
void SwCursorConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -562,15 +532,13 @@ void SwCursorConfig::Commit()
}
PutProperties(aNames, aValues);
}
-/* -----------------------------19.01.01 13:07--------------------------------
- ---------------------------------------------------------------------------*/
void SwCursorConfig::Load()
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
@@ -598,9 +566,6 @@ void SwCursorConfig::Load()
void SwCursorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/*-- 28.09.00 09:55:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) :
ConfigItem(C2U("Office.WriterWeb/Background"),
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
@@ -609,15 +574,11 @@ SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) :
{
aPropNames.getArray()[0] = C2U("Color");
}
-/*-- 28.09.00 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwWebColorConfig::~SwWebColorConfig()
{
}
-/*-- 28.09.00 09:55:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwWebColorConfig::Commit()
{
Sequence<Any> aValues(aPropNames.getLength());
@@ -634,14 +595,11 @@ void SwWebColorConfig::Commit()
void SwWebColorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/*-- 28.09.00 09:55:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwWebColorConfig::Load()
{
Sequence<Any> aValues = GetProperties(aPropNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aPropNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aPropNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aPropNames.getLength())
{
for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
@@ -661,3 +619,4 @@ void SwWebColorConfig::Load()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index b68c531e61ee..637862c2d8e1 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,25 +33,17 @@
#include <svx/htmlmode.hxx>
#include <svtools/htmlcfg.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <editeng/svxenum.hxx>
#include <editeng/svxacorr.hxx>
#include <unotools/localedatawrapper.hxx>
-#ifndef _REGION_HXX //autogen
#include <vcl/region.hxx>
-#endif
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <vcl/window.hxx>
#include <swmodule.hxx>
#include <swtypes.hxx>
#include <viewopt.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
#include <swrect.hxx>
#include <crstate.hxx>
#include <svtools/colorcfg.hxx>
@@ -59,7 +52,7 @@
#include <editeng/acorrcfg.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool SwViewOption::bTest9 = sal_False; //DrawingLayerNotLoading
#endif
Color SwViewOption::aDocBoundColor(COL_LIGHTGRAY);
@@ -79,9 +72,10 @@ Color SwViewOption::aFieldShadingsColor(COL_LIGHTGRAY);
Color SwViewOption::aSectionBoundColor(COL_LIGHTGRAY);
Color SwViewOption::aPageBreakColor(COL_BLUE);
Color SwViewOption::aScriptIndicatorColor(COL_GREEN);
+Color SwViewOption::aShadowColor(COL_GRAY);
sal_Int32 SwViewOption::nAppearanceFlags = VIEWOPT_DOC_BOUNDARIES|VIEWOPT_OBJECT_BOUNDARIES;
-sal_uInt16 SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm
+sal_uInt16 SwViewOption::nPixelTwips = 0; // one pixel on the screen
#define LINEBREAK_SIZE 12, 8
@@ -92,11 +86,7 @@ sal_uInt16 SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm
#define MIN_TABWIDTH 120
#define MIN_TABHEIGHT 200
-static const char __FAR_DATA aPostItStr[] = " ";
-
-/*************************************************************************
- * SwViewOption::IsEqualFlags()
- *************************************************************************/
+static const char aPostItStr[] = " ";
sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
{
@@ -114,8 +104,8 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
&& mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode
&& bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields
&& bIdle == rOpt.bIdle
-#ifdef DBG_UTIL
- // korrespondieren zu den Angaben in ui/config/cfgvw.src
+#if OSL_DEBUG_LEVEL > 1
+ // correspond to the statements in ui/config/cfgvw.src
&& bTest1 == rOpt.IsTest1()
&& bTest2 == rOpt.IsTest2()
&& bTest3 == rOpt.IsTest3()
@@ -129,10 +119,6 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
;
}
-/*************************************************************************
- * SwViewOption::DrawRect()
- *************************************************************************/
-
void SwViewOption::DrawRect( OutputDevice *pOut,
const SwRect &rRect, long nCol ) const
{
@@ -148,10 +134,6 @@ void SwViewOption::DrawRect( OutputDevice *pOut,
DrawRectPrinter( pOut, rRect );
}
-/*************************************************************************
- * SwViewOption::DrawRectPrinter()
- *************************************************************************/
-
void SwViewOption::DrawRectPrinter( OutputDevice *pOut,
const SwRect &rRect ) const
{
@@ -164,27 +146,19 @@ void SwViewOption::DrawRectPrinter( OutputDevice *pOut,
pOut->SetLineColor( aOldColor );
}
-/*************************************************************************
- * SwViewOption::GetPostItsWidth()
- *************************************************************************/
-
sal_uInt16 SwViewOption::GetPostItsWidth( const OutputDevice *pOut ) const
{
- ASSERT( pOut, "no Outdev" );
+ OSL_ENSURE( pOut, "no Outdev" );
return sal_uInt16(pOut->GetTextWidth( String::CreateFromAscii(aPostItStr )));
}
-/*************************************************************************
- * SwViewOption::PaintPostIts()
- *************************************************************************/
-
void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, sal_Bool bIsScript ) const
{
if( pOut && bIsScript )
{
Color aOldLineColor( pOut->GetLineColor() );
pOut->SetLineColor( Color(COL_GRAY ) );
- // Wir ziehen ueberall zwei Pixel ab, damit es schick aussieht
+ // to make it look nice, we subtract two pixels everywhere
sal_uInt16 nPix = GetPixelTwips() * 2;
if( rRect.Width() <= 2 * nPix || rRect.Height() <= 2 * nPix )
nPix = 0;
@@ -196,16 +170,8 @@ void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, sal_Bo
}
}
-
-/*************************************************************************
-|*
-|* ViewOption::ViewOption()
-|*
-|* Letzte Aenderung MA 04. Aug. 93
-|*
-|*************************************************************************/
-
SwViewOption::SwViewOption() :
+ sSymbolFont( RTL_CONSTASCII_USTRINGPARAM( "symbol" ) ),
aRetoucheColor( COL_TRANSPARENT ),
mnViewLayoutColumns( 0 ),
nPagePrevRow( 1 ),
@@ -220,13 +186,12 @@ SwViewOption::SwViewOption() :
mbBookView(sal_False),
mbViewLayoutBookMode(sal_False),
bShowPlaceHolderFields( sal_True ),
-
nZoom( 100 ),
eZoom( SVX_ZOOM_PERCENT ),
nTblDest(TBL_DEST_CELL)
{
- // Initialisierung ist jetzt etwas einfacher
- // alle Bits auf 0
+ // Initialisation is a little simpler now
+ // all Bits to 0
nCoreOptions = VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH |
VIEWOPT_1_REF |
VIEWOPT_1_GRAPHIC |
@@ -246,8 +211,8 @@ SwViewOption::SwViewOption() :
bIdle = true;
-#ifdef DBG_UTIL
- // korrespondieren zu den Angaben in ui/config/cfgvw.src
+#if OSL_DEBUG_LEVEL > 1
+ // correspond to the statements in ui/config/cfgvw.src
bTest1 = bTest2 = bTest3 = bTest4 =
bTest5 = bTest6 = bTest7 = bTest8 = bTest10 = sal_False;
#endif
@@ -257,9 +222,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
{
bReadonly = sal_False;
bSelectionInReadonly = sal_False;
- // --> FME 2004-06-29 #114856# Formular view
+ // #114856# Formular view
mbFormView = rVOpt.mbFormView;
- // <--
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
@@ -283,7 +247,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bTest1 = rVOpt.bTest1 ;
bTest2 = rVOpt.bTest2 ;
bTest3 = rVOpt.bTest3 ;
@@ -299,9 +263,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
{
- // --> DVO FME 2004-06-29 #114856# Formular view
+ // #114856# Formular view
mbFormView = rVOpt.mbFormView ;
- // <--
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
@@ -325,7 +288,7 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bTest1 = rVOpt.bTest1 ;
bTest2 = rVOpt.bTest2 ;
bTest3 = rVOpt.bTest3 ;
@@ -344,14 +307,6 @@ SwViewOption::~SwViewOption()
{
}
-/*************************************************************************
-|*
-|* ViewOption::Init()
-|*
-|* Letzte Aenderung MA 04. Aug. 93
-|*
-|*************************************************************************/
-
void SwViewOption::Init( Window *pWin )
{
if( !nPixelTwips && pWin )
@@ -362,14 +317,10 @@ void SwViewOption::Init( Window *pWin )
sal_Bool SwViewOption::IsAutoCompleteWords() const
{
- const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
- return /*rFlags.bAutoCompleteWords &&*/ rFlags.bAutoCmpltCollectWords;
+ const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
+ return rFlags.bAutoCmpltCollectWords;
}
-/*************************************************************************/
-/* */
-/*************************************************************************/
-
AuthorCharAttr::AuthorCharAttr() :
nItemId (SID_ATTR_CHAR_UNDERLINE),
nAttr (UNDERLINE_SINGLE),
@@ -377,18 +328,14 @@ AuthorCharAttr::AuthorCharAttr() :
{
}
-/*-----------------07.01.97 13.50-------------------
-
---------------------------------------------------*/
-
sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
{
sal_uInt16 nRet = 0;
if(!pShell || PTR_CAST(SwWebDocShell, pShell))
{
nRet = HTMLMODE_ON;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- switch ( pHtmlOpt->GetExportMode() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ switch ( rHtmlOpt.GetExportMode() )
{
case HTML_CFG_MSIE_40:
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
@@ -414,122 +361,92 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
}
return nRet;
}
-/* -----------------------------24.04.2002 10:20------------------------------
- ---------------------------------------------------------------------------*/
Color& SwViewOption::GetDocColor()
{
return aDocColor;
}
-/* -----------------------------23.04.2002 17:18------------------------------
- ---------------------------------------------------------------------------*/
Color& SwViewOption::GetDocBoundariesColor()
{
return aDocBoundColor;
}
-/* -----------------------------23.04.2002 17:53------------------------------
- ---------------------------------------------------------------------------*/
Color& SwViewOption::GetObjectBoundariesColor()
{
return aObjectBoundColor;
}
-/* -----------------------------24.04.2002 10:41------------------------------
- ---------------------------------------------------------------------------*/
Color& SwViewOption::GetAppBackgroundColor()
{
return aAppBackgroundColor;
}
-/*-- 24.04.2002 10:50:11---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetTableBoundariesColor()
{
return aTableBoundColor;
}
-/*-- 24.04.2002 10:50:12---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetIndexShadingsColor()
{
return aIndexShadingsColor;
}
-/*-- 24.04.2002 10:50:12---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetLinksColor()
{
return aLinksColor;
}
-/*-- 24.04.2002 10:50:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetVisitedLinksColor()
{
return aVisitedLinksColor;
}
-/*-- 24.04.2002 10:50:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetDirectCursorColor()
{
return aDirectCursorColor;
}
-/*-- 24.04.2002 10:50:14---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetTextGridColor()
{
return aTextGridColor;
}
-/*-- 24.04.2002 10:50:14---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetSpellColor()
{
return aSpellColor;
}
-/*-- 24.04.2007 10:50:14---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetSmarttagColor()
{
return aSmarttagColor;
}
-/*-- 06.12.2002 10:50:11---------------------------------------------------
- -----------------------------------------------------------------------*/
+Color& SwViewOption::GetShadowColor()
+{
+ return aShadowColor;
+}
+
Color& SwViewOption::GetFontColor()
{
return aFontColor;
}
-/*-- 24.04.2002 10:50:15---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetFieldShadingsColor()
{
return aFieldShadingsColor;
}
-/*-- 24.04.2002 10:50:15---------------------------------------------------
- -----------------------------------------------------------------------*/
Color& SwViewOption::GetSectionBoundColor()
{
return aSectionBoundColor;
}
-/* -----------------------------2002/07/31 14:00------------------------------
- ---------------------------------------------------------------------------*/
Color& SwViewOption::GetPageBreakColor()
{
return aPageBreakColor;
}
-/* -----------------------------23.04.2002 17:41------------------------------
-
- ---------------------------------------------------------------------------*/
void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig )
{
aDocColor.SetColor(rConfig.GetColorValue(svtools::DOCCOLOR).nColor);
@@ -567,6 +484,11 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig )
if(aValue.bIsVisible)
nAppearanceFlags |= VIEWOPT_VISITED_LINKS;
+ aValue = rConfig.GetColorValue(svtools::SHADOWCOLOR);
+ aShadowColor.SetColor(aValue.nColor);
+ if(aValue.bIsVisible)
+ nAppearanceFlags |= VIEWOPT_SHADOW;
+
aDirectCursorColor.SetColor(rConfig.GetColorValue(svtools::WRITERDIRECTCURSOR).nColor);
aTextGridColor.SetColor(rConfig.GetColorValue(svtools::WRITERTEXTGRID).nColor);
@@ -592,9 +514,7 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig )
aScriptIndicatorColor.SetColor(rConfig.GetColorValue(svtools::WRITERSCRIPTINDICATOR).nColor);
}
-/* -----------------------------23.04.2002 17:48------------------------------
- ---------------------------------------------------------------------------*/
void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bSaveInConfig )
{
if(bSet)
@@ -620,6 +540,7 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bS
{ VIEWOPT_VISITED_LINKS , svtools::LINKSVISITED },
{ VIEWOPT_FIELD_SHADINGS , svtools::WRITERFIELDSHADINGS },
{ VIEWOPT_SECTION_BOUNDARIES , svtools::WRITERSECTIONBOUNDARIES },
+ { VIEWOPT_SHADOW , svtools::SHADOWCOLOR },
{ 0 , svtools::ColorConfigEntryCount }
};
sal_uInt16 nPos = 0;
@@ -635,11 +556,10 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bS
}
}
}
-/* -----------------------------24.04.2002 10:42------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwViewOption::IsAppearanceFlag(sal_Int32 nFlag)
{
return 0 != (nAppearanceFlags & nFlag);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 0b5b9127b066..95d6c9bb2184 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
#include <mmaddressblockpage.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <dbconfig.hxx>
#include <unotools/tempfile.hxx>
#include <vcl/msgbox.hxx>
@@ -55,9 +54,7 @@
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
-#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSERFACTORY_HPP_
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
-#endif
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdb/XQueriesSupplier.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
@@ -88,12 +85,8 @@ using namespace ::rtl;
#define ITEMID_NAME 1
#define ITEMID_TABLE 2
-//typedef SharedUNOComponent< XConnection > SharedConnection;
-
static const char* cUTF8 = "UTF-8";
-/*-- 07.05.2004 14:11:34---------------------------------------------------
- -----------------------------------------------------------------------*/
struct AddressUserData_Impl
{
uno::Reference<XDataSource> xSource;
@@ -109,6 +102,7 @@ struct AddressUserData_Impl
nTableAndQueryCount(-1)
{}
};
+
::rtl::OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet>& xSourceProperties )
{
::rtl::OUString sURL;
@@ -154,9 +148,7 @@ struct AddressUserData_Impl
}
return sURL;
}
-/*-- 07.04.2004 16:35:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
SfxModalDialog(pParent, SW_RES(DLG_MM_ADDRESSLISTDIALOG)),
#ifdef MSC
@@ -233,7 +225,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem();
const SwDBData& rCurrentData = rConfigItem.GetCurrentDBData();
- DBG_ASSERT(m_xDBContext.is(), "service 'com.sun.star.sdb.DatabaseContext' not found!");
+ OSL_ENSURE(m_xDBContext.is(), "service 'com.sun.star.sdb.DatabaseContext' not found!");
sal_Bool bEnableEdit = sal_False;
sal_Bool bEnableOK = sal_True;
m_aListLB.SelectAll( sal_False );
@@ -284,9 +276,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
m_aListLB.SetSelectHdl(LINK(this, SwAddressListDialog, ListBoxSelectHdl_Impl));
TableSelectHdl_Impl(NULL);
}
-/*-- 07.04.2004 16:35:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddressListDialog::~SwAddressListDialog()
{
SvLBoxEntry* pEntry = m_aListLB.First();
@@ -297,9 +287,7 @@ SwAddressListDialog::~SwAddressListDialog()
pEntry = m_aListLB.Next( pEntry );
}
}
-/*-- 07.04.2004 16:35:44---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG)
{
SvLBoxEntry* pSelect = m_aListLB.FirstSelected();
@@ -359,15 +347,13 @@ IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG)
}
catch(Exception& )
{
- DBG_ERROR("exception caught in SwAddressListDialog::FilterHdl_Impl");
+ OSL_FAIL("exception caught in SwAddressListDialog::FilterHdl_Impl");
}
}
}
return 0;
}
-/*-- 07.04.2004 16:35:44---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, LoadHdl_Impl, PushButton*, EMPTYARG)
{
String sNewSource = SwNewDBMgr::LoadAndRegisterDataSource();
@@ -379,9 +365,7 @@ IMPL_LINK(SwAddressListDialog, LoadHdl_Impl, PushButton*, EMPTYARG)
}
return 0;
}
-/*-- 07.04.2004 16:35:44---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
{
String sInputURL;
@@ -433,7 +417,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
pInfo[2].Name = C2U("Extension");
pInfo[2].Value <<= ::rtl::OUString(aURL.getExtension());//C2U("csv");
pInfo[3].Name = C2U("CharSet");
- pInfo[3].Value <<= C2U(cUTF8);
+ pInfo[3].Value <<= rtl::OUString::createFromAscii(cUTF8);
aAny <<= aInfo;
xDataProperties->setPropertyValue(C2U("Info"), aAny);
@@ -471,9 +455,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
delete pDlg;
return 0;
}
-/*-- 22.04.2004 10:30:40---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton)
{
SvLBoxEntry* pEntry = m_aListLB.FirstSelected();
@@ -505,9 +487,7 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton)
}
return 0;
};
-/*-- 19.04.2004 09:41:05---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, ListBoxSelectHdl_Impl, SvTabListBox*, EMPTYARG)
{
SvLBoxEntry* pSelect = m_aListLB.FirstSelected();
@@ -515,6 +495,7 @@ IMPL_LINK(SwAddressListDialog, ListBoxSelectHdl_Impl, SvTabListBox*, EMPTYARG)
StaticListBoxSelectHdl_Impl ), pSelect );
return 0;
}
+
IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, pSelect)
{
//prevent nested calls of the select handler
@@ -538,6 +519,18 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*,
pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData());
if(pUserData->nTableAndQueryCount > 1 || pUserData->nTableAndQueryCount == -1)
{
+ /*
+ * We're a callback from a selection from a list box, which takes
+ * place on mouse down before mouse up. The next dialog also has a
+ * list box. Spawning it means this list box doesn't get the mouse
+ * down event. So it sticks on "making selection" mode. So if you
+ * cancel the next dialog and just move the mouse out of this entry
+ * and back then the dialog pops up again, without requiring a click
+ *
+ * Most expedient thing to do is to manually end the parent selection
+ * here.
+ */
+ pThis->m_aListLB.EndSelection();
pThis->DetectTablesAndQueries(pSelect, !sTable.Len());
}
else
@@ -560,10 +553,8 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*,
return 0;
}
-/*-- 13.05.2004 14:59:25---------------------------------------------------
- detect the number of tables for a data source
- if only one is available then set it at the entry
- -----------------------------------------------------------------------*/
+// detect the number of tables for a data source
+// if only one is available then set it at the entry
void SwAddressListDialog::DetectTablesAndQueries(
SvLBoxEntry* pSelect,
bool bWidthDialog)
@@ -656,14 +647,11 @@ void SwAddressListDialog::DetectTablesAndQueries(
}
catch(Exception& )
{
- DBG_ERROR("exception caught in SwAddressListDialog::DetectTablesAndQueries");
+ OSL_FAIL("exception caught in SwAddressListDialog::DetectTablesAndQueries");
m_aOK.Enable( sal_False );
}
}
-/*-- 13.05.2004 12:55:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton)
{
EnterWait();
@@ -684,18 +672,12 @@ IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton)
return 0;
}
-/*-- 08.04.2004 14:52:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressListDialog, OKHdl_Impl, PushButton*, EMPTYARG)
{
EndDialog(sal_True);
return 0;
}
-/*-- 07.05.2004 14:17:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< XDataSource> SwAddressListDialog::GetSource()
{
uno::Reference< XDataSource> xRet;
@@ -708,9 +690,7 @@ uno::Reference< XDataSource> SwAddressListDialog::GetSource()
return xRet;
}
-/*-- 07.05.2004 14:17:48---------------------------------------------------
- -----------------------------------------------------------------------*/
SharedConnection SwAddressListDialog::GetConnection()
{
SharedConnection xRet;
@@ -722,9 +702,7 @@ SharedConnection SwAddressListDialog::GetConnection()
}
return xRet;
}
-/*-- 07.05.2004 14:17:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier()
{
uno::Reference< XColumnsSupplier> xRet;
@@ -736,9 +714,7 @@ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier()
}
return xRet;
}
-/*-- 14.05.2004 15:04:09---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwAddressListDialog::GetFilter()
{
::rtl::OUString sRet;
@@ -750,3 +726,5 @@ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier()
}
return sRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx
index 0623df315d39..bf84b16a8157 100644
--- a/sw/source/ui/dbui/addresslistdialog.hxx
+++ b/sw/source/ui/dbui/addresslistdialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/basedlgs.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/svtabbx.hxx>
#include <svtools/headbar.hxx>
#include <swdbdata.hxx>
@@ -51,9 +50,7 @@ namespace com{namespace sun{namespace star{
}
}}}
class SwMailMergeAddressBlockPage;
-/*-- 08.04.2004 14:04:29---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwAddressListDialog : public SfxModalDialog
{
FixedInfo m_aDescriptionFI;
@@ -86,9 +83,7 @@ class SwAddressListDialog : public SfxModalDialog
SwMailMergeAddressBlockPage* m_pAddressPage;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xDBContext;
-// ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> m_xSource;
-// ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection;
-// ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> m_xColumnsSupplier;
+
SwDBData m_aDBData;
void DetectTablesAndQueries(SvLBoxEntry* pSelect, bool bWidthDialog);
@@ -120,3 +115,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 1eeedd3a0e0f..1c63829ba54d 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include <mmconfigitem.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SVT_CONTROLDIMS_HRC_
#include <svtools/controldims.hrc>
-#endif
#include <unotools/pathoptions.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfilt.hxx>
@@ -60,9 +59,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::ui::dialogs;
using ::rtl::OUString;
-/*-- 19.04.2004 12:19:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwAddressControl_Impl : public Control
{
ScrollBar m_aScrollBar;
@@ -100,9 +96,6 @@ public:
void SetCursorTo(sal_uInt32 nElement);
};
-/*-- 13.04.2004 10:09:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwAddressControl_Impl::SwAddressControl_Impl(Window* pParent, const ResId& rResId ) :
Control(pParent, rResId),
#ifdef MSC
@@ -126,9 +119,7 @@ SwAddressControl_Impl::SwAddressControl_Impl(Window* pParent, const ResId& rResI
m_aScrollBar.EnableDrag();
}
-/*-- 13.04.2004 10:09:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddressControl_Impl::~SwAddressControl_Impl()
{
::std::vector<FixedText*>::iterator aTextIter;
@@ -138,9 +129,7 @@ SwAddressControl_Impl::~SwAddressControl_Impl()
for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
delete *aEditIter;
}
-/*-- 19.04.2004 12:22:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
{
m_pData = &rDBData;
@@ -189,7 +178,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
Link aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl);
Edit* pLastEdit = 0;
sal_Int32 nVisibleLines = 0;
- sal_Int32 nLines = 0;
+ sal_uIntPtr nLines = 0;
for(aHeaderIter = m_pData->aDBColumnHeaders.begin();
aHeaderIter != m_pData->aDBColumnHeaders.end();
++aHeaderIter, nEDYPos += m_nLineHeight, nFTYPos += m_nLineHeight, nLines++)
@@ -238,23 +227,21 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
}
}
-/*-- 21.04.2004 11:37:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet)
{
if(m_bNoDataSet || m_nCurrentDataSet != nSet)
{
m_bNoDataSet = false;
m_nCurrentDataSet = nSet;
- DBG_ASSERT(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index");
+ OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index");
if(m_pData->aDBData.size() > m_nCurrentDataSet)
{
::std::vector<Edit*>::iterator aEditIter;
sal_uInt32 nIndex = 0;
for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex)
{
- DBG_ASSERT(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(),
+ OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(),
"number of colums doesn't match number of Edits");
(*aEditIter)->SetText(m_pData->aDBData[m_nCurrentDataSet][nIndex]);
}
@@ -262,9 +249,6 @@ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet)
}
}
-/*-- 19.04.2004 14:17:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll)
{
long nThumb = pScroll->GetThumbPos();
@@ -272,9 +256,7 @@ IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll)
return 0;
}
-/*-- 19.04.2004 16:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit)
{
if(0 != (GETFOCUS_TAB & pEdit->GetGetFocusFlags()))
@@ -284,9 +266,7 @@ IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit)
}
return 0;
}
-/*-- 21.04.2004 14:56:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect)
{
long nThumb = m_aScrollBar.GetThumbPos();
@@ -307,24 +287,21 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect)
ScrollHdl_Impl(&m_aScrollBar);
}
}
-/*-- 19.04.2004 16:16:25---------------------------------------------------
- copy data changes into database
- -----------------------------------------------------------------------*/
+
+// copy data changes into database
IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit*, pEdit)
{
//get the data element number of the current set
sal_Int32 nIndex = (sal_Int32)(sal_IntPtr)pEdit->GetData();
//get the index of the set
- DBG_ASSERT(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" );
+ OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" );
if(m_pData->aDBData.size() > m_nCurrentDataSet)
{
m_pData->aDBData[m_nCurrentDataSet][nIndex] = pEdit->GetText();
}
return 0;
}
-/*-- 21.04.2004 14:51:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressControl_Impl::SetCursorTo(sal_uInt32 nElement)
{
if(nElement < m_aEdits.size())
@@ -336,9 +313,7 @@ void SwAddressControl_Impl::SetCursorTo(sal_uInt32 nElement)
}
}
-/*-- 19.04.2004 16:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressControl_Impl::Command( const CommandEvent& rCEvt )
{
switch ( rCEvt.GetCommand() )
@@ -358,9 +333,7 @@ void SwAddressControl_Impl::Command( const CommandEvent& rCEvt )
Control::Command(rCEvt);
}
}
-/*-- 19.04.2004 16:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
long SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt )
{
if(rNEvt.GetType() == EVENT_COMMAND)
@@ -375,9 +348,7 @@ long SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt )
}
return Control::PreNotify(rNEvt);
}
-/*-- 13.04.2004 10:08:59---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCreateAddressListDialog::SwCreateAddressListDialog(
Window* pParent, const String& rURL, SwMailMergeConfigItem& rConfig) :
SfxModalDialog(pParent, SW_RES(DLG_MM_CREATEADDRESSLIST)),
@@ -452,7 +423,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
for( xub_StrLen nToken = 0; nToken < nHeaders; ++nToken)
{
String sHeader = sLine.GetToken( 0, '\t', nIndex );
- DBG_ASSERT(sHeader.Len() > 2 &&
+ OSL_ENSURE(sHeader.Len() > 2 &&
sHeader.GetChar(0) == '\"' && sHeader.GetChar(sHeader.Len() - 1) == '\"',
"Wrong format of header");
if(sHeader.Len() > 2)
@@ -470,7 +441,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
for( xub_StrLen nToken = 0; nToken < nDataCount; ++nToken)
{
String sData = sLine.GetToken( 0, '\t', nIndex );
- DBG_ASSERT(sData.Len() >= 2 &&
+ OSL_ENSURE(sData.Len() >= 2 &&
sData.GetChar(0) == '\"' && sData.GetChar(sData.Len() - 1) == '\"',
"Wrong format of line");
if(sData.Len() >= 2)
@@ -500,19 +471,14 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
m_aSetNoNF.SetMax(m_pCSVData->aDBData.size());
UpdateButtons();
}
-/*-- 13.04.2004 10:08:59---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCreateAddressListDialog::~SwCreateAddressListDialog()
{
delete m_pAddressControl;
delete m_pCSVData;
delete m_pFindDlg;
}
-/*-- 13.04.2004 10:08:59---------------------------------------------------
- add a new data set of empty strings and set the address input control
- to that new set
- -----------------------------------------------------------------------*/
+
IMPL_LINK(SwCreateAddressListDialog, NewHdl_Impl, PushButton*, EMPTYARG)
{
sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet();
@@ -528,9 +494,7 @@ IMPL_LINK(SwCreateAddressListDialog, NewHdl_Impl, PushButton*, EMPTYARG)
UpdateButtons();
return 0;
}
-/*-- 13.04.2004 10:09:00---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCreateAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
{
sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet();
@@ -552,9 +516,7 @@ IMPL_LINK(SwCreateAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
UpdateButtons();
return 0;
}
-/*-- 13.04.2004 10:09:00---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCreateAddressListDialog, FindHdl_Impl, PushButton*, EMPTYARG)
{
if(!m_pFindDlg)
@@ -572,9 +534,7 @@ IMPL_LINK(SwCreateAddressListDialog, FindHdl_Impl, PushButton*, EMPTYARG)
m_pFindDlg->Show(!m_pFindDlg->IsVisible());
return 0;
}
-/*-- 13.04.2004 10:09:00---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton)
{
SwCustomizeAddressListDialog* pDlg = new SwCustomizeAddressListDialog(pButton, *m_pCSVData);
@@ -600,10 +560,7 @@ IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton)
}
return 0;
}
-/*-- 23.04.2004 09:02:51---------------------------------------------------
- writes the data into a .csv file
- encoding is UTF8, separator is tab, strings are enclosed into "
- -----------------------------------------------------------------------*/
+
IMPL_LINK(SwCreateAddressListDialog, OkHdl_Impl, PushButton*, EMPTYARG)
{
if(!m_sURL.Len())
@@ -677,9 +634,7 @@ IMPL_LINK(SwCreateAddressListDialog, OkHdl_Impl, PushButton*, EMPTYARG)
return 0;
}
-/*-- 13.04.2004 10:09:01---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, PushButton*, pButton)
{
sal_uInt32 nValue = static_cast< sal_uInt32 >(m_aSetNoNF.GetValue());
@@ -705,18 +660,14 @@ IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, PushButton*, pButton)
}
return 0;
}
-/*-- 21.04.2004 12:06:47---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCreateAddressListDialog, DBNumCursorHdl_Impl, NumericField*, EMPTYARG)
{
m_pAddressControl->SetCurrentDataSet( static_cast< sal_uInt32 >(m_aSetNoNF.GetValue() - 1) );
UpdateButtons();
return 0;
}
-/*-- 21.04.2004 13:22:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwCreateAddressListDialog::UpdateButtons()
{
sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_aSetNoNF.GetValue() );
@@ -727,9 +678,7 @@ void SwCreateAddressListDialog::UpdateButtons()
m_aEndPB.Enable(nCurrent != nSize);
m_aDeletePB.Enable(nSize > 0);
}
-/*-- 21.04.2004 13:22:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn)
{
OUString sSearch = rSearch;
@@ -774,9 +723,7 @@ void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn)
m_pAddressControl->SetCursorTo(nElement);
}
}
-/*-- 13.04.2004 13:48:38---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) :
ModelessDialog(pParent, SW_RES(DLG_MM_FIND_ENTRY)),
#ifdef MSC
@@ -799,15 +746,11 @@ SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) :
m_aFindED.SetModifyHdl(LINK(this, SwFindEntryDialog, FindEnableHdl_Impl));
m_aCancel.SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl));
}
-/*-- 13.04.2004 13:48:38---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFindEntryDialog::~SwFindEntryDialog()
{
}
-/*-- 21.04.2004 13:37:46---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwFindEntryDialog, FindHdl_Impl, PushButton*, EMPTYARG)
{
sal_Int32 nColumn = -1;
@@ -817,19 +760,17 @@ IMPL_LINK(SwFindEntryDialog, FindHdl_Impl, PushButton*, EMPTYARG)
m_pParent->Find(m_aFindED.GetText(), nColumn);
return 0;
}
-/*-- 21.04.2004 13:37:46---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwFindEntryDialog, FindEnableHdl_Impl, Edit*, EMPTYARG)
{
m_aFindPB.Enable(m_aFindED.GetText().Len() > 0);
return 0;
}
-/*-- 21.04.2004 15:36:36---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwFindEntryDialog, CloseHdl_Impl, PushButton*, EMPTYARG)
{
Show(sal_False);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx
index b900d7d21ff6..6c9b64546a05 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.hxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <vcl/field.hxx>
#include <vcl/lstbox.hxx>
@@ -39,17 +38,14 @@
class SwAddressControl_Impl;
class SwMailMergeConfigItem;
-/*-- 19.04.2004 12:09:46---------------------------------------------------
- container of the created database
- -----------------------------------------------------------------------*/
+
+// container of the created database
struct SwCSVData
{
::std::vector< ::rtl::OUString > aDBColumnHeaders;
::std::vector< ::std::vector< ::rtl::OUString> > aDBData;
};
-/*-- 08.04.2004 14:04:39---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwFindEntryDialog;
class SwCreateAddressListDialog : public SfxModalDialog
{
@@ -98,9 +94,7 @@ public:
const String& GetURL() const { return m_sURL; }
void Find( const String& rSearch, sal_Int32 nColumn);
};
-/*-- 13.04.2004 13:30:21---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwFindEntryDialog : public ModelessDialog
{
FixedText m_aFindFT;
@@ -128,3 +122,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/createaddresslistdialog.src b/sw/source/ui/dbui/createaddresslistdialog.src
index 5f51d6a300fb..9911007c78f7 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.src
+++ b/sw/source/ui/dbui/createaddresslistdialog.src
@@ -29,9 +29,6 @@
#include <dbui.hrc>
#include <helpid.h>
-/*-- 13.04.2004 13:58:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
ModalDialog DLG_MM_CREATEADDRESSLIST
{
OutputSize = TRUE ;
@@ -173,9 +170,6 @@ ModalDialog DLG_MM_CREATEADDRESSLIST
};
};
-/*-- 13.04.2004 13:58:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
ModelessDialog DLG_MM_FIND_ENTRY
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
index d1da798202c0..b7be738f7019 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,11 +41,6 @@
#include <dbui.hrc>
#include <helpid.h>
-
-
-/*-- 13.04.2004 14:27:21---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwCustomizeAddressListDialog::SwCustomizeAddressListDialog(
Window* pParent, const SwCSVData& rOldData) :
SfxModalDialog(pParent, SW_RES(DLG_MM_CUSTOMIZE_ADDRESS_LIST)),
@@ -86,24 +82,17 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog(
m_aFieldsLB.SelectEntryPos(0);
UpdateButtons();
}
-/*-- 13.04.2004 14:34:07---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCustomizeAddressListDialog::~SwCustomizeAddressListDialog()
{
}
-/*-- 12.08.2004 12:58:00---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl, ListBox*, EMPTYARG)
{
UpdateButtons();
return 0;
}
-/*-- 13.04.2004 15:02:14---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
{
bool bRename = pButton == &m_aRenamePB;
@@ -147,9 +136,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
UpdateButtons();
return 0;
}
-/*-- 13.04.2004 15:02:14---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
{
sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos();
@@ -166,9 +153,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
UpdateButtons();
return 0;
}
-/*-- 13.04.2004 15:02:15---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton)
{
sal_uInt16 nPos;
@@ -196,9 +181,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton)
UpdateButtons();
return 0;
}
-/*-- 19.04.2004 14:51:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwCustomizeAddressListDialog::UpdateButtons()
{
sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos();
@@ -208,17 +191,12 @@ void SwCustomizeAddressListDialog::UpdateButtons()
m_aDeletePB.Enable(nEntries > 0);
m_aRenamePB.Enable(nEntries > 0);
}
-/*-- 19.04.2004 14:51:49---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCSVData* SwCustomizeAddressListDialog::GetNewData()
{
return m_pNewData;
}
-/*-- 13.04.2004 13:48:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwAddRenameEntryDialog::SwAddRenameEntryDialog(
Window* pParent, bool bRename, const ::std::vector< ::rtl::OUString >& rCSVHeader) :
SfxModalDialog(pParent, SW_RES(DLG_MM_ADD_RENAME_ENTRY)),
@@ -243,15 +221,11 @@ SwAddRenameEntryDialog::SwAddRenameEntryDialog(
m_aFieldNameED.SetModifyHdl(LINK(this, SwAddRenameEntryDialog, ModifyHdl_Impl));
ModifyHdl_Impl( &m_aFieldNameED );
}
-/*-- 13.04.2004 13:48:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddRenameEntryDialog::~SwAddRenameEntryDialog()
{
}
-/*-- 19.04.2004 15:31:34---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit)
{
::rtl::OUString sEntry = pEdit->GetText();
@@ -272,3 +246,5 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit)
m_aOK.Enable(!bFound);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx
index 42298a463cbf..1989499cb7f7 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,13 @@
#define _CUSTOMIZEADDRESSLISTDIALOG_HXX
#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <vcl/field.hxx>
#include <vcl/lstbox.hxx>
struct SwCSVData;
-/*-- 08.04.2004 14:04:39---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwCustomizeAddressListDialog : public SfxModalDialog
{
FixedText m_aFieldsFT;
@@ -71,9 +68,7 @@ public:
SwCSVData* GetNewData();
};
-/*-- 13.04.2004 13:30:21---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwAddRenameEntryDialog : public SfxModalDialog
{
FixedText m_aFieldNameFT;
@@ -97,3 +92,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.src b/sw/source/ui/dbui/customizeaddresslistdialog.src
index 29de352b4cf3..6c4ae08a4d9c 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.src
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.src
@@ -29,9 +29,6 @@
#include <dbui.hrc>
#include <helpid.h>
-/*-- 13.04.2004 13:58:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST
{
OutputSize = TRUE ;
@@ -114,9 +111,7 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
-/*-- 13.04.2004 13:58:13---------------------------------------------------
- -----------------------------------------------------------------------*/
ModalDialog DLG_MM_ADD_RENAME_ENTRY
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 64a3e3f455a0..f50805fabf99 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,7 +108,6 @@
#include <unomid.h>
#include <IDocumentMarkAccess.hxx>
-
namespace swui
{
SwAbstractDialogFactory * GetFactory();
@@ -128,7 +128,7 @@ SV_IMPL_PTRARR( _SwTableAutoFmtTbl, SwTableAutoFmt* )
const char cDBFldStart = '<';
const char cDBFldEnd = '>';
-// Hilfsstruktur fuers einfuegen von Datenbankspalten als Felder oder Text
+// Helper structure for adding database rows as fields or text
struct _DB_Column
{
enum ColType { DB_FILLTEXT, DB_COL_FIELD, DB_COL_TEXT, DB_SPLITPARA } eColType;
@@ -210,15 +210,11 @@ private:
_DB_ColumnConfigData& operator =( const _DB_ColumnConfigData& );
};
-/* */
-
int SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const
{
return 0 > GetAppCollator().compareString( sColumn, rCmp.sColumn );
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
Reference<XDataSource> xDataSource,
Reference<sdbcx::XColumnsSupplier> xColSupp,
@@ -358,7 +354,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
}
catch(const Exception& )
{
- DBG_ERROR("illegal number format key");
+ OSL_FAIL("illegal number format key");
}
}
}
@@ -373,13 +369,13 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
}
if( !aDBColumns.Insert( pNew ))
{
- ASSERT( !this, "Spaltenname mehrfach vergeben?" );
+ OSL_ENSURE( !this, "Spaltenname mehrfach vergeben?" );
delete pNew;
}
}
}
- // Absatzvorlagen-ListBox fuellen
+ // fill paragraph templates-ListBox
{
SfxStyleSheetBasePool* pPool = pView->GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
@@ -394,7 +390,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
aLbDbParaColl.SelectEntryPos( 0 );
}
- // steht der Cursor in einer Tabelle, darf NIE Tabelle auswaehlbar sein
+ // when the cursor is inside of a table, table must NEVER be selectable
if( pView->GetWrtShell().GetTableFmt() )
{
aRbAsTable.Enable( sal_False );
@@ -450,23 +446,18 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
// read configuration
Load();
- // Controls initialisieren:
+ // initialise Controls:
PageHdl( aRbAsTable.IsChecked() ? &aRbAsTable : &aRbAsField );
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwInsertDBColAutoPilot::~SwInsertDBColAutoPilot()
{
delete pTblSet;
delete pRep;
-// delete pConfig;
delete pTAutoFmt;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton )
{
sal_Bool bShowTbl = pButton == &aRbAsTable;
@@ -500,9 +491,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton )
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton )
{
sal_uInt16 nFndPos;
@@ -521,9 +510,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton )
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
{
sal_Bool bChgEnable = sal_True, bEnableTo = sal_True, bEnableFrom = sal_True;
@@ -572,7 +559,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
nDelPos = aLbTableCol.GetSelectEntryPos(),
nTopPos = aLbTableCol.GetTopEntry();
- // die richtige InsertPos suchen!!
+ // look for the right InsertPos!!
SwInsDBColumn aSrch( aLbTableCol.GetEntry( nDelPos ), 0 );
aDBColumns.Seek_Entry( &aSrch, &nFndPos );
if( !nFndPos || nFndPos == aDBColumns.Count()-1 )
@@ -616,7 +603,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
else if( pButton == &aIbDbcolToEdit )
{
bChgEnable = sal_False;
- // Daten ins Edit moven:
+ // move data to Edit:
String aFld( aLbTxtDbColumn.GetSelectEntry() );
if( aFld.Len() )
{
@@ -624,20 +611,20 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
sal_uInt16 nPos = (sal_uInt16)aEdDbText.GetSelection().Min();
sal_uInt16 nSel = sal_uInt16(aEdDbText.GetSelection().Max()) - nPos;
if( nSel )
- // dann loesche erstmal die bestehende Selektion
+ // first delete the existing selection
aStr.Erase( nPos, nSel );
aFld.Insert( cDBFldStart, 0 );
aFld += cDBFldEnd;
if( aStr.Len() )
{
- if( nPos ) // ein Space davor
+ if( nPos ) // one blank in front
{
sal_Unicode c = aStr.GetChar( nPos-1 );
if( '\n' != c && '\r' != c )
aFld.Insert( ' ', 0 );
}
- if( nPos < aStr.Len() ) // ein Space dahinter
+ if( nPos < aStr.Len() ) // one blank behind
{
sal_Unicode c = aStr.GetChar( nPos );
if( '\n' != c && '\r' != c )
@@ -670,9 +657,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox*, pBox )
{
Button* pButton = 0;
@@ -688,9 +673,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox*, pBox )
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
{
SwWrtShell& rSh = pView->GetWrtShell();
@@ -700,7 +683,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
bNewSet = sal_True;
pTblSet = new SfxItemSet( rSh.GetAttrPool(), SwuiGetUITableAttrRange() );
- //Ersteinmal die einfachen Attribute besorgen.
+ // At first acquire the simple attributes
pTblSet->Put( SfxStringItem( FN_PARAM_TABLE_NAME, rSh.GetUniqueTblName() ));
pTblSet->Put( SfxUInt16Item( FN_PARAM_TABLE_HEADLINE, 1 ) );
@@ -713,15 +696,15 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
pTblSet->Put( aBrush, SID_ATTR_BRUSH_TABLE );
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
- // Tabellenvariante, wenn mehrere Tabellenzellen selektiert
+ // table variant, when multiple table cells are selected
aBoxInfo.SetTable( sal_True );
- // Abstandsfeld immer anzeigen
+ // always show gap field
aBoxInfo.SetDist( sal_True);
- // Minimalgroesse in Tabellen und Absaetzen setzen
+ // set minimum size in tables and paragraphs
aBoxInfo.SetMinDist( sal_False );
- // Default-Abstand immer setzen
+ // always set default-gap
aBoxInfo.SetDefDist( MIN_BORDER_DIST );
- // Einzelne Linien koennen nur in Tabellen DontCare-Status haben
+ // Single lines can have DontCare-status only in tables
aBoxInfo.SetValid( VALID_DISABLE, sal_True );
pTblSet->Put( aBoxInfo );
@@ -735,7 +718,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
const SwFmtCol& rCol = aPara.pFrmFmt->GetCol();
const SwColumns& rCols = rCol.GetColumns();
- //nStart und nEnd initialisieren fuer nNum == 0
+ // initialise nStart und nEnd for nNum == 0
long nWidth1 = 0,
nStart1 = 0,
nEnd1 = nWidth;
@@ -771,8 +754,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
if( aLbTableCol.GetEntryCount() != pRep->GetAllColCount() )
{
- // Anzahl der Spalten hat sich geaendert: dann muessen die
- // TabCols angepasst werden
+ // Number of columns has changed: then the TabCols have to be adjusted
long nWidth = pRep->GetWidth();
sal_uInt16 nCols = aLbTableCol.GetEntryCount() - 1;
SwTabCols aTabCols( nCols );
@@ -794,10 +776,10 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
}
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTableTabDlg( pButton, rSh.GetAttrPool(),pTblSet, &rSh, DLG_FORMAT_TABLE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute() )
pTblSet->Put( *pDlg->GetOutputItemSet() );
else if( bNewSet )
@@ -809,24 +791,20 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, AutoFmtHdl, PushButton*, pButton )
{
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(),DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute())
pDlg->FillAutoFmtOfIndex( pTAutoFmt );
delete pDlg;
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
{
ListBox* pGetBox = pBox == &aLbDbFmtFromUsr
@@ -851,8 +829,8 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
}
else
{
- // an der FormatGroupBox den ausgewaehlten FeldNamen setzen, damit
- // klar ist, welches Feld ueber das Format eingestellt wird!
+ // set the selected FieldName at the FormatGroupBox, so that
+ // it's clear what field is configured by the format!
String sTxt( aFlFormat.GetText().Copy( 0, nGBFmtLen ));
if( !aSrch.sColumn.getLength() )
{
@@ -881,16 +859,14 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
aFlFormat.SetText( sTxt );
- // um spaeter zu wissen, welche ListBox die "aktive" war, wird sich
- // im 1. Eintrag ein Flag gemerkt,
+ // to know later on, what ListBox was the "active", a Flag
+ // is remembered in the 1st entry
void* pPtr = pBox == &aLbTableCol ? &aLbTableCol : 0;
aLbTableCol.SetEntryData( 0, pPtr );
}
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton )
{
if( pButton == &aCbTableHeadon )
@@ -902,9 +878,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton )
}
return 0;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr )
{
_DB_Column* pNew;
@@ -926,17 +900,14 @@ static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr )
rColArr.Insert( pNew, rColArr.Count() );
}
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
_DB_Columns& rColArr,
sal_Bool bInsField )
{
- // aus dem Text wieder die einzelnen Datenbank - Spalten erzeugen
- // und dann in einem Array speichern
- // Die Datenbankspalten stehen in <> und muessen im Array der Spalten
- // vorhanden sein:
+ // create each of the database columns from the text again
+ // and then save in an array
+ // database columns are in <> and must be present in the columns' array:
String sTxt( rTxt );
sal_uInt16 nFndPos, nEndPos, nSttPos = 0;
@@ -945,12 +916,12 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
nSttPos = nFndPos + 1;
if( STRING_NOTFOUND != ( nEndPos = sTxt.Search( cDBFldEnd, nSttPos+1 )))
{
- // Text in <> geklammert gefunden: was ist es denn:
+ // Text in <> brackets found: what is it:
SwInsDBColumn aSrch( sTxt.Copy( nSttPos, nEndPos - nSttPos ), 0);
if( aDBColumns.Seek_Entry( &aSrch, &nFndPos ) )
{
- // das ist ein gueltiges Feld
- // also sicher den Text "davor":
+ // that is a valid field
+ // so surely the text "before":
const SwInsDBColumn& rFndCol = *aDBColumns[ nFndPos ];
_DB_Column* pNew;
@@ -998,15 +969,13 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
}
}
- // den letzten Text nicht vergessen
+ // don't forget the last text
if( sTxt.Len() )
::lcl_InsTextInArr( sTxt, rColArr );
return 0 != rColArr.Count();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
Reference< XDataSource> xSource,
Reference< XConnection> xConnection,
@@ -1058,7 +1027,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
else
++nRows;
- // bereite das Array fuer die ausgewaehlten Spalten auf
+ // prepare the array for the selected columns
SwInsDBColumns_SAR aColFlds( 255 >= nCols ? (sal_uInt8)nCols : 255, 5 );
for( n = 0; n < nCols; ++n )
{
@@ -1067,19 +1036,19 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
if( aDBColumns.Seek_Entry( &aSrch, &nFndPos ) )
aColFlds.Insert( aDBColumns[ nFndPos ], n );
else {
- ASSERT( !this, "Datenbankspalte nicht mehr gefunden" );
+ OSL_ENSURE( !this, "database column not found" );
}
}
if( nCols != aColFlds.Count() )
{
- ASSERT( !this, "nicht alle Datenbankspalten gefunden" );
+ OSL_ENSURE( !this, "not all database columns found" );
nCols = aColFlds.Count();
}
if(!nRows || !nCols)
{
- ASSERT( !this, "wrong parameters" );
+ OSL_ENSURE( !this, "wrong parameters" );
break;
}
@@ -1137,9 +1106,9 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
for( n = 0; n < nCols; ++n )
{
- // beim aller erstenmal KEIN GoNextCell, weil wir schon
- // drin stehen. Auch nicht nach dem Insert das GoNextCell,
- // weil am Ende eine leere Zeile einfuegt wird.
+ // at the very first time, NO GoNextCell, because we're
+ // already in it. Also no GoNextCell after the Insert,
+ // because an empty line is added at the end.
if( i || n )
rSh.GoNextCell();
@@ -1209,12 +1178,14 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
}
catch(Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aExcept
#endif
)
{
- DBG_ERROR(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer());
+#if OSL_DEBUG_LEVEL > 1
+ OSL_FAIL(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer());
+#endif
}
}
@@ -1241,13 +1212,13 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
rSh.SetAutoUpdateCells( bIsAutoUpdateCells );
}
- else // Daten als Felder/Text einfuegen
+ else // add data as fields/text
{
_DB_Columns aColArr;
if( SplitTextToColArr( aEdDbText.GetText(), aColArr, aRbAsField.IsChecked() ) )
{
- // jetzt kann bei jedem Datensatz einfach ueber das Array iteriert
- // und die Daten eingefuegt werden
+ // now for each data set, we can iterate over the array
+ // and add the data
if( !rSh.IsSttPara() )
rSh.SwEditShell::SplitNode();
@@ -1277,8 +1248,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
}
- // fuers Einfuegen als Felder -> nach jedem Datensatz ein
- // "NextField" einfuegen
+ // for adding as fields -> insert a "NextField" after
+ // every data set
SwDBFormatData aDBFormatData;
Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
if( xMgr.is() )
@@ -1349,8 +1320,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
case _DB_Column::DB_SPLITPARA:
rSh.SplitNode();
- // wenn nicht die gleiche Vorlage die Follow Vorlage
- // ist, dann muss die ausgewaehlte neu gesetzt werden
+ // when the template is not the same as the follow template,
+ // the selected has to be set newly
if( pColl && &pColl->GetNextTxtFmtColl() != pColl )
rSh.SetTxtFmtColl( pColl );
break;
@@ -1425,18 +1396,16 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
if( bSetCrsr && sIns.Len() )
{
- // zum Anfang und eine Mark setzen, damit der
- // Cursor am Ende wieder auf Anfangsposition
- // gesetzt werden kann.
+ // to the beginning and set a mark, so that
+ // the cursor can be set to the initial position
+ // at the end.
- // rSh.SwCrsrShell::MovePara( fnParaCurr, fnParaStart );
rSh.SwCrsrShell::MovePara(
GetfnParaCurr(), GetfnParaStart() );
pMark = rSh.SetBookmark(
KeyCode(),
::rtl::OUString(),
::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
- // rSh.SwCrsrShell::MovePara( fnParaCurr, fnParaEnd );
rSh.SwCrsrShell::MovePara(
GetfnParaCurr(), GetfnParaEnd() );
bSetCrsr = sal_False;
@@ -1487,6 +1456,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
if ( bDisposeResultSet )
::comphelper::disposeComponent(xResultSet);
}
+
void SwInsertDBColAutoPilot::SetTabSet()
{
SwWrtShell& rSh = pView->GetWrtShell();
@@ -1496,7 +1466,7 @@ void SwInsertDBColAutoPilot::SetTabSet()
{
if( pTAutoFmt->IsFrame() )
{
- // Umrandung kommt vom AutoFormat
+ // border is from AutoFormat
pTblSet->ClearItem( RES_BOX );
pTblSet->ClearItem( SID_ATTR_BORDER_INNER );
}
@@ -1509,9 +1479,9 @@ void SwInsertDBColAutoPilot::SetTabSet()
}
else
{
- // die Defaults wieder entfernen, es macht keinen Sinn sie zu setzen
+ // remove the defaults again, it makes no sense to set them
SvxBrushItem aBrush( RES_BACKGROUND );
- static sal_uInt16 __READONLY_DATA aIds[3] =
+ static sal_uInt16 aIds[3] =
{ RES_BACKGROUND, SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE };
for( int i = 0; i < 3; ++i )
if( SFX_ITEM_SET == pTblSet->GetItemState( aIds[ i ],
@@ -1534,14 +1504,8 @@ void SwInsertDBColAutoPilot::SetTabSet()
rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() );
}
-/* */
-
-
_DB_ColumnConfigData::~_DB_ColumnConfigData() {}
-/* -----------------------------05.12.00 16:15--------------------------------
-
- ---------------------------------------------------------------------------*/
static Sequence<rtl::OUString> lcl_createSourceNames(const String& rNodeName)
{
Sequence<rtl::OUString> aSourceNames(11);
@@ -1573,9 +1537,7 @@ static Sequence<rtl::OUString> lcl_createSourceNames(const String& rNodeName)
RTL_CONSTASCII_STRINGPARAM( "/IsEmptyHeadline" ));
return aSourceNames;
}
-/* -----------------------------05.12.00 16:25--------------------------------
- ---------------------------------------------------------------------------*/
static Sequence<rtl::OUString> lcl_CreateSubNames( const String& rSubNodeName )
{
Sequence<rtl::OUString> aSubSourceNames(6);
@@ -1596,9 +1558,7 @@ static Sequence<rtl::OUString> lcl_CreateSubNames( const String& rSubNodeName )
RTL_CONSTASCII_STRINGPARAM( "/NumberFormatLocale" ));
return aSubSourceNames;
}
-/* -----------------------------06.12.00 13:03--------------------------------
- ---------------------------------------------------------------------------*/
static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames)
{
sal_Int32 nIdx = aNames.getLength();
@@ -1622,9 +1582,7 @@ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames)
}
return sRet;
}
-/* -----------------------------05.12.00 15:00--------------------------------
- ---------------------------------------------------------------------------*/
void SwInsertDBColAutoPilot::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwInsertDBColAutoPilot::Commit()
@@ -1760,9 +1718,7 @@ void SwInsertDBColAutoPilot::Commit()
SetSetProperties(sColumnNode, aSubValues);
}
}
-/* -----------------------------05.12.00 15:00--------------------------------
- ---------------------------------------------------------------------------*/
void SwInsertDBColAutoPilot::Load()
{
Sequence <rtl::OUString> aNames = GetNodeNames(rtl::OUString());
@@ -1845,7 +1801,6 @@ void SwInsertDBColAutoPilot::Load()
pInsDBColumn->nUsrNumFmt = rNFmtr.GetEntryKey( pInsDBColumn->sUsrNumFmt,
pInsDBColumn->eUsrNumFmtLng );
-// pInsDBColumn->nDBNumFmt
pNewData->aDBColumns.Insert(pInsDBColumn);
}
@@ -1884,7 +1839,7 @@ void SwInsertDBColAutoPilot::Load()
sTmp = pNewData->sTAutoFmtNm;
if( sTmp.Len() )
{
- // dann erstmal die AutoFmt-Datei laden und das Autoformat suchen
+ // then load the AutoFmt file and look for Autoformat first
SwTableAutoFmtTbl aAutoFmtTbl;
aAutoFmtTbl.Load();
for( sal_uInt16 nAutoFmt = aAutoFmtTbl.Count(); nAutoFmt; )
@@ -1904,8 +1859,8 @@ void SwInsertDBColAutoPilot::Load()
aRbHeadlEmpty.Check( pNewData->bIsEmptyHeadln );
HeaderHdl(&aCbTableHeadon);
- // jetzt noch die benutzerdefinierten Numberformat Strings in die
- // Shell kopieren. Nur diese sind dann als ID verfuegbar
+ // now copy the user defined Numberformat strings to the
+ // Shell. Then only these are available as ID
for( n = 0; n < aDBColumns.Count() ; ++n )
{
SwInsDBColumn& rSet = *aDBColumns[ n ];
@@ -1934,7 +1889,7 @@ void SwInsertDBColAutoPilot::Load()
}
}
- // steht der Cursor in einer Tabelle, darf NIE Tabelle auswaehlbar sein
+ // when the cursor is inside of a table, table must NEVER be selectable
if( !aRbAsTable.IsEnabled() && aRbAsTable.IsChecked() )
aRbAsField.Check( sal_True );
delete pNewData;
@@ -1943,3 +1898,4 @@ void SwInsertDBColAutoPilot::Load()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index fc17b6093cba..d6b30b74a668 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#if STLPORT_VERSION>=321
#include <cstdarg>
-#endif
#include <stdio.h>
#include <unotxdoc.hxx>
@@ -120,7 +119,7 @@
#include <sfx2/event.hxx>
#include <vcl/msgbox.hxx>
#include <svx/dataaccessdescriptor.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/textenc.h>
#include <ndindex.hxx>
#include <pam.hxx>
@@ -129,7 +128,6 @@
#include <osl/file.hxx>
#include <swabstdlg.hxx>
#include <fmthdft.hxx>
-#include <dbui.hrc>
#include <envelp.hrc>
#include <memory>
#include <vector>
@@ -196,7 +194,7 @@ bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<XResultS
}
return false;
}
-// #122799# copy compatibility options
+// copy compatibility options
void lcl_CopyCompatibilityOptions( SwWrtShell& rSourceShell, SwWrtShell& rTargetShell)
{
IDocumentSettingAccess* pIDsa = rSourceShell.getIDocumentSettingAccess();
@@ -213,9 +211,6 @@ void lcl_CopyCompatibilityOptions( SwWrtShell& rSourceShell, SwWrtShell& rTarget
rTargetShell.SetUseFormerTextWrapping( pIDsa->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING));
}
}
-/* -----------------09.12.2002 12:35-----------------
- *
- * --------------------------------------------------*/
class SwConnectionDisposedListener_Impl : public cppu::WeakImplHelper1
< lang::XEventListener >
@@ -228,7 +223,7 @@ public:
~SwConnectionDisposedListener_Impl();
};
-// -----------------------------------------------------------------------------
+
struct SwNewDBMgr_Impl
{
SwDSParam* pMergeData;
@@ -241,9 +236,7 @@ struct SwNewDBMgr_Impl
,xDisposeListener(new SwConnectionDisposedListener_Impl(rDBMgr))
{}
};
-/*-- 24.10.2003 15:54:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSource> xSource)
{
uno::Reference<XMultiServiceFactory> xMgr = ::comphelper::getProcessServiceFactory();
@@ -274,9 +267,7 @@ void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSource> xSou
}
}
}
-/* -----------------------------17.07.00 17:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
{
sal_Bool bRet = sal_False;
@@ -288,7 +279,7 @@ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
}
else
{
- DBG_ERROR("no absolute positioning available");
+ OSL_FAIL("no absolute positioning available");
}
}
catch(Exception aExcept)
@@ -296,9 +287,7 @@ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
}
return bRet;
}
-/* -----------------------------17.07.00 17:23--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool lcl_GetColumnCnt(SwDSParam* pParam,
const String& rColumnName, long nLanguage, String& rResult, double* pNumber)
{
@@ -332,14 +321,15 @@ sal_Bool lcl_GetColumnCnt(SwDSParam* pParam,
rResult = SwNewDBMgr::GetDBField( xColumnProps, aFormatData, pNumber);
return sal_True;
};
+
/*--------------------------------------------------------------------
- Beschreibung: Daten importieren
+ Description: import data
--------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
{
SetMergeType( rMergeDesc.nMergeType );
- DBG_ASSERT(!bInMerge && !pImpl->pMergeData, "merge already activated!");
+ OSL_ENSURE(!bInMerge && !pImpl->pMergeData, "merge already activated!");
SwDBData aData;
aData.nCommandType = CommandType::TABLE;
@@ -369,7 +359,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
*pTemp = *pImpl->pMergeData;
else
{
- //#94779# calls from the calculator may have added a connection with an invalid commandtype
+ // calls from the calculator may have added a connection with an invalid commandtype
//"real" data base connections added here have to re-use the already available
//DSData and set the correct CommandType
SwDBData aTempData(aData);
@@ -417,7 +407,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
{
pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
- DBG_ERROR("exception in MergeNew()");
+ OSL_FAIL("exception in MergeNew()");
}
uno::Reference<XDataSource> xSource = SwNewDBMgr::getDataSourceAsParent(xConnection,aData.sDataSource);
@@ -429,7 +419,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
if (IsInitDBFields())
{
- // Bei Datenbankfeldern ohne DB-Name DB-Name von Dok einsetzen
+ // with database fields without DB-Name, use DB-Name from Doc
SvStringsDtor aDBNames(1, 1);
aDBNames.Insert( new String(), 0);
SwDBData aInsertData = rMergeDesc.rSh.GetDBData();
@@ -446,7 +436,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
switch(rMergeDesc.nMergeType)
{
case DBMGR_MERGE:
- bRet = Merge(&rMergeDesc.rSh); // Mischen
+ bRet = Merge(&rMergeDesc.rSh);
break;
case DBMGR_MERGE_MAILMERGE: // printing merge from 'old' merge dialog or from UNO-component
@@ -458,8 +448,9 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
rMergeDesc);
break;
- default: // Einfuegen der selektierten Eintraege
- // (war: InsertRecord)
+ default:
+ // insert selected entries
+ // (was: InsertRecord)
ImportFromConnection(&rMergeDesc.rSh);
break;
}
@@ -469,10 +460,8 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
}
/*--------------------------------------------------------------------
- Beschreibung: Daten importieren
+ Description: import data
--------------------------------------------------------------------*/
-
-
sal_Bool SwNewDBMgr::Merge(SwWrtShell* pSh)
{
pSh->StartAllAction();
@@ -485,9 +474,6 @@ sal_Bool SwNewDBMgr::Merge(SwWrtShell* pSh)
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
{
if(pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB)
@@ -521,9 +507,6 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
}
}
}
-/*-----------------24.02.97 10.30-------------------
-
---------------------------------------------------*/
String lcl_FindColumn(const String& sFormatStr,sal_uInt16 &nUsedPos, sal_uInt8 &nSeparator)
{
@@ -556,9 +539,6 @@ String lcl_FindColumn(const String& sFormatStr,sal_uInt16 &nUsedPos, sal_uInt8
return sReturn;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh)
{
if(pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB)
@@ -597,7 +577,7 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh)
}
else
{
- // Spalte nicht gefunden -> Fehler anzeigen
+ // column not found -> show error
String sInsert = '?';
sInsert += sColumn;
sInsert += '?';
@@ -624,12 +604,13 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh)
sStr += '\t';
}
pSh->SwEditShell::Insert2(sStr);
- pSh->SwFEShell::SplitNode(); // Zeilenvorschub
+ pSh->SwFEShell::SplitNode(); // line feed
}
}
}
+
/*--------------------------------------------------------------------
- Beschreibung: Listbox mit Tabellenliste fuellen
+ Description: fill Listbox with tablelist
--------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
{
@@ -680,7 +661,7 @@ sal_Bool SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
}
/*--------------------------------------------------------------------
- Beschreibung: Listbox mit Spaltennamen einer Datenbank fuellen
+ Description: fill Listbox with column names of a database
--------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
const String& rDBName, const String& rTableName, sal_Bool bAppend)
@@ -714,9 +695,7 @@ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
}
return(sal_True);
}
-/* -----------------------------08.06.01 15:11--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
uno::Reference< XConnection> xConnection,
const String& rTableName, sal_Bool bAppend)
@@ -739,9 +718,8 @@ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
}
/*--------------------------------------------------------------------
- Beschreibung: CTOR
+ Description: CTOR
--------------------------------------------------------------------*/
-
SwNewDBMgr::SwNewDBMgr() :
nMergeType(DBMGR_INSERT),
bInitDBFields(sal_False),
@@ -752,9 +730,7 @@ SwNewDBMgr::SwNewDBMgr() :
pMergeEvtSrc(NULL)
{
}
-/* -----------------------------18.07.00 08:56--------------------------------
- ---------------------------------------------------------------------------*/
SwNewDBMgr::~SwNewDBMgr()
{
for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
@@ -778,7 +754,7 @@ SwNewDBMgr::~SwNewDBMgr()
}
/*--------------------------------------------------------------------
- Beschreibung: Serienbriefe als einzelne Dokumente speichern
+ Description: save bulk letters as single documents
--------------------------------------------------------------------*/
String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageDesc, sal_uLong nDocNo )
{
@@ -791,15 +767,14 @@ String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageD
++nDocNo;
}while(true);
}
+
void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget )
{
- sal_uInt16 __FAR_DATA aRangeOfDefaults[] = {
+ sal_uInt16 aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists##
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
@@ -821,6 +796,7 @@ void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget )
if( aNewDefaults.Count() )
rTarget.SetDefault( aNewDefaults );
}
+
void lcl_CopyFollowPageDesc(
SwWrtShell& rTargetShell,
const SwPageDesc& rSourcePageDesc,
@@ -879,15 +855,15 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
xMailDispatcher.set( new MailDispatcher(rMergeDescriptor.xSmtpServer));
if(!rMergeDescriptor.bSendAsAttachment && rMergeDescriptor.bSendAsHTML)
{
- sBodyMimeType = ::rtl::OUString::createFromAscii("text/html; charset=");
+ sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset="));
sBodyMimeType += ::rtl::OUString::createFromAscii(
rtl_getBestMimeCharsetFromTextEncoding( eEncoding ));
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
else
sBodyMimeType =
- ::rtl::OUString::createFromAscii("text/plain; charset=UTF-8; format=flowed");
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain; charset=UTF-8; format=flowed"));
}
uno::Reference< XPropertySet > xColumnProp;
@@ -976,7 +952,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
nStartingPageNo = pSourceShell->GetVirtPageNum();
sStartingPageDesc = sModifiedStartingPageDesc = pSourceShell->GetPageDesc(
pSourceShell->GetCurPageDesc()).GetName();
- // #122799# copy compatibility options
+ // copy compatibility options
lcl_CopyCompatibilityOptions( *pSourceShell, *pTargetShell);
// #72821# copy dynamic defaults
lcl_CopyDynamicDefaults( *pSourceShell->GetDoc(), *pTargetShell->GetDoc() );
@@ -995,10 +971,10 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
if (!IsMergeSilent())
aPrtMonDlg.Show();
- // Progress, um KeyInputs zu unterbinden
+ // Progress, to prohibit KeyInputs
SfxProgress aProgress(pSourrceDocSh, ::aEmptyStr, 1);
- // Alle Dispatcher sperren
+ // lock all dispatchers
SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh);
while (pViewFrm)
{
@@ -1063,7 +1039,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
sStat += String::CreateFromInt32( nDocNo );
aPrtMonDlg.aPrintInfo.SetText(sStat);
- // Rechenzeit fuer Save-Monitor:
+ // computation time for Save-Monitor:
for (sal_uInt16 i = 0; i < 10; i++)
Application::Reschedule();
@@ -1088,7 +1064,6 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
pWorkDoc->UpdateFlds(NULL, false);
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), xWorkDocSh));
- // alle versteckten Felder/Bereiche entfernen
pWorkDoc->RemoveInvisibleContent();
// launch MailMergeEvent if required
@@ -1102,7 +1077,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile )
{
- DBG_ASSERT( pTargetShell, "no target shell available!" );
+ OSL_ENSURE( pTargetShell, "no target shell available!" );
// copy created file into the target document
rWorkShell.ConvertFieldsToText();
rWorkShell.SetNumberingRestart();
@@ -1143,7 +1118,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
pTargetShell->InsertPageBreak( &sModifiedStartingPageDesc, nStartingPageNo );
else
pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
- DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
+ OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
//#i51359# add a second paragraph in case there's only one
{
SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -1200,13 +1175,12 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
String sMailAddress = GetDBField( xColumnProp, aDBFormat);
if(!SwMailMergeHelper::CheckMailAddress( sMailAddress ))
{
- DBG_ERROR("invalid e-Mail address in database column");
+ OSL_FAIL("invalid e-Mail address in database column");
}
else
{
- SwMailMessage* pMessage = 0;
- uno::Reference< mail::XMailMessage > xMessage =
- pMessage = new SwMailMessage;
+ SwMailMessage* pMessage = new SwMailMessage;
+ uno::Reference< mail::XMailMessage > xMessage = pMessage;
if(rMergeDescriptor.pMailMergeConfigItem->IsMailReplyTo())
pMessage->setReplyToAddress(rMergeDescriptor.pMailMergeConfigItem->GetMailReplyTo());
pMessage->addRecipient( sMailAddress );
@@ -1229,7 +1203,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
//read in the temporary file and use it as mail body
SfxMedium aMedium( sFileURL, STREAM_READ, sal_True);
SvStream* pInStream = aMedium.GetInStream();
- DBG_ASSERT(pInStream, "no output file created?");
+ OSL_ENSURE(pInStream, "no output file created?");
if(pInStream)
{
pInStream->SetStreamCharSet( eEncoding );
@@ -1288,7 +1262,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
{
if( rMergeDescriptor.nMergeType != DBMGR_MERGE_MAILMERGE )
{
- DBG_ASSERT( aTempFile.get(), "Temporary file not available" );
+ OSL_ENSURE( aTempFile.get(), "Temporary file not available" );
INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL());
SfxMedium* pDstMed = new SfxMedium(
aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
@@ -1333,21 +1307,17 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions );
const sal_Int32 nOpts = aOptions.getLength();
aOptions.realloc( nOpts + 1 );
- aOptions[ nOpts ].Name = rtl::OUString::createFromAscii( "Wait" );
+ aOptions[ nOpts ].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait"));
aOptions[ nOpts ].Value <<= sal_True ;
-// aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, sal_True) );
-// // #i52629# aynchronous printing should only be done in silent mode - otherwise
-// // the printer dialog does not come up
-// aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDescriptor.bPrintAsync ));
// move print options
const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray();
for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption)
{
- if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" )
- ||( pPrintOptions[nOption].Name.equalsAscii( "FileName" ))
- ||( pPrintOptions[nOption].Name.equalsAscii( "Collate" ))
- ||( pPrintOptions[nOption].Name.equalsAscii( "Pages" ))
- ||( pPrintOptions[nOption].Name.equalsAscii( "Wait" )))
+ if( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CopyCount"))
+ ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileName")))
+ ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Collate" )))
+ ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Pages")))
+ ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Wait"))))
{
aOptions.realloc( nOpts + 1 );
aOptions[ nOpts ].Name = pPrintOptions[nOption].Name;
@@ -1355,14 +1325,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
}
}
-// const SwModuleOptions * pModOpt = SW_MOD()->GetModuleConfig();
-// if (pModOpt->IsSinglePrintJob())
-// {
-// }
-// else
-// {
pTargetView->ExecPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync );
-// }
}
xTargetDocShell->DoClose();
}
@@ -1370,10 +1333,10 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
//remove the temporary files
::std::vector<String>::iterator aFileIter;
for(aFileIter = aFilesToRemove.begin();
- aFileIter != aFilesToRemove.end(); aFileIter++)
+ aFileIter != aFilesToRemove.end(); ++aFileIter)
SWUnoHelper::UCB_DeleteFile( *aFileIter );
- // Alle Dispatcher freigeben
+ // unlock all dispatchers
pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh);
while (pViewFrm)
{
@@ -1397,10 +1360,6 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
return bLoop;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
{
pButton->GetParent()->Hide();
@@ -1409,12 +1368,10 @@ IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
}
IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
-
/*--------------------------------------------------------------------
- Beschreibung: Numberformat der Spalte ermitteln und ggfs. in
- den uebergebenen Formatter uebertragen
+ Description: determine the column's Numberformat and transfer
+ to the forwarded Formatter, if applicable.
--------------------------------------------------------------------*/
-
sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName,
const String& rTableName,
const String& rColNm,
@@ -1472,7 +1429,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName,
}
catch(Exception&)
{
- DBG_ERROR("Exception in getColumns()");
+ OSL_FAIL("Exception in getColumns()");
}
if(!xCols.is() || !xCols->hasByName(rColNm))
return nRet;
@@ -1494,16 +1451,14 @@ sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName,
}
return nRet;
}
-/* -----------------------------07.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
uno::Reference< XConnection> xConnection,
uno::Reference< XPropertySet> xColumn,
SvNumberFormatter* pNFmtr,
long nLanguage )
{
- //JP 12.01.99: ggfs. das NumberFormat im Doc setzen
+ // set the NumberFormat in the doc if applicable
sal_uLong nRet = 0;
if(!xSource.is())
@@ -1564,14 +1519,14 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
}
catch(const Exception&)
{
- DBG_ERROR("illegal number format key");
+ OSL_FAIL("illegal number format key");
}
}
}
}
catch( const Exception& )
{
- DBG_ERROR("no FormatKey property found");
+ OSL_FAIL("no FormatKey property found");
}
if(bUseDefault)
nRet = SwNewDBMgr::GetDbtoolsClient().getDefaultNumberFormat(xColumn, xDocNumberFormatTypes, aLocale);
@@ -1579,9 +1534,6 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
return nRet;
}
-/* -----------------------------17.07.00 09:47--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName,
const String& rTableName,
const String& rColNm )
@@ -1627,9 +1579,6 @@ sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName,
return nRet;
}
-/* -----------------------------03.07.00 17:12--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rDataSource,
uno::Reference<XDataSource>& rxSource)
{
@@ -1650,9 +1599,7 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData
return xConnection;
}
-/* -----------------------------03.07.00 17:12--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Reference<sdbc::XConnection> xConnection,
const String& rTableOrQuery,
sal_uInt8 eTableOrQuery)
@@ -1696,21 +1643,19 @@ uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Refe
}
catch( const uno::Exception& )
{
- DBG_ERROR("Exception in SwDBMgr::GetColumnSupplier");
+ OSL_FAIL("Exception in SwDBMgr::GetColumnSupplier");
}
return xRet;
}
-/* -----------------------------05.07.00 13:44--------------------------------
- ---------------------------------------------------------------------------*/
String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
const SwDBFormatData& rDBFormatData,
double* pNumber)
{
uno::Reference< XColumn > xColumn(xColumnProps, UNO_QUERY);
String sRet;
- DBG_ASSERT(xColumn.is(), "SwNewDBMgr::::ImportDBField: illegal arguments");
+ OSL_ENSURE(xColumn.is(), "SwNewDBMgr::::ImportDBField: illegal arguments");
if(!xColumn.is())
return sRet;
@@ -1745,8 +1690,6 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
case DataType::TIME:
case DataType::TIMESTAMP:
{
-// ::Date aTempDate(rDBFormatData.aNullDate.Day,
-// rDBFormatData.aNullDate.Month, rDBFormatData.aNullDate.Year);
try
{
@@ -1767,47 +1710,26 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
}
catch(Exception& )
{
- DBG_ERROR("exception caught");
+ OSL_FAIL("exception caught");
}
}
break;
-
-// case DataType::BINARY:
-// case DataType::VARBINARY:
-// case DataType::LONGVARBINARY:
-// case DataType::SQLNULL:
-// case DataType::OTHER:
-// case DataType::OBJECT:
-// case DataType::DISTINCT:
-// case DataType::STRUCT:
-// case DataType::ARRAY:
-// case DataType::BLOB:
-// case DataType::CLOB:
-// case DataType::REF:
-// default:
- }
-// if (pFormat)
-// {
-// SFX_ITEMSET_GET(*pCol, pFormatItem, SfxUInt32Item, SBA_DEF_FMTVALUE, sal_True);
-// *pFormat = pFormatItem->GetValue();
-// }
+ }
return sRet;
}
-/* -----------------------------06.07.00 14:28--------------------------------
- releases the merge data source table or query after merge is completed
- ---------------------------------------------------------------------------*/
+
+// releases the merge data source table or query after merge is completed
void SwNewDBMgr::EndMerge()
{
- DBG_ASSERT(bInMerge, "merge is not active");
+ OSL_ENSURE(bInMerge, "merge is not active");
bInMerge = sal_False;
delete pImpl->pMergeData;
pImpl->pMergeData = 0;
}
-/* -----------------------------06.07.00 14:28--------------------------------
- checks if a desired data source table or query is open
- ---------------------------------------------------------------------------*/
+
+// checks if a desired data source table or query is open
sal_Bool SwNewDBMgr::IsDataSourceOpen(const String& rDataSource,
const String& rTableOrQuery, sal_Bool bMergeOnly)
{
@@ -1831,9 +1753,8 @@ sal_Bool SwNewDBMgr::IsDataSourceOpen(const String& rDataSource,
}
return sal_False;
}
-/* -----------------------------17.07.00 16:44--------------------------------
- read column data a a specified position
- ---------------------------------------------------------------------------*/
+
+// read column data at a specified position
sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableName,
const String& rColumnName, sal_uInt32 nAbsRecordId,
long nLanguage,
@@ -1896,9 +1817,9 @@ sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTabl
}
return bRet;
}
-/* -----------------------------06.07.00 16:47--------------------------------
- reads the column data at the current position
- ---------------------------------------------------------------------------*/
+
+
+// reads the column data at the current position
sal_Bool SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, sal_uInt16 nLanguage,
String &rResult, double *pNumber, sal_uInt32 * /*pFormat*/)
{
@@ -1911,17 +1832,13 @@ sal_Bool SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, sal_uInt16
sal_Bool bRet = lcl_GetColumnCnt(pImpl->pMergeData, rColumnName, nLanguage, rResult, pNumber);
return bRet;
}
-/* -----------------------------07.07.00 14:28--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::ToNextMergeRecord()
{
- DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
+ OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
return ToNextRecord(pImpl->pMergeData);
}
-/* -----------------------------10.07.01 14:28--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::ToNextRecord(
const String& rDataSource, const String& rCommand, sal_Int32 /*nCommandType*/)
{
@@ -1940,9 +1857,7 @@ sal_Bool SwNewDBMgr::ToNextRecord(
}
return ToNextRecord(pFound);
}
-/* -----------------------------10.07.01 14:38--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
{
sal_Bool bRet = sal_True;
@@ -1986,7 +1901,7 @@ sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
return bRet;
}
-/* -----------------------------13.07.00 17:23--------------------------------
+/* ------------------------------------------------------------------------
synchronized labels contain a next record field at their end
to assure that the next page can be created in mail merge
the cursor position must be validated
@@ -1995,13 +1910,11 @@ sal_Bool SwNewDBMgr::ExistsNextRecord() const
{
return pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB;
}
-/* -----------------------------13.07.00 10:41--------------------------------
- ---------------------------------------------------------------------------*/
sal_uInt32 SwNewDBMgr::GetSelectedRecordId()
{
sal_uInt32 nRet = 0;
- DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
+ OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is())
return sal_False;
try
@@ -2013,12 +1926,10 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId()
}
return nRet;
}
-/* -----------------------------13.07.00 10:58--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet)
{
- DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
+ OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is()|| nSet < 0)
return sal_False;
sal_Bool bRet = sal_False;
@@ -2033,9 +1944,6 @@ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet)
return bRet;
}
-/* -----------------------------17.07.00 14:17--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableOrQuery,
sal_Int32 nCommandType, bool bCreate)
{
@@ -2069,7 +1977,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa
}
catch(Exception&)
{
- //#98373# DB driver may not be ODBC 3.0 compliant
+ // DB driver may not be ODBC 3.0 compliant
pFound->bScrollable = sal_True;
}
pFound->xStatement = pFound->xConnection->createStatement();
@@ -2096,9 +2004,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa
}
return pFound->xResultSet.is();
}
-/* -----------------------------14.08.2001 10:26------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rDataSource)
{
SwDSParam* pFound = SwNewDBMgr::FindDSConnection(rDataSource, sal_True);
@@ -2118,9 +2024,7 @@ uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rData
}
return pFound->xConnection;
}
-/* -----------------------------17.07.00 15:55--------------------------------
- ---------------------------------------------------------------------------*/
sal_uInt32 SwNewDBMgr::GetSelectedRecordId(
const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType)
{
@@ -2159,9 +2063,8 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId(
return nRet;
}
-/* -----------------------------17.07.00 14:18--------------------------------
- close all data sources - after fields were updated
- ---------------------------------------------------------------------------*/
+
+// close all data sources - after fields were updated
void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge)
{
//the only thing done here is to reset the selection index
@@ -2184,9 +2087,7 @@ void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge)
}
}
}
-/* -----------------------------17.07.00 14:54--------------------------------
- ---------------------------------------------------------------------------*/
SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate)
{
//prefer merge data if available
@@ -2207,7 +2108,7 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate)
(rData.nCommandType == -1 || rData.nCommandType == pParam->nCommandType ||
(bCreate && pParam->nCommandType == -1)))
{
- //#94779# calls from the calculator may add a connection with an invalid commandtype
+ // calls from the calculator may add a connection with an invalid commandtype
//later added "real" data base connections have to re-use the already available
//DSData and set the correct CommandType
if(bCreate && pParam->nCommandType == -1)
@@ -2235,9 +2136,6 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate)
}
return pFound;
}
-/* -----------------------------14.08.2001 10:27------------------------------
-
- ---------------------------------------------------------------------------*/
SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_Bool bCreate)
{
@@ -2275,16 +2173,11 @@ SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_B
return pFound;
}
-/* -----------------------------17.07.00 14:34--------------------------------
-
- ---------------------------------------------------------------------------*/
const SwDBData& SwNewDBMgr::GetAddressDBName()
{
return SW_MOD()->GetDBConfig()->GetAddressSource();
}
-/* -----------------------------18.07.00 13:13--------------------------------
- ---------------------------------------------------------------------------*/
Sequence<rtl::OUString> SwNewDBMgr::GetExistingDatabaseNames()
{
uno::Reference<XNameAccess> xDBContext;
@@ -2300,9 +2193,7 @@ Sequence<rtl::OUString> SwNewDBMgr::GetExistingDatabaseNames()
}
return Sequence<rtl::OUString>();
}
-/*-- 26.05.2004 14:33:13---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwNewDBMgr::LoadAndRegisterDataSource()
{
sfx2::FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
@@ -2493,9 +2384,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
return sFind;
}
-/* -----------------------------10.11.00 17:10--------------------------------
- ---------------------------------------------------------------------------*/
void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
const Sequence<PropertyValue>& rProperties,
sal_Bool bWithDataSourceBrowser)
@@ -2521,7 +2410,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
if(!sDataSource.getLength() || !sDataTableOrQuery.getLength())
{
- DBG_ERROR("PropertyValues missing or unset");
+ OSL_FAIL("PropertyValues missing or unset");
return;
}
@@ -2533,7 +2422,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
pFound = FindDSConnection(sDataSource, sal_True);
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
pImpl->pMergeDialog = pFact->CreateMailMergeDlg( DLG_MAILMERGE,
&rSh.GetView().GetViewFrame()->GetWindow(), rSh,
sDataSource,
@@ -2541,7 +2430,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
nCmdType,
xConnection,
bWithDataSourceBrowser ? 0 : &aSelection);
- DBG_ASSERT(pImpl->pMergeDialog, "Dialogdiet fail!");
+ OSL_ENSURE(pImpl->pMergeDialog, "Dialogdiet fail!");
if(pImpl->pMergeDialog->Execute() == RET_OK)
{
aDescriptor[daSelection] <<= pImpl->pMergeDialog->GetSelection();
@@ -2590,7 +2479,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
{
SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 );
SwView *pView = (SwView*) pFrame->GetViewShell();
- pView->AttrChangedNotify( &pView->GetWrtShell() );//Damit SelectShell gerufen wird.
+ pView->AttrChangedNotify( &pView->GetWrtShell() );// in order for SelectShell to be called
//set the current DBMgr
SwDoc* pWorkDoc = pView->GetWrtShell().GetDoc();
SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
@@ -2658,17 +2547,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
}
DELETEZ(pImpl->pMergeDialog);
}
-/* -----------------------------13.11.00 08:20--------------------------------
- ---------------------------------------------------------------------------*/
void SwNewDBMgr::InsertText(SwWrtShell& rSh,
const Sequence< PropertyValue>& rProperties)
{
rtl::OUString sDataSource, sDataTableOrQuery;
uno::Reference<XResultSet> xResSet;
Sequence<Any> aSelection;
- sal_Bool bHasSelectionProperty = sal_False;
- sal_Int32 nSelectionPos = 0;
sal_Int16 nCmdType = CommandType::TABLE;
const PropertyValue* pValues = rProperties.getConstArray();
uno::Reference< XConnection> xConnection;
@@ -2681,11 +2566,7 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh,
else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cCursor)))
pValues[nPos].Value >>= xResSet;
else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cSelection)))
- {
- bHasSelectionProperty = sal_True;
- nSelectionPos = nPos;
pValues[nPos].Value >>= aSelection;
- }
else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cCommandType)))
pValues[nPos].Value >>= nCmdType;
else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cActiveConnection)))
@@ -2693,7 +2574,7 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh,
}
if(!sDataSource.getLength() || !sDataTableOrQuery.getLength() || !xResSet.is())
{
- DBG_ERROR("PropertyValues missing or unset");
+ OSL_FAIL("PropertyValues missing or unset");
return;
}
uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
@@ -2710,14 +2591,14 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh,
aDBData.nCommandType = nCmdType;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwInsertDBColAutoPilot* pDlg = pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(),
xSource,
xColSupp,
aDBData,
DLG_AP_INSERT_DB_SEL );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute() )
{
rtl::OUString sDummy;
@@ -2729,15 +2610,13 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh,
}
catch(Exception& )
{
- DBG_ERROR("exception caught");
+ OSL_FAIL("exception caught");
}
}
delete pDlg;
}
-/* -----------------------------30.08.2001 12:00------------------------------
- ---------------------------------------------------------------------------*/
SwDbtoolsClient* SwNewDBMgr::pDbtoolsClient = NULL;
SwDbtoolsClient& SwNewDBMgr::GetDbtoolsClient()
@@ -2746,17 +2625,13 @@ SwDbtoolsClient& SwNewDBMgr::GetDbtoolsClient()
pDbtoolsClient = new SwDbtoolsClient;
return *pDbtoolsClient;
}
-/* -----------------13.05.2003 15:34-----------------
- --------------------------------------------------*/
void SwNewDBMgr::RemoveDbtoolsClient()
{
delete pDbtoolsClient;
pDbtoolsClient = 0;
}
-/* -----------------------------20.08.2002 12:00------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<XDataSource> SwNewDBMgr::getDataSourceAsParent(const uno::Reference< XConnection>& _xConnection,const ::rtl::OUString& _sDataSourceName)
{
uno::Reference<XDataSource> xSource;
@@ -2770,13 +2645,11 @@ uno::Reference<XDataSource> SwNewDBMgr::getDataSourceAsParent(const uno::Referen
}
catch(const Exception&)
{
- DBG_ERROR("exception in getDataSourceAsParent caught");
+ OSL_FAIL("exception in getDataSourceAsParent caught");
}
return xSource;
}
-/* -----------------------------20.08.2002 12:00------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDataSourceName,
const ::rtl::OUString& _sCommand,
sal_Int32 _nCommandType,
@@ -2812,15 +2685,13 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat
}
catch(const Exception&)
{
- DBG_ASSERT(0,"Caught exception while creating a new RowSet!");
+ OSL_FAIL("Caught exception while creating a new RowSet!");
}
return xResultSet;
}
-/*-- 13.05.2004 16:14:15---------------------------------------------------
- merge all data into one resulting document and return the number of
- merged documents
- -----------------------------------------------------------------------*/
+
+// merge all data into one resulting document and return the number of merged documents
sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwView& rSourceView )
{
@@ -2854,7 +2725,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
{
pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
- DBG_ERROR("exception in MergeNew()");
+ OSL_FAIL("exception in MergeNew()");
}
//bCancel is set from the PrintMonitor
@@ -2893,7 +2764,6 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
Window& rSourceWindow = rSourceView.GetViewFrame()->GetFrame().GetWindow();
rTargetWindow.SetPosPixel(rSourceWindow.GetPosPixel());
-// pTargetFrame->GetFrame().Appear();
SwView* pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() );
rMMConfig.SetTargetView(pTargetView);
//initiate SelectShell() to create sub shells
@@ -2906,7 +2776,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
rMaster.GetFooter().IsActive();
- // #122799# copy compatibility options
+ // copy compatibility options
lcl_CopyCompatibilityOptions( rSourceShell, *pTargetShell);
// #72821# copy dynamic defaults
lcl_CopyDynamicDefaults( *rSourceShell.GetDoc(), *pTargetShell->GetDoc() );
@@ -2948,7 +2818,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
//create a ViewFrame
SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() );
SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
- pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
+ pWorkView->AttrChangedNotify( &rWorkShell );// in order for SelectShell to be called
// merge the data
SwDoc* pWorkDoc = rWorkShell.GetDoc();
@@ -3020,7 +2890,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
}
sal_uInt16 nPageCountBefore = pTargetShell->GetPageCnt();
- DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
+ OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
//#i51359# add a second paragraph in case there's only one
{
SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -3073,35 +2943,31 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
pTargetShell->EnterStdMode();
pTargetShell->SttDoc();
- //
+
}
catch( Exception& rEx)
{
(void)rEx;
- DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments");
+ OSL_FAIL("exception caught in SwNewDBMgr::MergeDocuments");
}
DELETEZ(pImpl->pMergeData);
bInMerge = sal_False;
return nRet;
}
-/* -----------------09.12.2002 12:38-----------------
- *
- * --------------------------------------------------*/
+
SwConnectionDisposedListener_Impl::SwConnectionDisposedListener_Impl(SwNewDBMgr& rMgr) :
rDBMgr(rMgr)
-{};
-/* -----------------09.12.2002 12:39-----------------
- *
- * --------------------------------------------------*/
+{
+};
+
SwConnectionDisposedListener_Impl::~SwConnectionDisposedListener_Impl()
-{};
-/* -----------------09.12.2002 12:39-----------------
- *
- * --------------------------------------------------*/
+{
+};
+
void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource )
throw (RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ ::SolarMutexGuard aGuard;
uno::Reference<XConnection> xSource(rSource.Source, UNO_QUERY);
for(sal_uInt16 nPos = rDBMgr.aDataSourceParams.Count(); nPos; nPos--)
{
@@ -3113,3 +2979,5 @@ void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
index 463e64279e08..7a5fa0302f74 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
-#endif
#include <dbui.hrc>
#include <dbtablepreviewdialog.hrc>
@@ -55,9 +54,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
using namespace ::rtl;
-/*-- 08.04.2004 15:12:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< beans::PropertyValue>& rValues ) :
SfxModalDialog(pParent, SW_RES(DLG_MM_DBTABLEPREVIEWDIALOG)),
#ifdef MSC
@@ -74,7 +70,7 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b
const beans::PropertyValue* pValues = rValues.getConstArray();
for(sal_Int32 nValue = 0; nValue < rValues.getLength(); ++nValue )
{
- if(pValues[nValue].Name.equalsAscii("Command"))
+ if(pValues[nValue].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Command")))
{
String sDescription = m_aDescriptionFI.GetText();
OUString sTemp;
@@ -113,25 +109,9 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b
xD->dispatch(aURL, rValues);
m_pBeamerWIN->Show();
}
-/* uno::Reference<???::XController> xController = m_xFrame->getController();
- pImpl->xFController = uno::Reference<???::XFormController>(xController, uno::UNO_QUERY);
- if(pImpl->xFController.is())
- {
- uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( );
- pImpl->xSelSupp = uno::Reference<???::XSelectionSupplier>(xCtrl, uno::UNO_QUERY);
- if(pImpl->xSelSupp.is())
- {
- pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this);
- pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr );
- }
- }
-*/ }
-
-
+ }
}
-/*-- 08.04.2004 15:12:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwDBTablePreviewDialog::~SwDBTablePreviewDialog()
{
if(m_xFrame.is())
@@ -142,3 +122,5 @@ SwDBTablePreviewDialog::~SwDBTablePreviewDialog()
else
delete m_pBeamerWIN;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx
index 212bb873ca4b..3c4b790e8fd4 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/basedlgs.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <com/sun/star/uno/Sequence.h>
namespace com{ namespace sun{ namespace star{
@@ -39,10 +38,6 @@ namespace com{ namespace sun{ namespace star{
namespace frame{ class XFrame; }
}}}
-
-/*-- 08.04.2004 14:04:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwDBTablePreviewDialog : public SfxModalDialog
{
FixedInfo m_aDescriptionFI;
@@ -58,3 +53,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index f2080f822547..4af7627b3a6b 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// INCLUDE ---------------------------------------------------------------
-
-
#include <sot/formats.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -48,24 +46,16 @@
#include <cppuhelper/implbase1.hxx>
#include <svx/dbaexchange.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <dbtree.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <unomid.h>
@@ -79,9 +69,6 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::beans;
-/* -----------------------------17.07.01 13:10--------------------------------
-
- ---------------------------------------------------------------------------*/
struct SwConnectionData
{
::rtl::OUString sSourceName;
@@ -91,9 +78,7 @@ struct SwConnectionData
typedef SwConnectionData* SwConnectionDataPtr;
SV_DECL_PTRARR_DEL( SwConnectionArr, SwConnectionDataPtr, 32, 32 )
SV_IMPL_PTRARR( SwConnectionArr, SwConnectionDataPtr )
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener >
{
Reference< XNameAccess > xDBContext;
@@ -113,12 +98,10 @@ class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener >
sal_Bool HasContext();
SwWrtShell* GetWrtShell() { return pWrtSh;}
void SetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;}
- Reference< XNameAccess > GetContext() {return xDBContext;}
+ Reference< XNameAccess > GetContext() const {return xDBContext;}
Reference<XConnection> GetConnection(const rtl::OUString& rSourceName);
};
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
SwDBTreeList_Impl::~SwDBTreeList_Impl()
{
Reference<XContainer> xContainer(xDBContext, UNO_QUERY);
@@ -133,19 +116,15 @@ SwDBTreeList_Impl::~SwDBTreeList_Impl()
m_refCount--;
}
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
void SwDBTreeList_Impl::elementInserted( const ContainerEvent& ) throw (RuntimeException)
{
// information not needed
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
::rtl::OUString sSource;
rEvent.Accessor >>= sSource;
for(sal_uInt16 i = 0; i < aConnections.Count(); i++)
@@ -153,32 +132,22 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru
SwConnectionDataPtr pPtr = aConnections[i];
if(pPtr->sSourceName == sSource)
{
-// SwConnectionDataPtr pPtr = aConnections[i];
-// Reference<XComponent> xComp(pPtr->xConnection, UNO_QUERY);
-// if(xComp.is())
-// xComp->dispose();
aConnections.DeleteAndDestroy(i);
break;
}
}
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
void SwDBTreeList_Impl::disposing( const EventObject& ) throw (RuntimeException)
{
xDBContext = 0;
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
void SwDBTreeList_Impl::elementReplaced( const ContainerEvent& rEvent ) throw (RuntimeException)
{
elementRemoved(rEvent);
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwDBTreeList_Impl::HasContext()
{
if(!xDBContext.is())
@@ -193,13 +162,11 @@ sal_Bool SwDBTreeList_Impl::HasContext()
if(xContainer.is())
xContainer->addContainerListener( this );
}
- DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
+ OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
}
return xDBContext.is();
}
-/* -----------------------------17.07.01 13:24--------------------------------
- ---------------------------------------------------------------------------*/
Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rSourceName)
{
Reference<XConnection> xRet;
@@ -221,16 +188,13 @@ Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rS
}
return xRet;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
+
SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
SwWrtShell* pSh,
const String& rDefDBName, const sal_Bool bShowCol):
SvTreeListBox (pParent, rResId),
aImageList (SW_RES(ILIST_DB_DLG )),
- aImageListHC (SW_RES(ILIST_DB_DLG_HC )),
sDefDBName (rDefDBName),
bInitialized (sal_False),
bShowColumns (bShowCol),
@@ -242,31 +206,21 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
InitTreeList();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
SwDBTreeList::~SwDBTreeList()
{
delete pImpl;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
void SwDBTreeList::InitTreeList()
{
if(!pImpl->HasContext() && pImpl->GetWrtShell())
return;
SetSelectionMode(SINGLE_SELECTION);
SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
- // Font nicht setzen, damit der Font des Controls uebernommen wird!
+ // don't set font, so that the Control's font is being applied!
SetSpaceBetweenEntries(0);
SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
- aImageList.GetImage(IMG_EXPAND ), BMP_COLOR_NORMAL );
- SetNodeBitmaps( aImageListHC.GetImage(IMG_COLLAPSE),
- aImageListHC.GetImage(IMG_EXPAND ), BMP_COLOR_HIGHCONTRAST );
+ aImageList.GetImage(IMG_EXPAND ) );
SetDragDropMode(SV_DRAGDROP_APP_COPY);
@@ -277,37 +231,25 @@ void SwDBTreeList::InitTreeList()
long nCount = aDBNames.getLength();
Image aImg = aImageList.GetImage(IMG_DB);
- Image aHCImg = aImageListHC.GetImage(IMG_DB);
for(long i = 0; i < nCount; i++)
{
String sDBName(pDBNames[i]);
- SvLBoxEntry* pEntry = InsertEntry(sDBName, aImg, aImg, NULL, sal_True);
- SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
+ InsertEntry(sDBName, aImg, aImg, NULL, sal_True);
}
String sDBName(sDefDBName.GetToken(0, DB_DELIM));
String sTableName(sDefDBName.GetToken(1, DB_DELIM));
String sColumnName(sDefDBName.GetToken(2, DB_DELIM));
Select(sDBName, sTableName, sColumnName);
-
bInitialized = sal_True;
}
-/*-- 27.05.2004 09:19:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwDBTreeList::AddDataSource(const String& rSource)
{
Image aImg = aImageList.GetImage(IMG_DB);
- Image aHCImg = aImageListHC.GetImage(IMG_DB);
SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True);
- SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
SvTreeListBox::Select(pEntry);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
void SwDBTreeList::ShowColumns(sal_Bool bShowCol)
{
@@ -341,10 +283,6 @@ void SwDBTreeList::ShowColumns(sal_Bool bShowCol)
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
{
if (!pParent->HasChilds())
@@ -368,7 +306,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
if(xTSupplier.is())
{
Reference<XNameAccess> xTbls = xTSupplier->getTables();
- DBG_ASSERT(xTbls->hasByName(sTableName), "table not available anymore?");
+ OSL_ENSURE(xTbls->hasByName(sTableName), "table not available anymore?");
try
{
Any aTable = xTbls->getByName(sTableName);
@@ -386,7 +324,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
if(xQSupplier.is())
{
Reference<XNameAccess> xQueries = xQSupplier->getQueries();
- DBG_ASSERT(xQueries->hasByName(sTableName), "table not available anymore?");
+ OSL_ENSURE(xQueries->hasByName(sTableName), "table not available anymore?");
try
{
Any aQuery = xQueries->getByName(sTableName);
@@ -419,7 +357,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
{
}
}
- else // Tabellennamen
+ else // table names
{
try
{
@@ -438,15 +376,12 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
long nCount = aTblNames.getLength();
const ::rtl::OUString* pTblNames = aTblNames.getConstArray();
Image aImg = aImageList.GetImage(IMG_DBTABLE);
- Image aHCImg = aImageListHC.GetImage(IMG_DBTABLE);
for (long i = 0; i < nCount; i++)
{
sTableName = pTblNames[i];
SvLBoxEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns);
//to discriminate between queries and tables the user data of table entries is set
pTableEntry->SetUserData((void*)0);
- SetExpandedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
}
}
@@ -459,14 +394,11 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
long nCount = aQueryNames.getLength();
const ::rtl::OUString* pQueryNames = aQueryNames.getConstArray();
Image aImg = aImageList.GetImage(IMG_DBQUERY);
- Image aHCImg = aImageListHC.GetImage(IMG_DBQUERY);
for (long i = 0; i < nCount; i++)
{
sQueryName = pQueryNames[i];
SvLBoxEntry* pQueryEntry = InsertEntry(sQueryName, aImg, aImg, pParent, bShowColumns);
pQueryEntry->SetUserData((void*)1);
- SetExpandedEntryBmp(pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp( pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
}
}
}
@@ -478,24 +410,16 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData )
{
SvLBoxEntry* pRight = (SvLBoxEntry*)(pData->pRight );
if (GetParent(pRight) && GetParent(GetParent(pRight)))
- return COMPARE_GREATER; // Spaltennamen nicht sortieren
+ return COMPARE_GREATER; // don't sort column names
- return DefaultCompare(pData); // Sonst Basisklasse rufen
+ return DefaultCompare(pData); // otherwise call base class
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Bool* pbIsTable)
{
String sDBName;
@@ -506,7 +430,7 @@ String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Boo
if (GetParent(GetParent(pEntry)))
{
rColumnName = GetEntryText(pEntry);
- pEntry = GetParent(pEntry); // Spaltenname war selektiert
+ pEntry = GetParent(pEntry); // column name was selected
}
sDBName = GetEntryText(GetParent(pEntry));
if(pbIsTable)
@@ -519,10 +443,8 @@ String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Boo
}
/*------------------------------------------------------------------------
- Beschreibung: Format: Datenbank.Tabelle
+ Description: Format: database.table
------------------------------------------------------------------------*/
-
-
void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const String& rColumnName)
{
SvLBoxEntry* pParent;
@@ -565,10 +487,6 @@ void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
{
String sTableName, sColumnName;
@@ -579,7 +497,7 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
STAR_REFERENCE( datatransfer::XTransferable ) xRef( pContainer );
if( sColumnName.Len() )
{
- // Datenbankfeld draggen
+ // drag database field
svx::OColumnTransferable aColTransfer(
sDBName
,::rtl::OUString()
@@ -604,19 +522,16 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
sal_Int8 SwDBTreeList::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
{
return DND_ACTION_NONE;
}
-/*-- 07.10.2003 13:28:22---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwDBTreeList::SetWrtShell(SwWrtShell& rSh)
+void SwDBTreeList::SetWrtShell(SwWrtShell& rSh)
{
pImpl->SetWrtShell(rSh);
if (IsVisible() && !bInitialized)
InitTreeList();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx
index 9dc0c899f574..174f15242a90 100644
--- a/sw/source/ui/dbui/dbui.cxx
+++ b/sw/source/ui/dbui/dbui.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,20 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// INCLUDE ---------------------------------------------------------------
-
-
-#include <tools/list.hxx>
#include "wrtsh.hxx"
-
#include "dbui.hrc"
#include "dbui.hxx"
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
-
PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType )
: ModelessDialog( pParent, SW_RES(DLG_PRINTMONITOR) ),
aDocName (this, SW_RES( FT_DOCNAME )),
@@ -60,9 +52,7 @@ PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType )
}
FreeResource();
}
-/*---------------------------------------------------------------------
----------------------------------------------------------------------*/
void lcl_ResizeControl( Window* pWin, long nDiff )
{
Size aSize( pWin->GetSizePixel() );
@@ -102,10 +92,8 @@ void PrintMonitor::ResizeControls()
lcl_RePosControl( &aCancel, nDiff );
}
}
-/*---------------------------------------------------------------------
- Progress Indicator for Creation of personalized Mail Merge documents:
----------------------------------------------------------------------*/
+// Progress Indicator for Creation of personalized Mail Merge documents:
CreateMonitor::CreateMonitor( Window *pParent )
: ModelessDialog( pParent, SW_RES(DLG_MM_CREATIONMONITOR) ),
m_aStatus (this, SW_RES( FT_STATUS )),
@@ -149,3 +137,5 @@ void CreateMonitor::SetCancelHdl( const Link& rLink )
{
m_aCancelButton.SetClickHdl( rLink );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src
index 12c67d2644df..169c1b6a23ee 100644
--- a/sw/source/ui/dbui/dbui.src
+++ b/sw/source/ui/dbui/dbui.src
@@ -26,9 +26,9 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "dbui.hrc"
#include "helpid.h"
+
ModalDialog DLG_DBSELECTION
{
HelpID = "sw:ModalDialog:DLG_DBSELECTION";
diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx
index 2203f70c3404..ef073f6ebabf 100644
--- a/sw/source/ui/dbui/maildispatcher.cxx
+++ b/sw/source/ui/dbui/maildispatcher.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,7 +104,6 @@ namespace /* private */
} // namespace private
-
MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) :
mailserver_ (mailserver),
run_(false),
@@ -285,12 +285,12 @@ void MailDispatcher::run()
}
} // end for SSH ALI
}
-/*-- 27.08.2004 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void MailDispatcher::onTerminated()
{
//keep the reference until the end of onTerminated() because of the call order in the
//_threadFunc() from osl/thread.hxx
m_xSelfReference = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index 276f7850f91e..c5146db13c4a 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,11 +58,6 @@
using namespace ::com::sun::star;
SFX_IMPL_FLOATINGWINDOW( SwMailMergeChildWindow, FN_MAILMERGE_CHILDWINDOW )
-//SFX_IMPL_FLOATINGWINDOW( SwSendMailChildWindow, FN_MAILMERGE_SENDMAIL_CHILDWINDOW )
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
SwMailMergeChildWindow::SwMailMergeChildWindow( Window* _pParent,
sal_uInt16 nId,
@@ -89,10 +85,6 @@ SwMailMergeChildWindow::SwMailMergeChildWindow( Window* _pParent,
pWindow->Show();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent) :
@@ -100,8 +92,7 @@ SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings,
m_aBackTB(this, SW_RES( TB_BACK ))
{
m_aBackTB.SetSelectHdl(LINK(this, SwMailMergeChildWin, BackHdl));
- sal_uInt16 nIResId = GetSettings().GetStyleSettings().GetHighContrastMode() ?
- ILIST_TBX_HC : ILIST_TBX;
+ sal_uInt16 nIResId = ILIST_TBX;
ResId aResId( nIResId, *pSwResMgr );
ImageList aIList(aResId);
FreeResource();
@@ -114,36 +105,23 @@ SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings,
m_aBackTB.Show();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwMailMergeChildWin::~SwMailMergeChildWin()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeChildWin, BackHdl, ToolBox *, EMPTYARG )
{
GetBindings().GetDispatcher()->Execute(FN_MAILMERGE_WIZARD, SFX_CALLMODE_ASYNCHRON);
return 0;
}
-/*-- 26.05.2004 10:12:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeChildWin::FillInfo(SfxChildWinInfo& rInfo) const
{
SfxFloatingWindow::FillInfo(rInfo);
rInfo.aWinState.Erase();
rInfo.bVisible = sal_False;
}
-/*-- 21.05.2004 14:07:37---------------------------------------------------
- -----------------------------------------------------------------------*/
struct SwSendMailDialog_Impl
{
friend class SwSendMailDialog;
@@ -190,9 +168,6 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor()
return 0;
}
-/*-- 23.06.2004 10:19:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailDispatcherListener_Impl : public IMailDispatcherListener
{
SwSendMailDialog* m_pSendMailDialog;
@@ -212,66 +187,49 @@ public:
static void DeleteAttachments( uno::Reference< mail::XMailMessage >& xMessage );
};
-/*-- 23.06.2004 10:04:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg) :
m_pSendMailDialog(&rParentDlg)
{
}
-/*-- 23.06.2004 10:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailDispatcherListener_Impl::~SwMailDispatcherListener_Impl()
{
}
-/*-- 23.06.2004 10:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::started(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
{
}
-/*-- 23.06.2004 10:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::stopped(
::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
{
}
-/*-- 23.06.2004 10:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::idle(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
m_pSendMailDialog->AllMailsSent();
}
-/*-- 23.06.2004 10:04:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::mailDelivered(
::rtl::Reference<MailDispatcher> /*xMailDispatcher*/,
uno::Reference< mail::XMailMessage> xMailMessage)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
m_pSendMailDialog->DocumentSent( xMailMessage, true, 0 );
DeleteAttachments( xMailMessage );
}
-/*-- 23.06.2004 10:04:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::mailDeliveryError(
::rtl::Reference<MailDispatcher> /*xMailDispatcher*/,
uno::Reference< mail::XMailMessage> xMailMessage,
const rtl::OUString& sErrorMessage)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
DeleteAttachments( xMailMessage );
}
-/*-- 23.06.2004 12:30:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMailMessage >& xMessage )
{
uno::Sequence< mail::MailAttachment > aAttachments = xMessage->getAttachments();
@@ -284,7 +242,7 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
if( xTransferableProperties.is() )
{
::rtl::OUString sURL;
- xTransferableProperties->getPropertyValue( ::rtl::OUString::createFromAscii("URL") ) >>= sURL;
+ xTransferableProperties->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) >>= sURL;
if(sURL.getLength())
SWUnoHelper::UCB_DeleteFile( sURL );
}
@@ -295,9 +253,7 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
}
}
}
-/*-- 07.07.2004 13:45:51---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwSendWarningBox_Impl : public ModalDialog
{
FixedImage aWarningImageIM;
@@ -311,9 +267,7 @@ public:
SwSendWarningBox_Impl(Window* pParent, const String& rDetails);
~SwSendWarningBox_Impl();
};
-/*-- 07.07.2004 13:52:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSendWarningBox_Impl::SwSendWarningBox_Impl(Window* pParent, const String& rDetails) :
ModalDialog(pParent, SW_RES( DLG_MM_SENDWARNING )),
aWarningImageIM(this, SW_RES( IM_WARNING )),
@@ -327,16 +281,11 @@ SwSendWarningBox_Impl::SwSendWarningBox_Impl(Window* pParent, const String& rDet
aWarningImageIM.SetImage(WarningBox::GetStandardImage());
aDetailED.SetText(rDetails);
}
-/*-- 07.07.2004 13:52:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSendWarningBox_Impl::~SwSendWarningBox_Impl()
{
}
-/*-- 21.05.2004 14:10:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
#define ITEMID_TASK 1
#define ITEMID_STATUS 2
@@ -375,7 +324,6 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf
m_bCancel(false),
m_bDesctructionEnabled(false),
m_aImageList( SW_RES( ILIST ) ),
- m_aImageListHC( SW_RES( ILIST_HC ) ),
m_pImpl(new SwSendMailDialog_Impl),
m_pConfigItem(&rConfigItem),
m_nSendCount(0),
@@ -426,9 +374,7 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf
DetailsHdl_Impl( &m_aDetailsPB );
UpdateTransferStatus();
}
-/*-- 21.05.2004 14:10:39---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSendMailDialog::~SwSendMailDialog()
{
if(m_pImpl->xMailDispatcher.is())
@@ -456,9 +402,7 @@ SwSendMailDialog::~SwSendMailDialog()
}
delete m_pImpl;
}
-/*-- 21.05.2004 14:10:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::AddDocument( SwMailDescriptor& rDesc )
{
::osl::MutexGuard aGuard(m_pImpl->aDescriptorMutex);
@@ -470,26 +414,20 @@ void SwSendMailDialog::AddDocument( SwMailDescriptor& rDesc )
}
}
-/*-- 31.01.2005 08:59:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::SetDocumentCount( sal_Int32 nAllDocuments )
{
m_pImpl->nDocumentCount = nAllDocuments;
UpdateTransferStatus();
}
-/*-- 21.05.2004 14:10:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_Move(Control& rCtrl, long nYOffset)
{
Point aPos(rCtrl.GetPosPixel());
aPos.Y() += nYOffset;
rCtrl.SetPosPixel(aPos);
}
-/*-- 21.05.2004 14:10:40---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwSendMailDialog, DetailsHdl_Impl, PushButton*, EMPTYARG )
{
long nMove = 0;
@@ -514,9 +452,7 @@ IMPL_LINK( SwSendMailDialog, DetailsHdl_Impl, PushButton*, EMPTYARG )
return 0;
}
-/*-- 21.05.2004 14:10:40---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwSendMailDialog, StopHdl_Impl, PushButton*, pButton )
{
m_bCancel = true;
@@ -537,25 +473,19 @@ IMPL_LINK( SwSendMailDialog, StopHdl_Impl, PushButton*, pButton )
}
return 0;
}
-/*-- 21.05.2004 14:10:40---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwSendMailDialog, CloseHdl_Impl, PushButton*, EMPTYARG )
{
ModelessDialog::Show( sal_False );
return 0;
}
-/*-- 14.06.2004 09:48:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StartSendMails, SwSendMailDialog*, pDialog )
{
pDialog->SendMails();
return 0;
}
-/*-- 14.06.2004 09:48:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer )
{
if( pThis->m_pImpl->xMailDispatcher.is() )
@@ -578,9 +508,7 @@ IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer )
}
return 0;
}
-/*-- 07.07.2004 14:34:05---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StopSendMails, SwSendMailDialog*, pDialog )
{
if(pDialog->m_pImpl->xMailDispatcher.is() &&
@@ -592,14 +520,12 @@ IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StopSendMails, SwSendMailDialog*,
}
return 0;
}
-/*-- 14.06.2004 10:38:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::SendMails()
{
if(!m_pConfigItem)
{
- DBG_ERROR("config item not set");
+ OSL_FAIL("config item not set");
return;
}
String sErrorMessage;
@@ -614,7 +540,7 @@ void SwSendMailDialog::SendMails()
LeaveWait();
if(!bIsLoggedIn)
{
- DBG_ERROR("create error message");
+ OSL_FAIL("create error message");
return;
}
m_pImpl->xMailDispatcher.set( new MailDispatcher(xSmtpServer));
@@ -626,9 +552,7 @@ void SwSendMailDialog::SendMails()
m_pImpl->xMailDispatcher->start();
}
}
-/* -----------------28.01.2005 10:17-----------------
- --------------------------------------------------*/
void SwSendMailDialog::IterateMails()
{
const SwMailDescriptor* pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
@@ -636,9 +560,7 @@ void SwSendMailDialog::IterateMails()
{
if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail ))
{
- ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ?
- m_aImageListHC : m_aImageList;
- Image aInsertImg = rImgLst.GetImage( FN_FORMULA_CANCEL );
+ Image aInsertImg = m_aImageList.GetImage( FN_FORMULA_CANCEL );
String sMessage = m_sSendingTo;
String sTmp(pCurrentMailDescriptor->sEMail);
@@ -652,8 +574,8 @@ void SwSendMailDialog::IterateMails()
pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
continue;
}
- SwMailMessage* pMessage = 0;
- uno::Reference< mail::XMailMessage > xMessage = pMessage = new SwMailMessage;
+ SwMailMessage* pMessage = new SwMailMessage;
+ uno::Reference< mail::XMailMessage > xMessage = pMessage;
if(m_pConfigItem->IsMailReplyTo())
pMessage->setReplyToAddress(m_pConfigItem->GetMailReplyTo());
pMessage->addRecipient( pCurrentMailDescriptor->sEMail );
@@ -707,18 +629,14 @@ void SwSendMailDialog::IterateMails()
}
UpdateTransferStatus();
}
-/*-- 27.08.2004 10:50:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::ShowDialog()
{
Application::PostUserEvent( STATIC_LINK( this, SwSendMailDialog,
StartSendMails ), this );
ModelessDialog::Show();
}
-/*-- 27.08.2004 10:50:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::StateChanged( StateChangedType nStateChange )
{
ModelessDialog::StateChanged( nStateChange );
@@ -730,9 +648,6 @@ void SwSendMailDialog::StateChanged( StateChangedType nStateChange )
}
}
-/*-- 23.06.2004 10:14:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessage,
bool bResult,
const ::rtl::OUString* pError )
@@ -744,9 +659,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
Application::PostUserEvent( STATIC_LINK( this, SwSendMailDialog,
StopSendMails ), this );
}
- ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ?
- m_aImageListHC : m_aImageList;
- Image aInsertImg = rImgLst.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL );
+ Image aInsertImg = m_aImageList.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL );
String sMessage = m_sSendingTo;
String sTmp(xMessage->getRecipients()[0]);
@@ -766,9 +679,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
delete pDlg;
}
}
-/*-- 23.06.2004 11:25:31---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::UpdateTransferStatus()
{
String sStatus( m_sTransferStatus );
@@ -785,12 +696,11 @@ void SwSendMailDialog::UpdateTransferStatus()
else
m_aProgressBar.SetValue(0);
}
-/*-- 23.06.2004 11:18:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSendMailDialog::AllMailsSent()
{
m_aStopPB.Enable(sal_False);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mailmergechildwindow.hrc b/sw/source/ui/dbui/mailmergechildwindow.hrc
index 9b5931522975..deaebd021340 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.hrc
+++ b/sw/source/ui/dbui/mailmergechildwindow.hrc
@@ -27,7 +27,6 @@
#define TB_BACK 1
#define ILIST_TBX 90
-#define ILIST_TBX_HC 91
#define FL_SEPARATOR 7
@@ -47,7 +46,6 @@
#define ST_TASK 73
#define ST_STATUS 74
#define ILIST 75
-#define ILIST_HC 76
#define ST_SEND 77
#define ST_SENDINGTO 78
#define ST_COMPLETED 79
diff --git a/sw/source/ui/dbui/mailmergechildwindow.src b/sw/source/ui/dbui/mailmergechildwindow.src
index 5b5b32a7cc8d..6f2f9da46b4c 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.src
+++ b/sw/source/ui/dbui/mailmergechildwindow.src
@@ -76,13 +76,6 @@ FloatingWindow DLG_MAILMERGECHILD\
MaskColor = IMAGE_MASK_COLOR;
IMGLIST1_IDS;
};
-
- ImageList ILIST_TBX_HC
- {
- Prefix = "sch";
- MaskColor = IMAGE_MASK_COLOR ;
- IMGLIST1_IDS;
- };
};
//FloatingWindow DLG_MM_SENDMAILS
@@ -196,13 +189,6 @@ ModelessDialog /*ModalDialog*/ DLG_MM_SENDMAILS
MaskColor = IMAGE_MASK_COLOR;
IMGLIST2_IDS;
};
-
- ImageList ILIST_HC
- {
- Prefix = "sch";
- MaskColor = IMAGE_MASK_COLOR ;
- IMGLIST2_IDS;
- };
String ST_TASK
{
Text[ en-US ] = "Task";
diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx
index 63f4adae3895..f0988d0b6a9b 100644
--- a/sw/source/ui/dbui/mailmergehelper.cxx
+++ b/sw/source/ui/dbui/mailmergehelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <mailmergehelper.hxx>
#include <svtools/stdctrl.hxx>
#include <mmconfigitem.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/app.hxx>
@@ -47,9 +46,7 @@
#include "com/sun/star/mail/XSmtpService.hpp"
#include <comphelper/processfactory.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _PASSWD_HXX
#include <sfx2/passwd.hxx>
-#endif
#include <dbui.hrc>
@@ -62,14 +59,9 @@ using namespace ::com::sun::star::sdbcx;
using rtl::OUString;
-//using ::rtl::OUString;
-
namespace SwMailMergeHelper
{
-/*-- 14.06.2004 12:29:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
String CallSaveAsDialog(String& rFilter)
{
ErrCode nRet;
@@ -88,11 +80,12 @@ String CallSaveAsDialog(String& rFilter)
}
return sRet;
}
-/*-- 20.08.2004 09:39:18---------------------------------------------------
+
+/*
simple address check: check for '@'
for at least one '.' after the '@'
and for at least to characters before and after the dot
- -----------------------------------------------------------------------*/
+*/
bool CheckMailAddress( const ::rtl::OUString& rMailAddress )
{
String sAddress(rMailAddress);
@@ -106,9 +99,6 @@ bool CheckMailAddress( const ::rtl::OUString& rMailAddress )
return true;
}
-/*-- 28.12.2004 10:16:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
SwMailMergeConfigItem& rConfigItem,
uno::Reference< mail::XMailService >& rxInMailService,
@@ -152,7 +142,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
new SwConnectionContext(
rConfigItem.GetInServerName(),
rConfigItem.GetInServerPort(),
- ::rtl::OUString::createFromAscii( "Insecure" ));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure")));
xInMailService->connect(xConnectionContext, xAuthenticator);
rxInMailService = xInMailService;
}
@@ -179,13 +169,13 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
new SwConnectionContext(
rConfigItem.GetMailServer(),
rConfigItem.GetMailPort(),
- ::rtl::OUString::createFromAscii( rConfigItem.IsSecureConnection() ? "Ssl" : "Insecure"));
+ rConfigItem.IsSecureConnection() ? OUString(RTL_CONSTASCII_USTRINGPARAM("Ssl")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure")) );
xSmtpServer->connect(xConnectionContext, xAuthenticator);
rxInMailService = uno::Reference< mail::XMailService >( xSmtpServer, uno::UNO_QUERY );
}
catch(uno::Exception& )
{
- DBG_ERROR("exception caught");
+ OSL_FAIL("exception caught");
}
return xSmtpServer;
}
@@ -193,9 +183,6 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
} //namespace
-/*-- 06.04.2004 10:31:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwBoldFixedInfo::SwBoldFixedInfo(Window* pParent, const ResId& rResId) :
FixedInfo(pParent, rResId)
{
@@ -203,12 +190,11 @@ SwBoldFixedInfo::SwBoldFixedInfo(Window* pParent, const ResId& rResId) :
aFont.SetWeight( WEIGHT_BOLD );
SetFont( aFont );
}
-/*-- 06.04.2004 10:31:27---------------------------------------------------
- -----------------------------------------------------------------------*/
SwBoldFixedInfo::~SwBoldFixedInfo()
{
}
+
struct SwAddressPreview_Impl
{
::std::vector< ::rtl::OUString > aAdresses;
@@ -225,9 +211,7 @@ struct SwAddressPreview_Impl
{
}
};
-/*-- 27.04.2004 14:01:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddressPreview::SwAddressPreview(Window* pParent, const ResId rResId) :
Window( pParent, rResId ),
aVScrollBar(this, WB_VSCROLL),
@@ -242,31 +226,23 @@ SwAddressPreview::SwAddressPreview(Window* pParent, const ResId rResId) :
aVScrollBar.SetPosPixel(aSrollPos);
Show();
}
-/*-- 27.04.2004 14:01:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAddressPreview::~SwAddressPreview()
{
}
-/*-- 25.06.2004 11:50:55---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAddressPreview, ScrollHdl, ScrollBar*, EMPTYARG)
{
Invalidate();
return 0;
}
-/*-- 27.04.2004 14:01:22---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::AddAddress(const ::rtl::OUString& rAddress)
{
pImpl->aAdresses.push_back(rAddress);
UpdateScrollBar();
}
-/*-- 27.04.2004 14:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::SetAddress(const ::rtl::OUString& rAddress)
{
pImpl->aAdresses.clear();
@@ -274,20 +250,16 @@ void SwAddressPreview::SetAddress(const ::rtl::OUString& rAddress)
aVScrollBar.Show(sal_False);
Invalidate();
}
-/*-- 27.04.2004 14:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_uInt16 SwAddressPreview::GetSelectedAddress()const
{
- DBG_ASSERT(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid");
+ OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid");
return pImpl->nSelectedAddress;
}
-/*-- 25.06.2004 10:32:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::SelectAddress(sal_uInt16 nSelect)
{
- DBG_ASSERT(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid");
+ OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid");
pImpl->nSelectedAddress = nSelect;
// now make it visible..
sal_uInt16 nSelectRow = nSelect / pImpl->nColumns;
@@ -295,26 +267,20 @@ void SwAddressPreview::SelectAddress(sal_uInt16 nSelect)
if( (nSelectRow < nStartRow) || (nSelectRow >= (nStartRow + pImpl->nRows) ))
aVScrollBar.SetThumbPos( nSelectRow );
}
-/*-- 25.06.2004 11:00:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::Clear()
{
pImpl->aAdresses.clear();
pImpl->nSelectedAddress = 0;
UpdateScrollBar();
}
-/*-- 28.04.2004 12:05:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::ReplaceSelectedAddress(const ::rtl::OUString& rNew)
{
pImpl->aAdresses[pImpl->nSelectedAddress] = rNew;
Invalidate();
}
-/*-- 25.06.2004 11:30:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::RemoveSelectedAddress()
{
pImpl->aAdresses.erase(pImpl->aAdresses.begin() + pImpl->nSelectedAddress);
@@ -323,25 +289,19 @@ void SwAddressPreview::RemoveSelectedAddress()
UpdateScrollBar();
Invalidate();
}
-/*-- 27.04.2004 14:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
{
pImpl->nRows = nRows;
pImpl->nColumns = nColumns;
UpdateScrollBar();
}
-/*-- 25.06.2004 13:54:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::EnableScrollBar(bool bEnable)
{
pImpl->bEnableScrollBar = bEnable;
}
-/*-- 25.06.2004 11:55:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::UpdateScrollBar()
{
if(pImpl->nColumns)
@@ -355,9 +315,7 @@ void SwAddressPreview::UpdateScrollBar()
aVScrollBar.SetThumbPos(nResultingRows);
}
}
-/*-- 27.04.2004 14:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::Paint(const Rectangle&)
{
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
@@ -402,9 +360,6 @@ void SwAddressPreview::Paint(const Rectangle&)
SetClipRegion();
}
-/*-- 07.06.2004 15:44:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
Window::MouseButtonDown(rMEvt);
@@ -431,9 +386,7 @@ void SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt )
Invalidate();
}
}
-/*-- 01.07.2004 12:33:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
{
sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
@@ -473,18 +426,14 @@ void SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
else
Window::KeyInput(rKEvt);
}
-/*-- 05.07.2004 12:02:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::StateChanged( StateChangedType nStateChange )
{
if(nStateChange == STATE_CHANGE_ENABLE)
Invalidate();
Window::StateChanged(nStateChange);
}
-/*-- 27.04.2004 14:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAddressPreview::DrawText_Impl(
const ::rtl::OUString& rAddress, const Point& rTopLeft, const Size& rSize, bool bIsSelected)
{
@@ -507,9 +456,7 @@ void SwAddressPreview::DrawText_Impl(
aStart.Y() += nHeight;
}
}
-/*-- 29.04.2004 11:24:47---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwAddressPreview::FillData(
const ::rtl::OUString& rAddress,
SwMailMergeConfigItem& rConfigItem,
@@ -594,7 +541,7 @@ String SwAddressPreview::FillData(
}
catch( sdbc::SQLException& )
{
- DBG_ERROR("SQLException caught");
+ OSL_FAIL("SQLException caught");
}
}
}
@@ -609,9 +556,6 @@ String SwAddressPreview::FillData(
return sAddress;
}
-/*-- 11.05.2004 15:42:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMergeAddressItem SwAddressIterator::Next()
{
//currently the string may either start with a '<' then it's a column
@@ -623,7 +567,7 @@ SwMergeAddressItem SwAddressIterator::Next()
{
aRet.bIsColumn = true;
xub_StrLen nClose = sAddress.Search('>');
- DBG_ASSERT(nClose != STRING_NOTFOUND, "closing '>' not found");
+ OSL_ENSURE(nClose != STRING_NOTFOUND, "closing '>' not found");
if( nClose != STRING_NOTFOUND )
{
aRet.sText = sAddress.Copy(1, nClose - 1);
@@ -662,22 +606,16 @@ SwMergeAddressItem SwAddressIterator::Next()
return aRet;
}
-/*-- 21.05.2004 10:36:20---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAuthenticator::~SwAuthenticator()
{
}
-/*-- 21.05.2004 10:36:20---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwAuthenticator::getUserName( ) throw (RuntimeException)
{
return m_aUserName;
}
-/*-- 21.05.2004 10:36:20---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwAuthenticator::getPassword( ) throw (RuntimeException)
{
if(m_aUserName.getLength() && !m_aPassword.getLength() && m_pParentWindow)
@@ -690,9 +628,7 @@ OUString SwAuthenticator::getPassword( ) throw (RuntimeException)
}
return m_aPassword;
}
-/*-- 25.08.2004 12:53:03---------------------------------------------------
- -----------------------------------------------------------------------*/
SwConnectionContext::SwConnectionContext(
const ::rtl::OUString& rMailServer, sal_Int16 nPort,
const ::rtl::OUString& rConnectionType) :
@@ -701,15 +637,11 @@ SwConnectionContext::SwConnectionContext(
m_sConnectionType(rConnectionType)
{
}
-/*-- 25.08.2004 12:53:03---------------------------------------------------
- -----------------------------------------------------------------------*/
SwConnectionContext::~SwConnectionContext()
{
}
-/*-- 25.08.2004 12:53:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwConnectionContext::getValueByName( const ::rtl::OUString& rName )
throw (uno::RuntimeException)
{
@@ -722,51 +654,37 @@ uno::Any SwConnectionContext::getValueByName( const ::rtl::OUString& rName )
aRet <<= m_sConnectionType;
return aRet;
}
-/*-- 21.05.2004 10:45:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwConnectionListener::~SwConnectionListener()
{
}
-/*-- 21.05.2004 10:45:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwConnectionListener::connected(const lang::EventObject& /*aEvent*/)
throw (uno::RuntimeException)
{
- //OSL_ENSURE(false, "Connection opened");
}
-/*-- 21.05.2004 10:45:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwConnectionListener::disconnected(const lang::EventObject& /*aEvent*/)
throw (uno::RuntimeException)
{
- //OSL_ENSURE(false, "Connection closed");
}
-/*-- 21.05.2004 10:45:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwConnectionListener::disposing(const lang::EventObject& /*aEvent*/)
throw(uno::RuntimeException)
{
}
-/*-- 21.05.2004 10:17:22---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< uno::XComponentContext> getCurrentCmpCtx(
uno::Reference<lang::XMultiServiceFactory> rSrvMgr)
{
uno::Reference< beans::XPropertySet > xPropSet =
uno::Reference< beans::XPropertySet>(rSrvMgr, uno::UNO_QUERY);
- Any aAny = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii("DefaultContext"));
+ Any aAny = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")));
uno::Reference< uno::XComponentContext> rCmpCtx;
aAny >>= rCmpCtx;
return rCmpCtx;
}
-/*-- 13.07.2004 09:07:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailTransferable::SwMailTransferable(const rtl::OUString& rBody, const rtl::OUString& rMimeType) :
cppu::WeakComponentImplHelper2< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
m_aMimeType( rMimeType ),
@@ -774,9 +692,7 @@ SwMailTransferable::SwMailTransferable(const rtl::OUString& rBody, const rtl::OU
m_bIsBody( true )
{
}
-/*-- 13.07.2004 09:07:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailTransferable::SwMailTransferable(const rtl::OUString& rURL,
const rtl::OUString& rName, const rtl::OUString& rMimeType) :
cppu::WeakComponentImplHelper2< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
@@ -786,15 +702,11 @@ SwMailTransferable::SwMailTransferable(const rtl::OUString& rURL,
m_bIsBody( false )
{
}
-/*-- 13.07.2004 09:07:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailTransferable::~SwMailTransferable()
{
}
-/*-- 13.07.2004 09:07:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*aFlavor*/ )
throw (datatransfer::UnsupportedFlavorException,
io::IOException, uno::RuntimeException)
@@ -819,9 +731,7 @@ uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*
}
return aRet;
}
-/*-- 13.07.2004 09:07:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFlavors( )
throw (uno::RuntimeException)
{
@@ -838,70 +748,54 @@ uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFla
}
return aRet;
}
-/*-- 13.07.2004 09:07:08---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailTransferable::isDataFlavorSupported(
const datatransfer::DataFlavor& aFlavor )
throw (uno::RuntimeException)
{
return (aFlavor.MimeType == ::rtl::OUString(m_aMimeType));
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwMailTransferable::getPropertySetInfo( ) throw(uno::RuntimeException)
{
return uno::Reference< beans::XPropertySetInfo >();
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailTransferable::setPropertyValue( const ::rtl::OUString& , const uno::Any& )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwMailTransferable::getPropertyValue( const ::rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Any aRet;
- if( rPropertyName.equalsAscii( "URL" ) )
+ if( rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")))
aRet <<= m_aURL;
return aRet;
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailTransferable::addPropertyChangeListener(
const ::rtl::OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailTransferable::removePropertyChangeListener(
const ::rtl::OUString&,
const uno::Reference< beans::XPropertyChangeListener >& )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailTransferable::addVetoableChangeListener(
const ::rtl::OUString&,
const uno::Reference< beans::XVetoableChangeListener >& )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 28.04.2004 09:52:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailTransferable::removeVetoableChangeListener(
const ::rtl::OUString& ,
const uno::Reference< beans::XVetoableChangeListener >& )
@@ -909,89 +803,64 @@ void SwMailTransferable::removeVetoableChangeListener(
{
}
-/*-- 22.06.2004 16:46:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMessage::SwMailMessage() :
cppu::WeakComponentImplHelper1< mail::XMailMessage>(m_aMutex)
{
}
-/*-- 22.06.2004 16:46:06---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMessage::~SwMailMessage()
{
}
-/*-- 02.07.2007 16:00:07---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMessage::getSenderName() throw (uno::RuntimeException)
{
return m_sSenderName;
}
-/*-- 22.06.2004 16:46:06---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMessage::getSenderAddress() throw (uno::RuntimeException)
{
return m_sSenderAddress;
}
-/*-- 22.06.2004 16:46:06---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMessage::getReplyToAddress() throw (uno::RuntimeException)
{
return m_sReplyToAddress;
}
-/*-- 22.06.2004 16:46:07---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::setReplyToAddress( const ::rtl::OUString& _replytoaddress ) throw (uno::RuntimeException)
{
m_sReplyToAddress = _replytoaddress;
}
-/*-- 22.06.2004 16:46:07---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMessage::getSubject() throw (uno::RuntimeException)
{
return m_sSubject;
}
-/*-- 22.06.2004 16:46:07---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::setSubject( const ::rtl::OUString& _subject ) throw (uno::RuntimeException)
{
m_sSubject = _subject;
}
-/*-- 13.07.2004 09:57:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< datatransfer::XTransferable > SwMailMessage::getBody() throw (uno::RuntimeException)
{
return m_xBody;
}
-/*-- 13.07.2004 09:57:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::setBody(
const uno::Reference< datatransfer::XTransferable >& rBody )
throw (uno::RuntimeException)
{
m_xBody = rBody;
}
-/*-- 22.06.2004 16:46:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::addRecipient( const ::rtl::OUString& rRecipientAddress )
throw (uno::RuntimeException)
{
m_aRecipients.realloc(m_aRecipients.getLength() + 1);
m_aRecipients[m_aRecipients.getLength() - 1] = rRecipientAddress;
}
-/*-- 22.06.2004 16:46:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::addCcRecipient( const ::rtl::OUString& rRecipientAddress )
throw (uno::RuntimeException)
{
@@ -999,49 +868,39 @@ void SwMailMessage::addCcRecipient( const ::rtl::OUString& rRecipientAddress )
m_aCcRecipients[m_aCcRecipients.getLength() - 1] = rRecipientAddress;
}
-/*-- 22.06.2004 16:46:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::addBccRecipient( const ::rtl::OUString& rRecipientAddress ) throw (uno::RuntimeException)
{
m_aBccRecipients.realloc(m_aBccRecipients.getLength() + 1);
m_aBccRecipients[m_aBccRecipients.getLength() - 1] = rRecipientAddress;
}
-/*-- 22.06.2004 16:46:09---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString > SwMailMessage::getRecipients( ) throw (uno::RuntimeException)
{
return m_aRecipients;
}
-/*-- 22.06.2004 16:46:10---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString > SwMailMessage::getCcRecipients( ) throw (uno::RuntimeException)
{
return m_aCcRecipients;
}
-/*-- 22.06.2004 16:46:10---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString > SwMailMessage::getBccRecipients( ) throw (uno::RuntimeException)
{
return m_aBccRecipients;
}
-/*-- 13.07.2004 09:59:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMessage::addAttachment( const mail::MailAttachment& rMailAttachment )
throw (uno::RuntimeException)
{
m_aAttachments.realloc(m_aAttachments.getLength() + 1);
m_aAttachments[m_aAttachments.getLength() - 1] = rMailAttachment;
}
-/*-- 13.07.2004 09:59:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< mail::MailAttachment > SwMailMessage::getAttachments( )
throw (uno::RuntimeException)
{
return m_aAttachments;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 365c56b4c0ea..b9eb521f26c7 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,27 +44,19 @@
#include <mmlayoutpage.hxx>
#include <mmconfigitem.hxx>
#include <swabstdlg.hxx>
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
#include <view.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <sfx2/viewfrm.hxx>
#include <wrtsh.hxx>
-#include <sfx2/viewfrm.hxx>
#include "vcl/msgbox.hxx" // RET_CANCEL
#include <helpid.h>
-#include <dbui.hrc>
#include <mailmergewizard.hrc>
using namespace svt;
using namespace ::com::sun::star;
-/*-- 01.04.2004 16:52:49---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem) :
RoadmapWizard(&rView.GetViewFrame()->GetWindow(),
SW_RES(DLG_MAILMERGEWIZARD),
@@ -122,15 +115,11 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
ActivatePage();
UpdateRoadmap();
}
-/*-- 01.04.2004 16:52:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeWizard::~SwMailMergeWizard()
{
}
-/*-- 01.04.2004 16:52:53---------------------------------------------------
- -----------------------------------------------------------------------*/
OWizardPage* SwMailMergeWizard::createPage(WizardState _nState)
{
OWizardPage* pRet = 0;
@@ -145,16 +134,15 @@ OWizardPage* SwMailMergeWizard::createPage(WizardState _nState)
case MM_MERGEPAGE : pRet = new SwMailMergeMergePage(this); break;
case MM_OUTPUTPAGE : pRet = new SwMailMergeOutputPage(this); break;
}
- DBG_ASSERT(pRet, "no page created in ::createPage");
+ OSL_ENSURE(pRet, "no page created in ::createPage");
return pRet;
}
-/*-- 04.06.2004 13:18:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeWizard::enterState( WizardState _nState )
{
::svt::RoadmapWizard::enterState( _nState );
/*
+
entering a page after the layoutpage requires the insertion
of greeting and address block - if not yet done
entering the merge or output page requires to create the output document
@@ -201,9 +189,7 @@ void SwMailMergeWizard::enterState( WizardState _nState )
UpdateRoadmap();
}
-/*-- 04.06.2004 12:54:13---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const
{
String sRet;
@@ -224,7 +210,7 @@ String SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const
}
return sRet;
}
-/*-- 24.06.2004 09:24:45---------------------------------------------------
+/*----------------------------------------------------------------------
enables/disables pages in the roadmap depending on the current
page and state
-----------------------------------------------------------------------*/
@@ -297,7 +283,7 @@ void SwMailMergeWizard::UpdateRoadmap()
enableState( nPage, bEnable );
}
}
-/*-- 24.06.2004 09:24:45---------------------------------------------------
+/*-- --------------------------------------------------------------------
enables/disables pages in the roadmap depending on the current
page and state
-----------------------------------------------------------------------*/
@@ -309,28 +295,24 @@ void SwMailMergeWizard::CreateTargetDocument()
if( m_rConfigItem.GetTargetView() )
m_rConfigItem.GetTargetView()->GetViewFrame()->GetFrame().Appear();
}
-/*-- 23.08.2004 08:51:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeWizard::updateRoadmapItemLabel( WizardState _nState )
{
svt::RoadmapWizard::updateRoadmapItemLabel( _nState );
}
-// ------------------------------------------------------------------------
-
short SwMailMergeWizard::Execute()
{
- DBG_ERROR( "SwMailMergeWizard cannot be executed via Dialog::Execute!\n"
+ OSL_FAIL("SwMailMergeWizard cannot be executed via Dialog::Execute!\n"
"It creates a thread (MailDispatcher instance) that will call"
"back to VCL apartment => deadlock!\n"
"Use Dialog::StartExecuteModal to execute the dialog!" );
return RET_CANCEL;
}
-// ------------------------------------------------------------------------
-
void SwMailMergeWizard::StartExecuteModal( const Link& rEndDialogHdl )
{
::svt::RoadmapWizard::StartExecuteModal( rEndDialogHdl );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index f56da53ceeb2..821500a3df17 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,16 +55,13 @@ using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
-//-------------------------------------------------------------------------
void lcl_Move(Control* pCtrl, long nYOffset)
{
Point aPos(pCtrl->GetPosPixel());
aPos.Y() += nYOffset;
pCtrl->SetPosPixel(aPos);
}
-/*-- 02.04.2004 12:46:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pParent) :
svt::OWizardPage(_pParent, SW_RES(DLG_MM_ADDRESSBLOCK_PAGE)),
#ifdef MSC
@@ -112,22 +110,16 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP
m_aPrevSetIB.SetClickHdl(aLink);
m_aNextSetIB.SetClickHdl(aLink);
}
-/*-- 02.04.2004 12:46:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage()
{
}
-/*-- 05.07.2004 13:55:15---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwMailMergeAddressBlockPage::canAdvance() const
{
return m_pWizard->GetConfigItem().GetResultSet().is();
}
-/*-- 16.06.2004 12:34:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeAddressBlockPage::ActivatePage()
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -172,18 +164,14 @@ void SwMailMergeAddressBlockPage::ActivatePage()
InsertDataHdl_Impl(0);
}
}
-/*-- 27.05.2004 13:59:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if ( ::svt::WizardTypes::eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() )
return sal_False;
return sal_True;
}
-/*-- 07.04.2004 16:19:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, AddressListHdl_Impl, PushButton*, EMPTYARG)
{
SwAddressListDialog* pAddrDialog = new SwAddressListDialog(this);
@@ -204,9 +192,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressListHdl_Impl, PushButton*, EMPTYAR
delete pAddrDialog;
return 0;
}
-/*-- 07.04.2004 16:19:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton)
{
SwSelectAddressBlockDialog* pDlg =
@@ -233,9 +219,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton)
GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE));
return 0;
}
-/*-- 07.04.2004 16:19:31---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -253,9 +237,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton)
delete pDlg;
return 0;
}
-/*-- 11.06.2004 13:37:22---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeAddressBlockPage::EnableAddressBlock(sal_Bool bAll, sal_Bool bSelective)
{
m_aSettingsFI.Enable(bAll);
@@ -273,9 +255,7 @@ void SwMailMergeAddressBlockPage::EnableAddressBlock(sal_Bool bAll, sal_Bool bSe
m_aPrevSetIB.Enable(bSelective);
m_aNextSetIB.Enable(bSelective);
}
-/*-- 28.04.2004 12:45:58---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockHdl_Impl, CheckBox*, pBox)
{
EnableAddressBlock(pBox->IsEnabled(), pBox->IsChecked());
@@ -284,9 +264,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockHdl_Impl, CheckBox*, pBox)
m_pWizard->UpdateRoadmap();
return 0;
}
-/*-- 08.06.2004 13:00:29---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockSelectHdl_Impl, SwAddressPreview*, EMPTYARG)
{
sal_uInt16 nSel = m_aSettingsWIN.GetSelectedAddress();
@@ -299,9 +277,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockSelectHdl_Impl, SwAddressPrev
GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE));
return 0;
}
-/*-- 31.08.2005 15:34:55---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeAddressBlockPage, HideParagraphsHdl_Impl, CheckBox*, pBox)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -309,7 +285,6 @@ IMPL_LINK(SwMailMergeAddressBlockPage, HideParagraphsHdl_Impl, CheckBox*, pBox)
return 0;
}
-// ------------------------------------------------------------------------------
IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton)
{
//if no pButton is given, the first set has to be pre-set
@@ -347,8 +322,6 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton
}
}
m_aPrevSetIB.Enable(bEnable);
- //m_aNextSetIB.Enable(bEnable);
- //m_aDocumentIndexFI.Enable(bEnable);
String sTemp(m_sDocument);
sTemp.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPos));
m_aDocumentIndexFI.SetText(sTemp);
@@ -366,9 +339,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton
EnableAddressBlock(bHasResultSet, m_aAddressCB.IsChecked());
return 0;
}
-/*-- 13.04.2004 16:01:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSelectAddressBlockDialog::SwSelectAddressBlockDialog(
Window* pParent, SwMailMergeConfigItem& rConfig) :
SfxModalDialog(pParent, SW_RES(DLG_MM_SELECTADDRESSBLOCK)),
@@ -409,15 +380,11 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog(
m_aPreview.SetLayout(2, 2);
m_aPreview.EnableScrollBar();
}
-/*-- 13.04.2004 16:01:27---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSelectAddressBlockDialog::~SwSelectAddressBlockDialog()
{
}
-/*-- 28.04.2004 11:48:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< ::rtl::OUString>& rBlocks,
sal_uInt16 nSelectedAddress)
{
@@ -426,9 +393,8 @@ void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< ::rtl::OU
m_aPreview.AddAddress(m_aAddressBlocks[nAddress]);
m_aPreview.SelectAddress(nSelectedAddress);
}
-/*-- 25.06.2004 10:51:36---------------------------------------------------
- return the address blocks and put the selected one to the first position
- -----------------------------------------------------------------------*/
+
+// return the address blocks and put the selected one to the first position
const uno::Sequence< ::rtl::OUString >& SwSelectAddressBlockDialog::GetAddressBlocks()
{
//put the selected block to the first position
@@ -451,9 +417,7 @@ const uno::Sequence< ::rtl::OUString >& SwSelectAddressBlockDialog::GetAddres
}
return m_aAddressBlocks;
}
-/*-- 28.04.2004 11:48:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSelectAddressBlockDialog::SetSettings(
sal_Bool bIsCountry, ::rtl::OUString rCountry)
{
@@ -466,9 +430,7 @@ void SwSelectAddressBlockDialog::SetSettings(
m_aNeverRB.Check();
m_aDeletePB.Enable(m_aAddressBlocks.getLength() > 1);
}
-/*-- 10.05.2004 11:17:06---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwSelectAddressBlockDialog::GetCountry() const
{
::rtl::OUString sRet;
@@ -477,9 +439,6 @@ void SwSelectAddressBlockDialog::SetSettings(
return sRet;
}
-/*-- 13.04.2004 16:02:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwSelectAddressBlockDialog, DeleteHdl_Impl, PushButton*, pButton)
{
if(m_aAddressBlocks.getLength())
@@ -500,9 +459,7 @@ IMPL_LINK(SwSelectAddressBlockDialog, DeleteHdl_Impl, PushButton*, pButton)
}
return 0;
}
-/*-- 13.04.2004 16:02:32---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton)
{
bool bCustomize = pButton == &m_aCustomizePB;
@@ -537,24 +494,17 @@ IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton
delete pDlg;
return 0;
}
-/*-- 13.04.2004 16:02:33---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwSelectAddressBlockDialog, IncludeHdl_Impl, RadioButton*, pButton)
{
m_aCountryED.Enable(&m_aDependentRB == pButton);
return 0;
}
-/* -----------------------------28.02.05 09:00--------------------------------
-
- ---------------------------------------------------------------------------*/
SwRestrictedComboBox::~SwRestrictedComboBox()
{
}
-/* -----------------------------28.02.05 09:00--------------------------------
- ---------------------------------------------------------------------------*/
void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt)
{
sal_Bool bCallParent = sal_True;
@@ -567,9 +517,7 @@ void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt)
if(bCallParent)
ComboBox::KeyInput(rEvt);
}
-/* -----------------------------28.02.05 09:00--------------------------------
- ---------------------------------------------------------------------------*/
void SwRestrictedComboBox::Modify()
{
Selection aSel = GetSelection();
@@ -590,9 +538,6 @@ void SwRestrictedComboBox::Modify()
GetModifyHdl().Call(this);
}
-/*-- 13.04.2004 16:01:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
#define USER_DATA_SALUTATION -1
#define USER_DATA_PUNCTUATION -2
#define USER_DATA_TEXT -3
@@ -676,7 +621,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
{
const XubString& rHeader = rHeaders.GetString( i );
SvLBoxEntry* pEntry = m_aAddressElementsLB.InsertEntry(rHeader);
- pEntry->SetUserData((void*)(sal_Int32)i);
+ pEntry->SetUserData((void*)(sal_IntPtr)i);
}
m_aOK.SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl));
m_aAddressElementsLB.SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl ));
@@ -694,23 +639,17 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
m_aDownIB.SetClickHdl(aImgButtonHdl);
UpdateImageButtons_Impl();
}
-/*-- 13.04.2004 16:01:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCustomizeAddressBlockDialog::~SwCustomizeAddressBlockDialog()
{
}
-/*-- 07.06.2004 13:51:11---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, OKHdl_Impl, OKButton*, EMPTYARG)
{
EndDialog(RET_OK);
return 0;
}
-/*-- 24.06.2004 11:36:05---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, pBox)
{
sal_Int32 nUserData = (sal_Int32)(sal_IntPtr)pBox->FirstSelected()->GetUserData();
@@ -718,9 +657,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, pBox
m_aInsertFieldIB.Enable(nUserData >= 0 || !HasItem_Impl(nUserData));
return 0;
}
-/*-- 25.06.2004 11:21:24---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl, AddressMultiLineEdit*, EMPTYARG)
{
String sAddress = SwAddressPreview::FillData(
@@ -730,9 +667,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl, AddressMultiLineEdi
UpdateImageButtons_Impl();
return 0;
}
-/*-- 25.06.2004 12:14:11---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, ImageButton*, pButton)
{
if(&m_aInsertFieldIB == pButton)
@@ -764,9 +699,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, ImageButton*, pBut
UpdateImageButtons_Impl();
return 0;
}
-/*-- 01.07.2004 09:27:02---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl()
{
sal_Int32 nRet = USER_DATA_NONE;
@@ -784,9 +717,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl()
}
return nRet;
}
-/*-- 01.07.2004 10:01:19---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData)
{
//get the entry from the ListBox
@@ -808,9 +739,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData)
bool bRet = sText.Search(sEntry) != STRING_NOTFOUND;
return bRet;
}
-/*-- 25.06.2004 13:10:16---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl, AddressMultiLineEdit*, pEdit)
{
// called in case the selection of the edit field changes.
@@ -863,9 +792,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl, AddressMultiL
bOnEntry = false;
return 0;
}
-/*-- 25.06.2004 13:36:29---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, ComboBox*, EMPTYARG)
{
//changing the field content changes the related members, too
@@ -888,9 +815,6 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, ComboBox*, EMPTYAR
return 0;
}
-/*-- 25.06.2004 12:35:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl()
{
sal_uInt16 nMove = m_aDragED.IsCurrentItemMoveable();
@@ -903,18 +827,14 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl()
m_aInsertFieldIB.Enable( pEntry &&
(0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || m_aFieldCB.GetText().Len()));
}
-/*-- 28.04.2004 12:04:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress)
{
m_aDragED.SetText( rAddress );
UpdateImageButtons_Impl();
m_aDragED.Modify();
}
-/*-- 28.04.2004 12:04:14---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwCustomizeAddressBlockDialog::GetAddress()
{
String sAddress(m_aDragED.GetAddress());
@@ -938,9 +858,7 @@ void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress)
}
return sAddress;
}
-/*-- 28.02.2005 11:03:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext )
{
::std::vector< Window* > aControls;
@@ -966,7 +884,7 @@ void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext )
}
if( aMemberIter == aControls.end() )
{
- DBG_ERROR( "Window not found?" );
+ OSL_FAIL("Window not found?" );
return;
}
@@ -1007,9 +925,7 @@ void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext )
}
}
-/*-- 13.04.2004 17:49:45---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwAssignFieldsControl : public Control
{
friend class SwAssignFieldsDialog;
@@ -1048,10 +964,7 @@ public:
m_aModifyHdl.Call(this);
}
};
-/*-- 13.04.2004 17:51:27---------------------------------------------------
- -----------------------------------------------------------------------*/
-//-------------------------------------------------------------------------
SwAssignFieldsControl::SwAssignFieldsControl(
Window* pParent, const ResId& rResId, SwMailMergeConfigItem& rConfigItem) :
Control(pParent, rResId),
@@ -1172,9 +1085,6 @@ SwAssignFieldsControl::SwAssignFieldsControl(
m_aMatches.push_back(pNewLB);
m_aPreviews.push_back(pNewPreview);
}
- ListBox* pBottomBox = m_aMatches[rHeaders.Count() -1];
- long nYBottom = pBottomBox->GetPosPixel().Y();
- nYBottom += pBottomBox->GetDropDownPosSizePixel().GetHeight();
m_aVScroll.SetRange(Range(0, rHeaders.Count()));
m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset);
m_aVScroll.EnableDrag();
@@ -1186,9 +1096,7 @@ SwAssignFieldsControl::SwAssignFieldsControl(
m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight));
}
-/*-- 13.04.2004 17:51:28---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAssignFieldsControl::~SwAssignFieldsControl()
{
::std::vector<FixedInfo*>::iterator aFIIter;
@@ -1201,9 +1109,6 @@ SwAssignFieldsControl::~SwAssignFieldsControl()
delete *aFIIter;
}
-/*-- 07.05.2004 13:11:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwAssignFieldsControl::Command( const CommandEvent& rCEvt )
{
switch ( rCEvt.GetCommand() )
@@ -1223,9 +1128,7 @@ void SwAssignFieldsControl::Command( const CommandEvent& rCEvt )
Control::Command(rCEvt);
}
}
-/*-- 07.05.2004 13:11:21---------------------------------------------------
- -----------------------------------------------------------------------*/
long SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt )
{
if(rNEvt.GetType() == EVENT_COMMAND)
@@ -1240,9 +1143,7 @@ long SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt )
}
return Control::PreNotify(rNEvt);
}
-/*-- 03.09.2004 13:19:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAssignFieldsControl::MakeVisible( sal_Int32 nIndex )
{
long nThumb = m_aVScroll.GetThumbPos();
@@ -1255,9 +1156,7 @@ void SwAssignFieldsControl::MakeVisible( sal_Int32 nIndex )
return;
ScrollHdl_Impl( &m_aVScroll );
}
-/*-- 30.04.2004 16:10:58---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
{
long nThumb = pScroll->GetThumbPos();
@@ -1282,9 +1181,6 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
return 0;
}
-/*-- 03.05.2004 15:37:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
{
String sColumn = pBox->GetSelectEntry();
@@ -1320,9 +1216,7 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
m_aModifyHdl.Call(0);
return 0;
}
-/*-- 03.09.2004 13:16:04---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
{
if(0 != (GETFOCUS_TAB & pBox->GetGetFocusFlags()))
@@ -1340,9 +1234,7 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
}
return 0;
}
-/*-- 13.04.2004 17:44:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAssignFieldsDialog::SwAssignFieldsDialog(
Window* pParent, SwMailMergeConfigItem& rConfigItem,
const ::rtl::OUString& rPreview,
@@ -1394,16 +1286,12 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
m_aOK.SetClickHdl(LINK(this, SwAssignFieldsDialog, OkHdl_Impl));
}
-/*-- 13.04.2004 17:44:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAssignFieldsDialog::~SwAssignFieldsDialog()
{
delete m_pFieldsControl;
}
-/*-- 05.05.2004 14:39:13---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString > SwAssignFieldsDialog::CreateAssignments()
{
uno::Sequence< ::rtl::OUString > aAssignments(
@@ -1423,9 +1311,7 @@ uno::Sequence< ::rtl::OUString > SwAssignFieldsDialog::CreateAssignments()
}
return aAssignments;
}
-/*-- 03.05.2004 18:04:00---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAssignFieldsDialog, OkHdl_Impl, PushButton*, EMPTYARG)
{
m_rConfigItem.SetColumnAssignment(
@@ -1434,9 +1320,7 @@ IMPL_LINK(SwAssignFieldsDialog, OkHdl_Impl, PushButton*, EMPTYARG)
EndDialog(RET_OK);
return 0;
}
-/*-- 05.05.2004 14:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwAssignFieldsDialog, AssignmentModifyHdl_Impl, void*, EMPTYARG)
{
uno::Sequence< ::rtl::OUString > aAssignments = CreateAssignments();
@@ -1446,16 +1330,12 @@ IMPL_LINK(SwAssignFieldsDialog, AssignmentModifyHdl_Impl, void*, EMPTYARG)
return 0;
}
-/*-- 26.05.2004 11:20:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId) :
SvTreeListBox(pParent, rResId),
m_pParentDialog(pParent)
{
SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
WB_CLIPCHILDREN );
-// SetSpaceBetweenEntries(3);
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( SV_DRAGDROP_CTRL_COPY );
EnableAsyncDrag(sal_True);
@@ -1465,15 +1345,11 @@ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId)
Show();
}
-/*-- 26.05.2004 11:20:15---------------------------------------------------
- -----------------------------------------------------------------------*/
DDListBox::~DDListBox()
{
}
-/*-- 26.05.2004 11:20:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
{
SvLBoxEntry* pEntry = GetCurEntry();
@@ -1501,9 +1377,7 @@ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
}
}
}
-/*-- 26.05.2004 13:14:53---------------------------------------------------
- -----------------------------------------------------------------------*/
AddressMultiLineEdit::AddressMultiLineEdit(SwCustomizeAddressBlockDialog* pParent, const ResId& rResId) :
MultiLineEdit(pParent, rResId),
m_pParentDialog(pParent)
@@ -1511,19 +1385,14 @@ AddressMultiLineEdit::AddressMultiLineEdit(SwCustomizeAddressBlockDialog* pParen
{
GetTextView()->SupportProtectAttribute(sal_True);
StartListening(*GetTextEngine());
- //DisableSelectionOnFocus();
EnableFocusSelectionHide(sal_False);
}
-/*-- 26.05.2004 13:14:53---------------------------------------------------
- -----------------------------------------------------------------------*/
AddressMultiLineEdit::~AddressMultiLineEdit()
{
EndListening(*GetTextEngine());
}
-/*-- 25.06.2004 13:02:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if(rHint.ISA(TextHint) &&
@@ -1533,9 +1402,7 @@ void AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rH
m_aSelectionLink.Call(this);
}
}
-/*-- 26.05.2004 13:45:46---------------------------------------------------
- -----------------------------------------------------------------------*/
long AddressMultiLineEdit::PreNotify( NotifyEvent& rNEvt )
{
long nHandled = 0;
@@ -1560,9 +1427,7 @@ long AddressMultiLineEdit::PreNotify( NotifyEvent& rNEvt )
return nHandled;
}
-/*-- 25.06.2004 08:20:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void AddressMultiLineEdit::SetText( const String& rStr )
{
MultiLineEdit::SetText(rStr);
@@ -1605,10 +1470,8 @@ void AddressMultiLineEdit::SetText( const String& rStr )
}
}
-/*-- 25.06.2004 12:32:41---------------------------------------------------
- Insert the new entry in front of the entry at the beginning of the selection
- -----------------------------------------------------------------------*/
+// Insert the new entry in front of the entry at the beginning of the selection
void AddressMultiLineEdit::InsertNewEntry( const String& rStr )
{
// insert new entry after current selected one.
@@ -1645,16 +1508,13 @@ void AddressMultiLineEdit::InsertNewEntryAtPosition( const String& rStr, sal_uLo
pTextView->SetSelection(aEntrySel);
m_aSelectionLink.Call(this);
}
-/*-- 25.06.2004 12:32:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void AddressMultiLineEdit::RemoveCurrentEntry()
{
ExtTextEngine* pTextEngine = GetTextEngine();
ExtTextView* pTextView = GetTextView();
const TextSelection& rSelection = pTextView->GetSelection();
const TextCharAttrib* pBeginAttrib = pTextEngine->FindCharAttrib( rSelection.GetStart(), TEXTATTR_PROTECTED );
-// const TextCharAttrib* pEndAttrib = pTextEngine->FindCharAttrib( rSelection.GetEnd(), TEXTATTR_PROTECTED );
if(pBeginAttrib &&
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
@@ -1667,9 +1527,7 @@ void AddressMultiLineEdit::RemoveCurrentEntry()
Modify();
}
}
-/*-- 25.06.2004 12:32:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
{
ExtTextEngine* pTextEngine = GetTextEngine();
@@ -1742,9 +1600,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
Modify();
}
}
-/*-- 25.06.2004 12:32:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable()
{
sal_uInt16 nRet = 0;
@@ -1752,7 +1608,6 @@ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable()
ExtTextView* pTextView = GetTextView();
const TextSelection& rSelection = pTextView->GetSelection();
const TextCharAttrib* pBeginAttrib = pTextEngine->FindCharAttrib( rSelection.GetStart(), TEXTATTR_PROTECTED );
-// const TextCharAttrib* pEndAttrib = pTextEngine->FindCharAttrib( rSelection.GetEnd(), TEXTATTR_PROTECTED );
if(pBeginAttrib &&
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
@@ -1766,9 +1621,7 @@ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable()
}
return nRet;
}
-/*-- 25.06.2004 12:32:42---------------------------------------------------
- -----------------------------------------------------------------------*/
bool AddressMultiLineEdit::HasCurrentItem()
{
ExtTextEngine* pTextEngine = GetTextEngine();
@@ -1779,9 +1632,7 @@ bool AddressMultiLineEdit::HasCurrentItem()
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()));
}
-/*-- 01.07.2004 09:07:44---------------------------------------------------
- -----------------------------------------------------------------------*/
String AddressMultiLineEdit::GetCurrentItem()
{
String sRet;
@@ -1799,9 +1650,7 @@ String AddressMultiLineEdit::GetCurrentItem()
}
return sRet;
}
-/*-- 05.07.2004 14:29:02---------------------------------------------------
- -----------------------------------------------------------------------*/
void AddressMultiLineEdit::SelectCurrentItem()
{
ExtTextEngine* pTextEngine = GetTextEngine();
@@ -1818,11 +1667,7 @@ void AddressMultiLineEdit::SelectCurrentItem()
Invalidate();
}
}
-/*-- 25.06.2004 09:10:43---------------------------------------------------
- returns the address
- remove trailing spaces
- and trailing empty paragraphs
- -----------------------------------------------------------------------*/
+
String AddressMultiLineEdit::GetAddress()
{
String sRet;
@@ -1844,3 +1689,4 @@ String AddressMultiLineEdit::GetAddress()
return sRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index b5f4a3fc87a6..d6b92245e2ac 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _MAILMERGEADDRESSBLOCKPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>
#include <sfx2/basedlgs.hxx>
@@ -43,9 +42,7 @@
#include <svl/lstner.hxx>
class SwMailMergeWizard;
class SwMailMergeConfigItem;
-/*-- 13.04.2004 15:50:37---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeAddressBlockPage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -107,9 +104,7 @@ public:
SwMailMergeWizard* GetWizard() { return m_pWizard;}
};
-/*-- 13.04.2004 15:45:31---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwSelectAddressBlockDialog : public SfxModalDialog
{
FixedText m_aSelectFT;
@@ -152,10 +147,6 @@ public:
::rtl::OUString GetCountry() const;
};
-
-/*-- 26.05.2004 11:16:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwCustomizeAddressBlockDialog;
class DDListBox : public SvTreeListBox
{
@@ -166,9 +157,7 @@ public:
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
};
-/*-- 26.05.2004 11:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
#define MOVE_ITEM_LEFT 1
#define MOVE_ITEM_RIGHT 2
#define MOVE_ITEM_UP 4
@@ -206,10 +195,8 @@ public:
String GetCurrentItem();
void SelectCurrentItem();
};
-/*-- 13.04.2004 15:45:31---------------------------------------------------
- Dialog is used to create custom address blocks as well as
- custom greeting lines
- -----------------------------------------------------------------------*/
+
+// Dialog is used to create custom address blocks as well as custom greeting lines
class SwRestrictedComboBox : public ComboBox
{
String sForbiddenChars;
@@ -223,7 +210,7 @@ public:
~SwRestrictedComboBox();
- void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;}
+ void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;}
};
class SwCustomizeAddressBlockDialog : public SfxModalDialog
@@ -293,9 +280,7 @@ public:
void SetAddress(const ::rtl::OUString& rAddress);
::rtl::OUString GetAddress();
};
-/*-- 13.04.2004 17:41:11---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwAssignFieldsControl;
class SwAssignFieldsDialog : public SfxModalDialog
{
@@ -330,3 +315,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmaddressblockpage.src b/sw/source/ui/dbui/mmaddressblockpage.src
index 43d5b9126eb4..ced9027851b0 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.src
+++ b/sw/source/ui/dbui/mmaddressblockpage.src
@@ -194,9 +194,6 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
};
-/*-- 13.04.2004 16:07:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
ModalDialog DLG_MM_SELECTADDRESSBLOCK
{
OutputSize = TRUE ;
@@ -301,10 +298,6 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK
};
};
-/*-- 13.04.2004 16:07:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
#define WORKAROUND\
Text [ en-US ] = "New Address Block";
@@ -534,9 +527,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
};
};
-/*-- 13.04.2004 17:45:24---------------------------------------------------
- -----------------------------------------------------------------------*/
ModalDialog DLG_MM_ASSIGNFIELDS
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index 442cb4de6e9c..12195d0e5687 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <mmconfigitem.hxx>
#include <swtypes.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/sdb/XCompletedConnection.hpp>
@@ -47,12 +48,8 @@
#include <unotools/configitem.hxx>
#include <mailmergehelper.hxx>
#include <swunohelper.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <dbui.hrc>
#include <vector>
@@ -82,9 +79,6 @@ const char* cDataCommandType = "DataSource/DataCommandType";
#define DEFAULT_PORT 25
#define POP_PORT 110
-/*-- 16.04.2004 09:41:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
struct DBAddressDataAssignment
{
SwDBData aDBData;
@@ -99,9 +93,6 @@ struct DBAddressDataAssignment
{}
};
-/*-- 16.04.2004 09:43:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailMergeConfigItem_Impl : public utl::ConfigItem
{
friend class SwMailMergeConfigItem;
@@ -202,9 +193,6 @@ public:
};
-/*-- 06.05.2004 12:51:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
ConfigItem(C2U("Office.Writer/MailMergeWizard"), 0),
nResultSetCursorPos(-1),
@@ -237,7 +225,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
const Sequence<OUString>& rNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(rNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed");
if(aValues.getLength() == rNames.getLength())
{
for(int nProp = 0; nProp < rNames.getLength(); nProp++)
@@ -314,7 +302,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
}
}
//read the list of data base assignments
- Sequence<OUString> aAssignments = GetNodeNames(C2U(cAddressDataAssignments));
+ Sequence<OUString> aAssignments = GetNodeNames(rtl::OUString::createFromAscii(cAddressDataAssignments));
if(aAssignments.getLength())
{
//create a list of property names to load the URLs of all data bases
@@ -325,18 +313,18 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
OUString sSlash = C2U("/");
for(nAssign = 0; nAssign < aAssignProperties.getLength(); nAssign += 4)
{
- String sAssignPath = C2U(cAddressDataAssignments);
+ String sAssignPath = rtl::OUString::createFromAscii(cAddressDataAssignments);
sAssignPath += '/';
sAssignPath += String(pAssignments[nAssign / 4]);
sAssignPath += '/';
pAssignProperties[nAssign] = sAssignPath;
- pAssignProperties[nAssign] += C2U(cDataSourceName);
+ pAssignProperties[nAssign] += rtl::OUString::createFromAscii(cDataSourceName);
pAssignProperties[nAssign + 1] = sAssignPath;
- pAssignProperties[nAssign + 1] += C2U(cDataTableName);
+ pAssignProperties[nAssign + 1] += rtl::OUString::createFromAscii(cDataTableName);
pAssignProperties[nAssign + 2] = sAssignPath;
- pAssignProperties[nAssign + 2] += C2U(cDataCommandType);
+ pAssignProperties[nAssign + 2] += rtl::OUString::createFromAscii(cDataCommandType);
pAssignProperties[nAssign + 3] = sAssignPath;
- pAssignProperties[nAssign + 3] += C2U(cDBColumnAssignments);
+ pAssignProperties[nAssign + 3] += rtl::OUString::createFromAscii(cDBColumnAssignments);
}
Sequence<Any> aAssignValues = GetProperties(aAssignProperties);
const Any* pAssignValues = aAssignValues.getConstArray();
@@ -372,15 +360,11 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
}
}
-/*-- 06.05.2004 12:51:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeConfigItem_Impl::~SwMailMergeConfigItem_Impl()
{
}
-/*-- 13.03.2006 12:12:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem_Impl::SetCurrentAddressBlockIndex( sal_Int32 nSet )
{
if(aAddressBlocks.size() >= sal::static_int_cast<sal_uInt32, sal_Int32>(nSet))
@@ -389,9 +373,7 @@ void SwMailMergeConfigItem_Impl::SetCurrentAddressBlockIndex( sal_Int32 nSet )
SetModified();
}
}
-/*-- 16.04.2004 13:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments )
{
const OUString* pNames = rAssignments.getConstArray();
@@ -420,7 +402,7 @@ OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments )
rAssignments.getArray()[rAssignments.getLength() - 1] = sNewName;
return sNewName;
}
-// --------------------------------------------------------------------------------
+
void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders )
{
//convert the strings used for UI to numbers used for the configuration
@@ -437,7 +419,7 @@ void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders )
}
rBlock = sBlock;
}
-// --------------------------------------------------------------------------------
+
void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders)
{
//convert the numbers used for the configuration to strings used for UI to numbers
@@ -463,7 +445,7 @@ void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders)
}
else
{
- DBG_ERROR("parse error in address block or greeting line");
+ OSL_FAIL("parse error in address block or greeting line");
}
}
else
@@ -472,9 +454,6 @@ void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders)
rBlock = sBlock;
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames()
{
static Sequence<OUString> aNames;
@@ -532,9 +511,7 @@ const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames()
}
return aNames;
}
-/*-- 15.04.2004 08:48:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem_Impl::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwMailMergeConfigItem_Impl::Commit()
@@ -620,11 +597,11 @@ void SwMailMergeConfigItem_Impl::Commit()
//store the changed / new assignments
//load the existing node names to find new names
- Sequence<OUString> aAssignments = GetNodeNames(C2U(cAddressDataAssignments));
+ Sequence<OUString> aAssignments = GetNodeNames(rtl::OUString::createFromAscii(cAddressDataAssignments));
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
for(aAssignIter = aAddressDataAssignments.begin();
- aAssignIter != aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->bColumnAssignmentsChanged)
{
@@ -633,7 +610,7 @@ void SwMailMergeConfigItem_Impl::Commit()
aAssignIter->sConfigNodeName :
lcl_CreateNodeName(aAssignments);
OUString sSlash = C2U("/");
- OUString sNodePath = C2U(cAddressDataAssignments);
+ OUString sNodePath = rtl::OUString::createFromAscii(cAddressDataAssignments);
sNodePath += sSlash;
sNodePath += sNewNode;
sNodePath += sSlash;
@@ -641,27 +618,25 @@ void SwMailMergeConfigItem_Impl::Commit()
Sequence< PropertyValue > aNewValues(4);
PropertyValue* pNewValues = aNewValues.getArray();
pNewValues[0].Name = sNodePath;
- pNewValues[0].Name += C2U(cDataSourceName);
+ pNewValues[0].Name += rtl::OUString::createFromAscii(cDataSourceName);
pNewValues[0].Value <<= aAssignIter->aDBData.sDataSource;
pNewValues[1].Name = sNodePath;
- pNewValues[1].Name += C2U(cDataTableName);
+ pNewValues[1].Name += rtl::OUString::createFromAscii(cDataTableName);
pNewValues[1].Value <<= aAssignIter->aDBData.sCommand;
pNewValues[2].Name = sNodePath;
- pNewValues[2].Name += C2U(cDataCommandType);
+ pNewValues[2].Name += rtl::OUString::createFromAscii(cDataCommandType);
pNewValues[2].Value <<= aAssignIter->aDBData.nCommandType;
pNewValues[3].Name = sNodePath;
- pNewValues[3].Name += C2U(cDBColumnAssignments);
+ pNewValues[3].Name += rtl::OUString::createFromAscii(cDBColumnAssignments);
pNewValues[3].Value <<= aAssignIter->aDBColumnAssignments;
- SetSetProperties(C2U(cAddressDataAssignments), aNewValues);
+ SetSetProperties(rtl::OUString::createFromAscii(cAddressDataAssignments), aNewValues);
}
}
bUserSettingWereOverwritten = sal_False;
}
-/*-- 06.05.2004 13:04:36---------------------------------------------------
- -----------------------------------------------------------------------*/
const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks(
sal_Bool bConvertToConfig) const
{
@@ -675,9 +650,7 @@ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks(
}
return aRet;
}
-/*-- 06.05.2004 13:04:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem_Impl::SetAddressBlocks(
const Sequence< ::rtl::OUString>& rBlocks,
sal_Bool bConvertFromConfig)
@@ -693,9 +666,7 @@ void SwMailMergeConfigItem_Impl::SetAddressBlocks(
nCurrentAddressBlock = 0;
SetModified();
}
-/*-- 30.04.2004 11:04:52---------------------------------------------------
- -----------------------------------------------------------------------*/
const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetGreetings(
SwMailMergeConfigItem::Gender eType, sal_Bool bConvertToConfig) const
{
@@ -713,9 +684,7 @@ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetGreetings(
}
return aRet;
}
-/*-- 30.04.2004 11:04:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem_Impl::SetGreetings(
SwMailMergeConfigItem::Gender eType,
const Sequence< ::rtl::OUString>& rSetGreetings,
@@ -736,9 +705,7 @@ void SwMailMergeConfigItem_Impl::SetGreetings(
}
SetModified();
}
-/*-- 11.05.2004 13:13:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwMailMergeConfigItem_Impl::GetCurrentGreeting(
SwMailMergeConfigItem::Gender eType) const
{
@@ -751,9 +718,7 @@ sal_Int32 SwMailMergeConfigItem_Impl::GetCurrentGreeting(
}
return nRet;
}
-/*-- 11.05.2004 13:13:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem_Impl::SetCurrentGreeting(
SwMailMergeConfigItem::Gender eType, sal_Int32 nIndex)
{
@@ -779,9 +744,7 @@ void SwMailMergeConfigItem_Impl::SetCurrentGreeting(
static SwMailMergeConfigItem_Impl* pOptions = NULL;
static sal_Int32 nRefCount = 0;
static ::osl::Mutex aMutex;
-/*-- 15.04.2004 08:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeConfigItem::SwMailMergeConfigItem() :
m_bAddressInserted(false),
m_bMergeDone(false),
@@ -799,9 +762,7 @@ SwMailMergeConfigItem::SwMailMergeConfigItem() :
++nRefCount;
m_pImpl = pOptions;
}
-/*-- 15.04.2004 08:43:36---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeConfigItem::~SwMailMergeConfigItem()
{
// Global access, must be guarded (multithreading)
@@ -811,46 +772,34 @@ SwMailMergeConfigItem::~SwMailMergeConfigItem()
DELETEZ( pOptions );
}
}
-/*-- 06.05.2004 14:18:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::Commit()
{
if(m_pImpl->IsModified())
m_pImpl->Commit();
}
-/*-- 06.05.2004 12:59:50---------------------------------------------------
- -----------------------------------------------------------------------*/
const ResStringArray& SwMailMergeConfigItem::GetDefaultAddressHeaders() const
{
return m_pImpl->m_AddressHeaderSA;
}
-/*-- 27.04.2004 14:34:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetAddressBlocks(
const Sequence< ::rtl::OUString>& rBlocks)
{
m_pImpl->SetAddressBlocks(rBlocks);
}
-/*-- 27.04.2004 14:34:16---------------------------------------------------
- -----------------------------------------------------------------------*/
const Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetAddressBlocks() const
{
return m_pImpl->GetAddressBlocks();
}
-/*-- 11.05.2004 17:08:45---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsAddressBlock()const
{
return m_pImpl->bIsAddressBlock && IsOutputToLetter();
}
-/*-- 11.05.2004 17:08:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetAddressBlock(sal_Bool bSet)
{
m_pImpl->bUserSettingWereOverwritten = sal_False;
@@ -861,16 +810,11 @@ void SwMailMergeConfigItem::SetAddressBlock(sal_Bool bSet)
}
}
-/*-- 30.08.2005 15:09:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsHideEmptyParagraphs() const
{
return m_pImpl->bIsHideEmptyParagraphs;
}
-/*-- 30.08.2005 15:09:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetHideEmptyParagraphs(sal_Bool bSet)
{
if(m_pImpl->bIsHideEmptyParagraphs != bSet)
@@ -879,23 +823,17 @@ void SwMailMergeConfigItem::SetHideEmptyParagraphs(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 28.04.2004 13:00:02---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsIncludeCountry() const
{
return m_pImpl->bIncludeCountry;
}
-/*-- 28.04.2004 13:00:02---------------------------------------------------
- -----------------------------------------------------------------------*/
rtl::OUString& SwMailMergeConfigItem::GetExcludeCountry() const
{
return m_pImpl->sExcludeCountry;
}
-/*-- 28.04.2004 13:00:02---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetCountrySettings(sal_Bool bSet, const rtl::OUString& rCountry)
{
if(m_pImpl->sExcludeCountry != rCountry ||
@@ -907,9 +845,6 @@ void SwMailMergeConfigItem::SetCountrySettings(sal_Bool bSet, const rtl::OUStrin
}
}
-/*-- 28.04.2004 15:35:16---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetCurrentConnection(
Reference< XDataSource> xSource,
SharedConnection xConnection,
@@ -924,23 +859,17 @@ void SwMailMergeConfigItem::SetCurrentConnection(
m_pImpl->nResultSetCursorPos = 0;
m_pImpl->SetModified();
}
-/*-- 28.04.2004 15:38:11---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XDataSource> SwMailMergeConfigItem::GetSource()
{
return m_pImpl->xSource;
}
-/*-- 28.04.2004 15:38:11---------------------------------------------------
- -----------------------------------------------------------------------*/
SharedConnection SwMailMergeConfigItem::GetConnection()
{
return m_pImpl->xConnection;
}
-/*-- 28.04.2004 15:38:11---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XColumnsSupplier> SwMailMergeConfigItem::GetColumnsSupplier()
{
if(!m_pImpl->xColumnsSupplier.is() && m_pImpl->xConnection.is())
@@ -952,17 +881,12 @@ Reference< XColumnsSupplier> SwMailMergeConfigItem::GetColumnsSupplier()
}
return m_pImpl->xColumnsSupplier;
}
-/*-- 30.04.2004 14:30:55---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwDBData& SwMailMergeConfigItem::GetCurrentDBData() const
{
return m_pImpl->aDBData;
}
-/*-- 17.06.2004 13:18:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetCurrentDBData( const SwDBData& rDBData)
{
if(m_pImpl->aDBData != rDBData)
@@ -974,9 +898,7 @@ void SwMailMergeConfigItem::SetCurrentDBData( const SwDBData& rDBData)
m_pImpl->SetModified();
}
}
-/*-- 29.04.2004 11:34:36---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const
{
if(!m_pImpl->xConnection.is() && m_pImpl->aDBData.sDataSource.getLength())
@@ -1008,7 +930,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const
}
catch(Exception&)
{
- DBG_ERROR("exception caught in xResultSet->SetFilter()");
+ OSL_FAIL("exception caught in xResultSet->SetFilter()");
}
xRowSet->execute();
m_pImpl->xResultSet = xRowSet.get();
@@ -1018,14 +940,12 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const
}
catch(Exception& )
{
- DBG_ERROR("exception caught in: SwMailMergeConfigItem::GetResultSet() ");
+ OSL_FAIL("exception caught in: SwMailMergeConfigItem::GetResultSet() ");
}
}
return m_pImpl->xResultSet;
}
-/*-- 13.08.2004 11:49:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::DisposeResultSet()
{
m_pImpl->xConnection.clear();
@@ -1034,16 +954,12 @@ void SwMailMergeConfigItem::DisposeResultSet()
::comphelper::disposeComponent( m_pImpl->xResultSet );
}
}
-/*-- 14.05.2004 15:07:55---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString& SwMailMergeConfigItem::GetFilter() const
{
return m_pImpl->sFilter;
}
-/*-- 14.05.2004 15:07:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter)
{
if(m_pImpl->sFilter != rFilter)
@@ -1062,14 +978,12 @@ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter)
}
catch(Exception&)
{
- DBG_ERROR("exception caught in SwMailMergeConfigItem::SetFilter()");
+ OSL_FAIL("exception caught in SwMailMergeConfigItem::SetFilter()");
}
}
}
}
-/*-- 29.04.2004 11:55:38---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget)
{
if(!m_pImpl->xResultSet.is())
@@ -1104,9 +1018,6 @@ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget)
return m_pImpl->nResultSetCursorPos;
}
-/*-- 27.05.2004 13:56:18---------------------------------------------------
-
- -----------------------------------------------------------------------*/
bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast)
{
bool bRet = false;
@@ -1126,16 +1037,12 @@ bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast)
}
return bRet;
}
-/*-- 29.04.2004 11:55:38---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwMailMergeConfigItem::GetResultSetPosition() const
{
return m_pImpl->nResultSetCursorPos;
}
-/*-- 27.05.2004 14:49:53---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord)
{
bool bRet = false;
@@ -1147,9 +1054,7 @@ bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord)
}
return bRet;
}
-/*-- 27.05.2004 14:49:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::ExcludeRecord(sal_Int32 nRecord, bool bExclude)
{
//nRecord is based on 1
@@ -1188,9 +1093,7 @@ void SwMailMergeConfigItem::ExcludeRecord(sal_Int32 nRecord, bool bExclude)
}
}
}
-/*-- 27.05.2004 15:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< Any > SwMailMergeConfigItem::GetSelection() const
{
Sequence< Any > aRet(m_aSelection.getLength());
@@ -1208,17 +1111,13 @@ Sequence< Any > SwMailMergeConfigItem::GetSelection() const
aRet.realloc(nRetIndex);
return aRet;
}
-/*-- 16.06.2004 15:15:56---------------------------------------------------
- -----------------------------------------------------------------------*/
const uno::Sequence< ::rtl::OUString>&
SwMailMergeConfigItem::GetSavedDocuments() const
{
return m_pImpl->aSavedDocuments;
}
-/*-- 16.06.2004 15:15:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::AddSavedDocument(::rtl::OUString rName)
{
const ::rtl::OUString* pDocs = m_pImpl->aSavedDocuments.getConstArray();
@@ -1237,16 +1136,12 @@ void SwMailMergeConfigItem::AddSavedDocument(::rtl::OUString rName)
m_pImpl->aSavedDocuments[m_pImpl->aSavedDocuments.getLength() - 1] = rName;
}
}
-/*-- 28.04.2004 16:15:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsOutputToLetter()const
{
return m_pImpl->bIsOutputToLetter || !IsMailAvailable();
}
-/*-- 28.04.2004 16:15:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetOutputToLetter(sal_Bool bSet)
{
if(m_pImpl->bIsOutputToLetter != bSet)
@@ -1255,18 +1150,14 @@ void SwMailMergeConfigItem::SetOutputToLetter(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 30.04.2004 10:51:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsIndividualGreeting(sal_Bool bInEMail) const
{
return bInEMail ?
m_pImpl->bIsIndividualGreetingLineInMail :
m_pImpl->bIsIndividualGreetingLine;
}
-/*-- 30.04.2004 10:51:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetIndividualGreeting(
sal_Bool bSet, sal_Bool bInEMail)
{
@@ -1287,16 +1178,12 @@ void SwMailMergeConfigItem::SetIndividualGreeting(
}
}
}
-/*-- 30.04.2004 10:51:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsGreetingLine(sal_Bool bInEMail) const
{
return bInEMail ? m_pImpl->bIsGreetingLineInMail : m_pImpl->bIsGreetingLine;
}
-/*-- 30.04.2004 10:51:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetGreetingLine(sal_Bool bSet, sal_Bool bInEMail)
{
m_pImpl->bUserSettingWereOverwritten = sal_False;
@@ -1317,48 +1204,35 @@ void SwMailMergeConfigItem::SetGreetingLine(sal_Bool bSet, sal_Bool bInEMail
}
}
}
-/*-- 30.04.2004 11:04:52---------------------------------------------------
- -----------------------------------------------------------------------*/
const Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetGreetings(
Gender eType ) const
{
return m_pImpl->GetGreetings(eType);
}
-/*-- 30.04.2004 11:04:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetGreetings(
Gender eType, const Sequence< ::rtl::OUString>& rSetGreetings)
{
m_pImpl->SetGreetings( eType, rSetGreetings);
}
-/*-- 11.05.2004 13:10:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SwMailMergeConfigItem::GetCurrentGreeting(
SwMailMergeConfigItem::Gender eType) const
{
return m_pImpl->GetCurrentGreeting(eType);
}
-/*-- 11.05.2004 13:10:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetCurrentGreeting(Gender eType, sal_Int32 nIndex)
{
m_pImpl->SetCurrentGreeting(eType, nIndex);
}
-/*-- 12.05.2004 12:29:59---------------------------------------------------
- -----------------------------------------------------------------------*/
const ::rtl::OUString& SwMailMergeConfigItem::GetFemaleGenderValue() const
{
return m_pImpl->sFemaleGenderValue;
}
-/*-- 12.05.2004 12:29:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetFemaleGenderValue(const ::rtl::OUString rValue)
{
if( m_pImpl->sFemaleGenderValue != rValue )
@@ -1368,16 +1242,13 @@ void SwMailMergeConfigItem::SetFemaleGenderValue(const ::rtl::OUString rValue)
}
}
-/*-- 30.04.2004 13:25:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment(
const SwDBData& rDBData ) const
{
Sequence< ::rtl::OUString> aRet;
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
for(aAssignIter = m_pImpl->aAddressDataAssignments.begin();
- aAssignIter != m_pImpl->aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != m_pImpl->aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->aDBData == rDBData)
{
@@ -1387,9 +1258,9 @@ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment(
}
return aRet;
}
-/*-- 21.05.2004 12:31:31---------------------------------------------------
- returns the name that is assigned as e-mail column of the current data base
- -----------------------------------------------------------------------*/
+
+
+// returns the name that is assigned as e-mail column of the current data base
::rtl::OUString SwMailMergeConfigItem::GetAssignedColumn(sal_uInt32 nColumn) const
{
::rtl::OUString sRet;
@@ -1400,16 +1271,14 @@ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment(
sRet = m_pImpl->m_AddressHeaderSA.GetString(nColumn);
return sRet;
}
-/*-- 30.04.2004 13:25:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetColumnAssignment( const SwDBData& rDBData,
const Sequence< ::rtl::OUString>& rList)
{
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
sal_Bool bFound = sal_False;
for(aAssignIter = m_pImpl->aAddressDataAssignments.begin();
- aAssignIter != m_pImpl->aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != m_pImpl->aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->aDBData == rDBData)
{
@@ -1433,9 +1302,6 @@ void SwMailMergeConfigItem::SetColumnAssignment( const SwDBData& rDBData,
m_pImpl->SetModified();
}
-/*-- 07.09.2005 11:50:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const
{
bool bResult = true;
@@ -1481,9 +1347,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const
}
return bResult;
}
-/*-- 07.09.2005 11:50:27---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
{
bool bResult = true;
@@ -1542,16 +1406,12 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
}
return bResult;
}
-/*-- 05.05.2004 16:10:07---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailDisplayName() const
{
return m_pImpl->sMailDisplayName;
}
-/*-- 05.05.2004 16:10:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailDisplayName(const ::rtl::OUString& rName)
{
if(m_pImpl->sMailDisplayName != rName)
@@ -1560,16 +1420,12 @@ void SwMailMergeConfigItem::SetMailDisplayName(const ::rtl::OUString& rName)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:09---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailAddress() const
{
return m_pImpl->sMailAddress;
}
-/*-- 05.05.2004 16:10:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailAddress(const ::rtl::OUString& rAddress)
{
if(m_pImpl->sMailAddress != rAddress )
@@ -1579,16 +1435,11 @@ void SwMailMergeConfigItem::SetMailAddress(const ::rtl::OUString& rAddress)
}
}
-/*-- 07.05.2004 12:40:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsMailReplyTo() const
{
return m_pImpl->bIsMailReplyTo;
}
-/*-- 07.05.2004 12:40:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailReplyTo(sal_Bool bSet)
{
if(m_pImpl->bIsMailReplyTo != bSet)
@@ -1597,16 +1448,12 @@ void SwMailMergeConfigItem::SetMailReplyTo(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:09---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailReplyTo() const
{
return m_pImpl->sMailReplyTo;
}
-/*-- 05.05.2004 16:10:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailReplyTo(const ::rtl::OUString& rReplyTo)
{
if(m_pImpl->sMailReplyTo != rReplyTo)
@@ -1615,16 +1462,12 @@ void SwMailMergeConfigItem::SetMailReplyTo(const ::rtl::OUString& rReplyTo)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:09---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailServer() const
{
return m_pImpl->sMailServer;
}
-/*-- 05.05.2004 16:10:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailServer(const ::rtl::OUString& rAddress)
{
if(m_pImpl->sMailServer != rAddress)
@@ -1633,18 +1476,14 @@ void SwMailMergeConfigItem::SetMailServer(const ::rtl::OUString& rAddress)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SwMailMergeConfigItem::GetMailPort() const
{
return m_pImpl->bIsDefaultPort ?
(m_pImpl->bIsSecureConnection ? SECURE_PORT : DEFAULT_PORT) :
m_pImpl->nMailPort;
}
-/*-- 05.05.2004 16:10:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailPort(sal_Int16 nSet)
{
if(m_pImpl->nMailPort != nSet || m_pImpl->bIsDefaultPort)
@@ -1654,16 +1493,12 @@ void SwMailMergeConfigItem::SetMailPort(sal_Int16 nSet)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:11---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsSecureConnection() const
{
return m_pImpl->bIsSecureConnection;
}
-/*-- 05.05.2004 16:10:12---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetSecureConnection(sal_Bool bSet)
{
if(m_pImpl->bIsSecureConnection != bSet)
@@ -1672,16 +1507,12 @@ void SwMailMergeConfigItem::SetSecureConnection(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:12---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsAuthentication() const
{
return m_pImpl->bIsAuthentication;
}
-/*-- 05.05.2004 16:10:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetAuthentication(sal_Bool bSet)
{
if(m_pImpl->bIsAuthentication != bSet)
@@ -1690,16 +1521,12 @@ void SwMailMergeConfigItem::SetAuthentication(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:13---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailUserName() const
{
return m_pImpl->sMailUserName;
}
-/*-- 05.05.2004 16:10:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailUserName(const ::rtl::OUString& rName)
{
if(m_pImpl->sMailUserName != rName)
@@ -1708,16 +1535,12 @@ void SwMailMergeConfigItem::SetMailUserName(const ::rtl::OUString& rName)
m_pImpl->SetModified();
}
}
-/*-- 05.05.2004 16:10:14---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetMailPassword() const
{
return m_pImpl->sMailPassword;
}
-/*-- 05.05.2004 16:10:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetMailPassword(const ::rtl::OUString& rPassword)
{
if(m_pImpl->sMailPassword != rPassword)
@@ -1726,16 +1549,12 @@ void SwMailMergeConfigItem::SetMailPassword(const ::rtl::OUString& rPassword)
m_pImpl->SetModified();
}
}
-/*-- 19.08.2004 14:44:57---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsSMTPAfterPOP() const
{
return m_pImpl->bIsSMPTAfterPOP;
}
-/*-- 19.08.2004 14:44:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetSMTPAfterPOP(sal_Bool bSet)
{
if( m_pImpl->bIsSMPTAfterPOP != bSet)
@@ -1744,16 +1563,12 @@ void SwMailMergeConfigItem::SetSMTPAfterPOP(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 19.08.2004 14:44:57---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetInServerName() const
{
return m_pImpl->sInServerName;
}
-/*-- 19.08.2004 14:44:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetInServerName(const ::rtl::OUString& rServer)
{
if(m_pImpl->sInServerName != rServer)
@@ -1762,16 +1577,12 @@ void SwMailMergeConfigItem::SetInServerName(const ::rtl::OUString& rServer)
m_pImpl->SetModified();
}
}
-/*-- 19.08.2004 14:44:58---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SwMailMergeConfigItem::GetInServerPort() const
{
return m_pImpl->nInServerPort;
}
-/*-- 19.08.2004 14:44:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet)
{
if( m_pImpl->nInServerPort != nSet)
@@ -1780,16 +1591,12 @@ void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet)
m_pImpl->SetModified();
}
}
-/*-- 20.08.2004 08:52:48---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeConfigItem::IsInServerPOP() const
{
return m_pImpl->bInServerPOP;
}
-/*-- 20.08.2004 08:52:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetInServerPOP(sal_Bool bSet)
{
if( m_pImpl->bInServerPOP != bSet)
@@ -1798,16 +1605,12 @@ void SwMailMergeConfigItem::SetInServerPOP(sal_Bool bSet)
m_pImpl->SetModified();
}
}
-/*-- 19.08.2004 14:44:58---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetInServerUserName() const
{
return m_pImpl->sInServerUserName;
}
-/*-- 19.08.2004 14:44:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetInServerUserName(const ::rtl::OUString& rName)
{
if( m_pImpl->sInServerUserName != rName)
@@ -1816,16 +1619,12 @@ void SwMailMergeConfigItem::SetInServerUserName(const ::rtl::OUString& rName)
m_pImpl->SetModified();
}
}
-/*-- 19.08.2004 14:44:59---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwMailMergeConfigItem::GetInServerPassword() const
{
return m_pImpl->sInServerPassword;
}
-/*-- 19.08.2004 14:45:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetInServerPassword(const ::rtl::OUString& rPassword)
{
if(m_pImpl->sInServerPassword != rPassword)
@@ -1835,9 +1634,6 @@ void SwMailMergeConfigItem::SetInServerPassword(const ::rtl::OUString& rPassword
}
}
-/*-- 02.09.2004 14:43:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::DocumentReloaded()
{
m_bMergeDone = false;
@@ -1845,38 +1641,28 @@ void SwMailMergeConfigItem::DocumentReloaded()
m_bAddressInserted = false;
m_rAddressBlockFrame = ::rtl::OUString();
}
-/*-- 16.06.2004 12:24:18---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwMailMergeConfigItem::IsMailAvailable() const
{
return m_pImpl->bIsEMailSupported;
}
-/*-- 21.05.2004 12:20:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::AddMergedDocument(SwDocMergeInfo& rInfo)
{
m_pImpl->aMergeInfos.push_back(rInfo);
}
-/*-- 21.05.2004 12:20:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwDocMergeInfo& SwMailMergeConfigItem::GetDocumentMergeInfo(sal_uInt32 nDocument)
{
- DBG_ASSERT(m_pImpl->aMergeInfos.size() > nDocument,"invalid document index");
+ OSL_ENSURE(m_pImpl->aMergeInfos.size() > nDocument,"invalid document index");
return m_pImpl->aMergeInfos[nDocument];
}
-/*-- 14.06.2004 11:46:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_uInt32 SwMailMergeConfigItem::GetMergedDocumentCount() const
{
return m_pImpl->aMergeInfos.size();
}
-/*-- 11.06.2004 10:38:39---------------------------------------------------
- -----------------------------------------------------------------------*/
SwView* lcl_ExistsView(SwView* pView)
{
const TypeId aType(TYPE(SwView));
@@ -1890,9 +1676,7 @@ SwView* lcl_ExistsView(SwView* pView)
}
return 0;
}
-/*-- 16.06.2004 15:02:35---------------------------------------------------
- -----------------------------------------------------------------------*/
SwView* SwMailMergeConfigItem::GetTargetView()
{
//make sure that the pointer is really valid - the document may have been closed manually
@@ -1902,9 +1686,7 @@ SwView* SwMailMergeConfigItem::GetTargetView()
}
return m_pTargetView;
}
-/*-- 02.09.2004 17:04:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetTargetView(SwView* pView)
{
m_pTargetView = pView;
@@ -1914,17 +1696,13 @@ void SwMailMergeConfigItem::SetTargetView(SwView* pView)
m_pImpl->aMergeInfos.clear();
}
}
-/*-- 16.06.2004 15:02:35---------------------------------------------------
- -----------------------------------------------------------------------*/
SwView* SwMailMergeConfigItem::GetSourceView()
{
m_pSourceView = lcl_ExistsView(m_pSourceView);
return m_pSourceView;
}
-/*-- 04.11.2004 19:53 ---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetSourceView(SwView* pView)
{
m_pSourceView = pView;
@@ -1970,17 +1748,14 @@ void SwMailMergeConfigItem::SetSourceView(SwView* pView)
}
}
-/*-- 13.03.2006 12:15:06---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeConfigItem::SetCurrentAddressBlockIndex( sal_Int32 nSet )
{
m_pImpl->SetCurrentAddressBlockIndex( nSet );
}
-/*-- 13.03.2006 12:15:07---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwMailMergeConfigItem::GetCurrentAddressBlockIndex() const
{
return m_pImpl->GetCurrentAddressBlockIndex();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 5aa9e7032568..1fcfbaa61035 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <sfx2/docfac.hxx>
#include <vcl/msgbox.hxx>
#include <view.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <mmdocselectpage.hxx>
#include <mailmergewizard.hxx>
#include <shellio.hxx>
@@ -61,9 +60,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace svt;
-/*-- 02.04.2004 09:40:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent ) :
svt::OWizardPage(_pParent, SW_RES(DLG_MM_DOCSELECT_PAGE)),
#ifdef MSC
@@ -114,16 +110,10 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent
}
}
-/*-- 02.04.2004 09:40:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
{
}
-/*-- 05.04.2004 14:21:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton)
{
m_aRecentDocLB.Enable(&m_aRecentDocRB == pButton);
@@ -133,9 +123,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton)
return 0;
}
-/*-- 05.04.2004 14:25:12---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
{
bool bTemplate = &m_aBrowseTemplatePB == pButton;
@@ -144,7 +132,6 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
{
m_aLoadTemplateRB.Check();
SfxNewFileDialog* pNewFileDlg = new SfxNewFileDialog(this, 0);
- //pNewFileDlg->SetTemplateFlags(nFlags);
sal_uInt16 nRet = pNewFileDlg->Execute();
if(RET_TEMPLATE_LOAD == nRet)
bTemplate = false;
@@ -164,7 +151,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
SfxObjectFactory &rFact = m_pWizard->GetSwView()->GetDocShell()->GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
@@ -194,9 +181,6 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
return 0;
}
-/*-- 06.04.2004 12:52:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
sal_Bool bReturn = sal_False;
@@ -222,3 +206,5 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageRea
}
return bReturn;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx
index 6483025f88ed..76ced703a4ac 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,14 +31,10 @@
#include <svtools/wizardmachine.hxx>
#include <mailmergehelper.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
class SwMailMergeWizard;
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeDocSelectPage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -72,3 +69,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 807d52a95f77..6c8ea5282962 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,7 @@
using namespace svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-// -----------------------------------------------------------------------
+
void lcl_FillGreetingsBox(ListBox& rBox,
SwMailMergeConfigItem& rConfig,
SwMailMergeConfigItem::Gender eType)
@@ -57,7 +58,7 @@ void lcl_FillGreetingsBox(ListBox& rBox,
rBox.InsertEntry(rEntries[nEntry]);
rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType));
}
-// -----------------------------------------------------------------------
+
void lcl_FillGreetingsBox(ComboBox& rBox,
SwMailMergeConfigItem& rConfig,
SwMailMergeConfigItem::Gender eType)
@@ -67,7 +68,7 @@ void lcl_FillGreetingsBox(ComboBox& rBox,
rBox.InsertEntry(rEntries[nEntry]);
rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType));
}
-// -----------------------------------------------------------------------
+
void lcl_StoreGreetingsBox(ListBox& rBox,
SwMailMergeConfigItem& rConfig,
SwMailMergeConfigItem::Gender eType)
@@ -79,7 +80,7 @@ void lcl_StoreGreetingsBox(ListBox& rBox,
rConfig.SetGreetings(eType, aEntries);
rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos());
}
-// -----------------------------------------------------------------------
+
void lcl_StoreGreetingsBox(ComboBox& rBox,
SwMailMergeConfigItem& rConfig,
SwMailMergeConfigItem::Gender eType)
@@ -91,9 +92,7 @@ void lcl_StoreGreetingsBox(ComboBox& rBox,
rConfig.SetGreetings(eType, aEntries);
rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos());
}
-/*-- 30.04.2004 10:42:57---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG)
{
sal_Bool bIndividual = m_pPersonalizedCB->IsEnabled() && m_pPersonalizedCB->IsChecked();
@@ -118,9 +117,7 @@ IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG)
UpdatePreview();
return 0;
}
-/*-- 30.04.2004 10:42:57---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton)
{
SwCustomizeAddressBlockDialog* pDlg =
@@ -142,16 +139,12 @@ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton)
delete pDlg;
return 0;
}
-/*-- 16.06.2004 10:56:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwGreetingsHandler::UpdatePreview()
{
//the base class does nothing
}
-/*-- 30.04.2004 10:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton)
{
String sPreview = m_aFemaleLB.GetSelectEntry();
@@ -168,17 +161,13 @@ IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton)
delete pDlg;
return 0;
}
-/*-- 05.05.2004 15:25:56---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl, ListBox*, EMPTYARG)
{
UpdatePreview();
return 0;
}
-/*-- 05.05.2004 15:23:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeGreetingsPage::UpdatePreview()
{
//find out which type of greeting should be selected:
@@ -221,7 +210,7 @@ void SwMailMergeGreetingsPage::UpdatePreview()
}
catch( sdbc::SQLException& )
{
- DBG_ERROR("SQLException caught");
+ OSL_FAIL("SQLException caught");
}
}
}
@@ -233,9 +222,7 @@ void SwMailMergeGreetingsPage::UpdatePreview()
sPreview = SwAddressPreview::FillData(sPreview, m_pWizard->GetConfigItem());
m_aPreviewWIN.SetAddress(sPreview);
}
-/*-- 17.05.2004 15:44:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwGreetingsHandler::Contains(sal_Bool bContainsGreeting)
{
m_pPersonalizedCB->Enable(bContainsGreeting);
@@ -255,9 +242,7 @@ void SwGreetingsHandler::Contains(sal_Bool bContainsGreeting)
m_pNeutralFT->Enable(bContainsGreeting);
m_pNeutralCB->Enable(bContainsGreeting);
}
-/*-- 02.04.2004 14:17:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent) :
svt::OWizardPage(_pParent, SW_RES(DLG_MM_GREETINGS_PAGE)),
#ifdef MSC
@@ -353,15 +338,11 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent)
sTemp.SearchAndReplaceAscii("%1", String::CreateFromInt32(1));
m_aDocumentIndexFI.SetText(sTemp);
}
-/*-- 02.04.2004 14:17:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
{
}
-/*-- 18.06.2004 12:13:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeGreetingsPage::ActivatePage()
{
SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
@@ -387,9 +368,7 @@ void SwMailMergeGreetingsPage::ActivatePage()
UpdatePreview();
m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
}
-/*-- 11.05.2004 14:47:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason )
{
SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
@@ -421,9 +400,7 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPage
rConfig.SetIndividualGreeting(m_aPersonalizedCB.IsChecked(), sal_False);
return sal_True;
}
-/*-- 30.04.2004 10:42:57---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeGreetingsPage, ContainsHdl_Impl, CheckBox*, pBox)
{
sal_Bool bContainsGreeting = pBox->IsChecked();
@@ -439,9 +416,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, ContainsHdl_Impl, CheckBox*, pBox)
m_pWizard->UpdateRoadmap();
return 0;
}
-/*-- 07.05.2004 12:56:42---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton)
{
//if no pButton is given, the first set has to be pre-set
@@ -473,9 +448,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton)
m_aDocumentIndexFI.SetText(sTemp);
return 0;
}
-/*-- 17.05.2004 15:11:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailBodyDialog::SwMailBodyDialog(Window* pParent, SwMailMergeWizard* _pWizard) :
SfxModalDialog(pParent, SW_RES(DLG_MM_MAILBODY)),
#ifdef MSC
@@ -570,25 +543,18 @@ SwMailBodyDialog::SwMailBodyDialog(Window* pParent, SwMailMergeWizard* _pWizard)
m_aFemaleFieldCB.SetText(rConfig.GetFemaleGenderValue());
m_aFemaleFieldCB.SaveValue();
}
-/*-- 17.05.2004 15:13:07---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailBodyDialog::~SwMailBodyDialog()
{
}
-/*-- 30.04.2004 10:42:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailBodyDialog, ContainsHdl_Impl, CheckBox*, pBox)
{
SwGreetingsHandler::Contains(pBox->IsChecked());
m_pWizard->GetConfigItem().SetGreetingLine(pBox->IsChecked(), sal_True);
return 0;
}
-/*-- 28.06.2004 11:22:42---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailBodyDialog, OKHdl, PushButton*, EMPTYARG)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -617,3 +583,4 @@ IMPL_LINK(SwMailBodyDialog, OKHdl, PushButton*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index 3e237d797e2f..d0376ca72649 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <svtools/wizardmachine.hxx>
#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include <svtools/stdctrl.hxx>
@@ -39,9 +38,7 @@
#include <svtools/svmedit.hxx>
class SwMailMergeWizard;
-/*-- 17.05.2004 14:51:45---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwGreetingsHandler
{
friend class SwMailBodyDialog;
@@ -77,9 +74,7 @@ class SwGreetingsHandler
void Contains(sal_Bool bContainsGreeting);
virtual void UpdatePreview();
};
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeGreetingsPage : public svt::OWizardPage,
public SwGreetingsHandler
{
@@ -128,9 +123,7 @@ public:
~SwMailMergeGreetingsPage();
};
-/*-- 17.05.2004 14:45:43---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailBodyDialog : public SfxModalDialog, public SwGreetingsHandler
{
CheckBox m_aGreetingLineCB;
@@ -174,3 +167,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 0ef952079635..bbd2d33cca55 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,9 +85,6 @@ using namespace ::com::sun::star::view;
#define DEFAULT_ADDRESS_WIDTH (MM50*15)// 7,5 cm
#define DEFAULT_ADDRESS_HEIGHT (MM50*7) // 3,5cm
-/*-- 15.04.2004 08:16:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
svt::OWizardPage( _pParent, SW_RES(DLG_MM_LAYOUT_PAGE)),
#ifdef MSC
@@ -179,18 +177,14 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
m_aAlignToBodyCB.SetClickHdl(LINK(this, SwMailMergeLayoutPage, AlignToTextHdl_Impl));
m_aAlignToBodyCB.Check();
}
-/*-- 15.04.2004 08:17:11---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
{
delete m_pExampleFrame;
File::remove( m_sExampleURL );
}
-/*-- 27.05.2004 13:41:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeLayoutPage::ActivatePage()
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -251,9 +245,7 @@ void SwMailMergeLayoutPage::ActivatePage()
}
}
-/*-- 11.05.2004 10:41:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
//now insert the frame and the greeting
@@ -270,9 +262,7 @@ sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason
}
return sal_True;
}
-/*-- 24.06.2004 09:50:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFrmFmt* SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView* pView,
SwMailMergeConfigItem& rConfigItem,
const Point& rAddressPosition,
@@ -300,9 +290,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView* pView,
pView->GetWrtShell().EndUndo(UNDO_INSERT);
return pAddressBlockFormat;
}
-/*-- 11.05.2004 12:49:04---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
SwWrtShell& rShell,
SwMailMergeConfigItem& rConfigItem,
@@ -332,7 +320,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
rShell.NewFlyFrm(aSet, sal_True );
SwFrmFmt* pRet = rShell.GetFlyFrmFmt();
- ASSERT( pRet, "Fly not inserted" );
+ OSL_ENSURE( pRet, "Fly not inserted" );
rShell.UnSelectFrm();
const Sequence< ::rtl::OUString> aBlocks = rConfigItem.GetAddressBlocks();
@@ -458,9 +446,6 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
return pRet;
}
-/*-- 12.05.2004 12:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem& rConfigItem, bool bExample)
{
//set the cursor to the desired position - if no text content is here then
@@ -497,7 +482,6 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
rShell.MovePara(GetfnParaCurr(), GetfnParaStart());
}
bool bSplitNode = rShell.GetText().Len() > 0;
-// rShell.SetTxtFmtColl( rShell.GetTxtCollFromPool( RES_POOLCOLL_GREETING ) );
sal_Int32 nMoves = rConfigItem.GetGreetingMoves();
if( !bExample && 0 != nMoves )
{
@@ -578,7 +562,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
// Female: [database.sGenderColumn] != "rFemaleGenderValue" && [database.NameColumn]
// Male: [database.sGenderColumn] == "rFemaleGenderValue" && [database.rGenderColumn]
// Neutral: [database.sNameColumn]
- DBG_ASSERT(sGenderColumn.Len() && rFemaleGenderValue.getLength(),
+ OSL_ENSURE(sGenderColumn.Len() && rFemaleGenderValue.getLength(),
"gender settings not available - how to form the condition?");
//column used as lastname
for(sal_Int8 eGender = SwMailMergeConfigItem::FEMALE;
@@ -687,11 +671,9 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
//put the cursor to the start of the paragraph
rShell.SttPara();
- DBG_ASSERT(0 == rShell.GetTableFmt(), "What to do with a table here?");
+ OSL_ENSURE(0 == rShell.GetTableFmt(), "What to do with a table here?");
}
-/*-- 10.05.2004 09:34:25---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG)
{
m_aExampleWIN.Show( sal_True );
@@ -705,7 +687,7 @@ IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG)
SwXTextDocument* pXDoc = reinterpret_cast<SwXTextDocument*>(xDocTunnel->getSomething(SwXTextDocument::getUnoTunnelId()));
SwDocShell* pDocShell = pXDoc->GetDocShell();
m_pExampleWrtShell = pDocShell->GetWrtShell();
- DBG_ASSERT(m_pExampleWrtShell, "No SwWrtShell found!");
+ OSL_ENSURE(m_pExampleWrtShell, "No SwWrtShell found!");
if(!m_pExampleWrtShell)
return 0;
@@ -725,19 +707,15 @@ IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG)
Any aZoom;
aZoom <<= (sal_Int16)DocumentZoomType::ENTIRE_PAGE;
- m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
+ m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
-
-// m_pExampleWrtShell->SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
const SwFmtFrmSize& rPageSize = m_pExampleWrtShell->GetPageDesc(
m_pExampleWrtShell->GetCurPageDesc()).GetMaster().GetFrmSize();
m_aLeftMF.SetMax(rPageSize.GetWidth() - DEFAULT_LEFT_DISTANCE);
m_aTopMF.SetMax(rPageSize.GetHeight() - DEFAULT_TOP_DISTANCE);
return 0;
}
-/*-- 10.05.2004 14:05:24---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox)
{
if(m_pExampleWrtShell)
@@ -753,18 +731,14 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox)
}
Any aZoom;
aZoom <<= eType;
- m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
+ m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
aZoom <<= nZoom;
- m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
+ m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
}
return 0;
}
-
-/*-- 10.05.2004 15:56:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, MetricField*, EMPTYARG)
{
if(m_pExampleWrtShell && m_pAddressBlockFormat)
@@ -786,9 +760,6 @@ IMPL_LINK(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, MetricField*, EMPTYARG)
return 0;
}
-/*-- 10.05.2004 16:13:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton)
{
bool bDown = pButton == &m_aDownPB;
@@ -803,9 +774,7 @@ IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton)
return 0;
}
-/*-- 15.07.2004 16:05:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, CheckBox*, pBox)
{
sal_Bool bCheck = pBox->IsChecked() && pBox->IsEnabled();
@@ -814,3 +783,5 @@ IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, CheckBox*, pBox)
ChangeAddressHdl_Impl( 0 );
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index b7dd9dfab2e6..b3191f04da64 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <svtools/wizardmachine.hxx>
#include <mailmergehelper.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <vcl/field.hxx>
#include <vcl/lstbox.hxx>
@@ -44,9 +43,7 @@ class SwWrtShell;
class SwView;
namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySet;}}}}
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeLayoutPage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -112,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx
index bb58496effd3..442380f0a484 100644
--- a/sw/source/ui/dbui/mmmergepage.cxx
+++ b/sw/source/ui/dbui/mmmergepage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
#include <swtypes.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <dbui.hrc>
#include <mmmergepage.hrc>
#include <svl/srchitem.hxx>
@@ -44,9 +43,6 @@
#include <svl/eitem.hxx>
#include <swabstdlg.hxx>
-/*-- 02.04.2004 16:38:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeMergePage::SwMailMergeMergePage( SwMailMergeWizard* _pParent) :
svt::OWizardPage(_pParent, SW_RES(DLG_MM_MERGE_PAGE)),
#ifdef MSC
@@ -77,24 +73,18 @@ SwMailMergeMergePage::SwMailMergeMergePage( SwMailMergeWizard* _pParent) :
m_aFindED.SetReturnActionLink( LINK(this, SwMailMergeMergePage, EnteredFindStringHdl_Impl ));
}
-/*-- 02.04.2004 16:38:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeMergePage::~SwMailMergeMergePage()
{
}
-/*-- 25.05.2004 16:14:49---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergeMergePage, EditDocumentHdl_Impl, PushButton*, EMPTYARG)
{
m_pWizard->SetRestartPage(MM_MERGEPAGE);
m_pWizard->EndDialog(RET_EDIT_RESULT_DOC);
return 0;
}
-/*-- 25.05.2004 16:14:49---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG)
{
SvxSearchItem aSearchItem( SID_SEARCH_ITEM );
@@ -107,7 +97,7 @@ IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG)
aSearchItem.SetBackward(m_aBackwardsCB.IsChecked());
SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView();
- DBG_ASSERT(pTargetView, "no target view exists");
+ OSL_ENSURE(pTargetView, "no target view exists");
if(pTargetView)
{
pTargetView->GetViewFrame()->GetDispatcher()->Execute(
@@ -116,8 +106,11 @@ IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG)
return 0;
}
+
IMPL_LINK( SwMailMergeMergePage, EnteredFindStringHdl_Impl, void*, EMPTYARG )
{
m_aFindPB.GetClickHdl().Call( &m_aFindPB );
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmmergepage.hxx b/sw/source/ui/dbui/mmmergepage.hxx
index ad3d51260bb2..03a644c6fcdd 100644
--- a/sw/source/ui/dbui/mmmergepage.hxx
+++ b/sw/source/ui/dbui/mmmergepage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,13 @@
#define _MAILMERGEMERGEPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/edit.hxx>
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>
#include <actctrl.hxx>
class SwMailMergeWizard;
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeMergePage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -71,3 +68,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 3bfc22da0310..c4f5219699c1 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,16 +38,10 @@
#include <mailconfigpage.hxx>
#include <cmdid.h>
#include <swtypes.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
#include <IDocumentDeviceAccess.hxx>
-#endif
#include <hintids.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/langitem.hxx>
@@ -61,31 +56,18 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
-//#ifndef _SFX_DOCFILT_HACK_HXX
-//#include <sfx2/docfilt.hxx>
-//#endif
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
-#ifndef _VCL_PRINT_HXX
#include <vcl/print.hxx>
-#endif
#include <unotools/tempfile.hxx>
#include <osl/file.hxx>
#include <mmgreetingspage.hxx>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdb/XColumn.hpp>
-//#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
-//#include <com/sun/star/beans/PropertyValue.hpp>
-//#endif
-//#ifndef _BASEDLGS_HXX
-//#include <sfx2/basedlgs.hxx>
-//#endif
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <swunohelper.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <shellio.hxx>
#include <svtools/htmlcfg.hxx>
#include <sfx2/event.hxx>
@@ -102,9 +84,6 @@ using namespace svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-/*-- 01.07.2004 16:47:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
String lcl_GetExtensionForDocType(sal_uLong nDocType)
{
String sExtension;
@@ -118,9 +97,7 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType)
}
return sExtension;
}
-/*-- 28.06.2004 11:49:21---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString lcl_GetColumnValueOf(const ::rtl::OUString& rColumn, Reference < container::XNameAccess>& rxColAccess )
{
::rtl::OUString sRet;
@@ -134,9 +111,7 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType)
}
return sRet;
}
-/*-- 21.06.2004 14:01:13---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwSaveWarningBox_Impl : public ModalDialog
{
FixedImage aWarningImageIM;
@@ -156,9 +131,7 @@ public:
String GetFileName() const {return aFileNameED.GetText();}
};
-/*-- 02.07.2004 08:54:42---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwSendQueryBox_Impl : public ModalDialog
{
FixedImage aQueryImageIM;
@@ -190,9 +163,6 @@ public:
}
};
-/*-- 21.06.2004 14:11:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const String& rFileName) :
ModalDialog(pParent, SW_RES( DLG_MM_SAVEWARNING )),
aWarningImageIM(this, SW_RES( IM_WARNING )),
@@ -209,23 +179,17 @@ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const String& rFil
aFileNameED.SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl));
ModifyHdl( &aFileNameED );
}
-/*-- 21.06.2004 14:11:58---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSaveWarningBox_Impl::~SwSaveWarningBox_Impl()
{
}
-/*-- 21.06.2004 14:11:58---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit*, pEdit)
{
aOKPB.Enable(pEdit->GetText().Len() > 0);
return 0;
}
-/*-- 02.07.2004 09:02:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSendQueryBox_Impl::SwSendQueryBox_Impl(Window* pParent, const String& rText) :
ModalDialog(pParent, SW_RES( DLG_MM_QUERY )),
aQueryImageIM( this, SW_RES( IM_QUERY )),
@@ -242,24 +206,17 @@ SwSendQueryBox_Impl::SwSendQueryBox_Impl(Window* pParent, const String& rText) :
aTextED.SetModifyHdl(LINK(this, SwSendQueryBox_Impl, ModifyHdl));
ModifyHdl( &aTextED );
}
-/*-- 02.07.2004 08:58:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSendQueryBox_Impl::~SwSendQueryBox_Impl()
{
}
-/*-- 02.07.2004 08:58:25---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit)
{
aOKPB.Enable(bIsEmptyAllowed || (pEdit->GetText().Len() > 0));
return 0;
}
-/*-- 16.04.2004 16:34:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwCopyToDialog : public SfxModalDialog
{
FixedInfo m_aDescriptionFI;
@@ -286,9 +243,6 @@ public:
void SetBCC(const String& rSet) {m_aBCCED.SetText(rSet);}
};
-/*-- 16.04.2004 16:43:18---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwCopyToDialog::SwCopyToDialog(Window* pParent) :
SfxModalDialog(pParent, SW_RES(DLG_MM_COPYTO)),
#ifdef MSC
@@ -310,16 +264,11 @@ SwCopyToDialog::SwCopyToDialog(Window* pParent) :
{
FreeResource();
}
-/*-- 16.04.2004 16:43:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwCopyToDialog::~SwCopyToDialog()
{
}
-/*-- 02.04.2004 13:15:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeOutputPage::SwMailMergeOutputPage( SwMailMergeWizard* _pParent) :
svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUT_PAGE)),
#ifdef MSC
@@ -429,17 +378,12 @@ SwMailMergeOutputPage::SwMailMergeOutputPage( SwMailMergeWizard* _pParent) :
m_aPrintRB.Enable(!Application::GetSettings().GetMiscSettings().GetDisablePrinting());
}
-/*-- 02.04.2004 13:15:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergeOutputPage::~SwMailMergeOutputPage()
{
delete m_pTempPrinter;
delete m_pDocumentPrinterCopy;
}
-/*-- 31.01.2005 08:38:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergeOutputPage::ActivatePage()
{
//fill printer ListBox
@@ -456,7 +400,7 @@ void SwMailMergeOutputPage::ActivatePage()
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
SwView* pTargetView = rConfigItem.GetTargetView();
- DBG_ASSERT(pTargetView, "no target view exists");
+ OSL_ENSURE(pTargetView, "no target view exists");
if(pTargetView)
{
SfxPrinter* pPrinter = pTargetView->GetWrtShell().getIDocumentDeviceAccess()->getPrinter( true );
@@ -468,7 +412,7 @@ void SwMailMergeOutputPage::ActivatePage()
m_aPrinterLB.SelectEntry( rConfigItem.GetSelectedPrinter() );
SwView* pSourceView = rConfigItem.GetSourceView();
- DBG_ASSERT(pSourceView, "no source view exists");
+ OSL_ENSURE(pSourceView, "no source view exists");
if(pSourceView)
{
SwDocShell* pDocShell = pSourceView->GetDocShell();
@@ -480,16 +424,12 @@ void SwMailMergeOutputPage::ActivatePage()
}
}
}
-/*-- 05.07.2004 13:54:11---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwMailMergeOutputPage::canAdvance() const
{
return false;
}
-/*-- 02.04.2004 13:15:44---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
{
Control* aControls[] =
@@ -578,7 +518,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
aPos = m_aFromNF.GetPosPixel(); aPos.Y() = nNewRBXPos + nRB_FT_Offset; m_aFromNF.SetPosPixel(aPos);
aPos = m_aToNF.GetPosPixel(); aPos.Y() = nNewRBXPos + nRB_FT_Offset; m_aToNF.SetPosPixel(aPos);
}
- else /*if(&m_aSendMailRB == pButton)*/
+ else
{
Control* aMailControls[] =
{
@@ -652,9 +592,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
SetUpdateMode(sal_False);
return 0;
}
-/*-- 22.08.2005 12:15:10---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButton)
{
sal_Bool bEnableFromTo = pButton == &m_aFromRB;
@@ -664,9 +602,6 @@ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButto
return 0;
}
-/*-- 16.04.2004 16:45:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton)
{
SwCopyToDialog* pDlg = new SwCopyToDialog(pButton);
@@ -680,14 +615,12 @@ IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton)
delete pDlg;
return 0;
}
-/*-- 17.05.2004 13:51:02---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
SwView* pSourceView = rConfigItem.GetSourceView();
- DBG_ASSERT( pSourceView, "source view missing");
+ OSL_ENSURE( pSourceView, "source view missing");
if(pSourceView)
{
SfxViewFrame* pSourceViewFrm = pSourceView->GetViewFrame();
@@ -722,22 +655,18 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton)
}
return 0;
}
-/*-- 17.07.2008 08:09:06---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SaveCancelHdl_Impl, Button*, EMPTYARG )
{
m_bCancelSaving = true;
return 0;
}
-/*-- 17.05.2004 13:51:02---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
SwView* pTargetView = rConfigItem.GetTargetView();
- DBG_ASSERT(pTargetView, "no target view exists");
+ OSL_ENSURE(pTargetView, "no target view exists");
if(!pTargetView)
return 0;
@@ -857,7 +786,6 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xTempDocShell->DoInitNew( 0 );
SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 );
-// pTempFrame->GetFrame().Appear();
SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() );
pTargetView->GetWrtShell().StartAction();
SwgReaderOption aOpt;
@@ -877,8 +805,6 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
String sCounter('_');
sCounter += String::CreateFromInt32(nDoc);
sOutPath.Insert(sCounter, sOutPath.Len() - sExtension.Len() - 1);
- //SfxStringItem aName(SID_FILE_NAME, sOutPath);
- //SfxStringItem aFilter(SID_FILTER_NAME, sFilter);
while(true)
{
@@ -921,9 +847,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
m_pWizard->enableButtons(WZB_FINISH, sal_True);
return 0;
}
-/*-- 22.06.2004 11:51:30---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox)
{
if( m_pDocumentPrinterCopy && pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
@@ -959,17 +883,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox)
m_aPrinterSettingsPB.Disable();
m_pWizard->GetConfigItem().SetSelectedPrinter( pBox->GetSelectEntry() );
-// return m_pTempPrinter;
return 0;
}
-/*-- 17.05.2004 13:51:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
{
SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView();
- DBG_ASSERT(pTargetView, "no target view exists");
+ OSL_ENSURE(pTargetView, "no target view exists");
if(!pTargetView)
return 0;
@@ -993,7 +913,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
SwDocMergeInfo& rEndInfo = rConfigItem.GetDocumentMergeInfo(nEnd - 1);
rtl::OUString sPages(rtl::OUString::valueOf( rStartInfo.nStartPageInTarget ));
- sPages += rtl::OUString::createFromAscii( " - ");
+ sPages += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - "));
sPages += rtl::OUString::valueOf( rEndInfo.nEndPageInTarget );
SwWrtShell& rSh = pTargetView->GetWrtShell();
@@ -1007,14 +927,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell();
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh));
rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS );
- //SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher();
SfxBoolItem aMergeSilent(SID_SILENT, sal_False);
m_pWizard->enableButtons(WZB_CANCEL, sal_False);
uno::Sequence < beans::PropertyValue > aProps( 2 );
- aProps[0]. Name = rtl::OUString::createFromAscii("MonitorVisible");
+ aProps[0]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MonitorVisible"));
aProps[0].Value <<= sal_True;
- aProps[1]. Name = rtl::OUString::createFromAscii("Pages");
+ aProps[1]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pages"));
aProps[1]. Value <<= sPages;
pTargetView->ExecPrint( aProps, false, true );
@@ -1025,9 +944,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
m_pWizard->enableButtons(WZB_FINISH, sal_True);
return 0;
}
-/*-- 17.05.2004 13:51:02---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, PrinterSetupHdl_Impl, PushButton*, pButton)
{
if( !m_pTempPrinter )
@@ -1036,9 +953,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterSetupHdl_Impl, PushButton*, pButton)
m_pTempPrinter->Setup(pButton);
return 0;
}
-/*-- 14.06.2004 09:34:01---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
{
sal_uLong nDocType = (sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos());
@@ -1065,9 +980,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
}
return 0;
}
-/*-- 17.05.2004 13:51:02---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton)
{
SwMailBodyDialog* pDlg = new SwMailBodyDialog(pButton, m_pWizard);
@@ -1078,7 +991,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton)
}
return 0;
}
-/*-- 21.05.2004 12:03:25---------------------------------------------------
+
+/*-------------------------------------------------------------------------
Send documents as e-mail
-----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
@@ -1087,7 +1001,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
//get the composed document
SwView* pTargetView = rConfigItem.GetTargetView();
- DBG_ASSERT(pTargetView, "no target view exists");
+ OSL_ENSURE(pTargetView, "no target view exists");
if(!pTargetView)
return 0;
@@ -1123,7 +1037,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
nEnd = rConfigItem.GetMergedDocumentCount();
}
bool bAsBody = false;
- bool bIsPDF = false;
rtl_TextEncoding eEncoding = ::gsl_getSystemTextEncoding();
SfxFilterContainer* pFilterContainer = SwDocShell::Factory().GetFilterContainer();
const SfxFilter *pSfxFlt = 0;
@@ -1131,25 +1044,20 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
String sExtension = lcl_GetExtensionForDocType(nDocType);
switch( nDocType )
{
- case MM_DOCTYPE_OOO : break;
- case MM_DOCTYPE_PDF : bIsPDF = true;
+ case MM_DOCTYPE_OOO:
{
- //the method SwIOSystemGetFilterOfFormat( ) returns the template filter
- //because it uses the same user data :-(
- SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
- const SfxFilter* pFilter = aIter.First();
- String sFilterMime( String::CreateFromAscii( "application/pdf" ));
- while ( pFilter )
- {
- if( pFilter->GetMimeType() == sFilterMime && pFilter->CanExport() )
- {
- pSfxFlt = pFilter;
- break;
- }
- pFilter = aIter.Next();
- }
-
+ //Make sure we don't pick e.g. the flat xml filter
+ //for this format
+ pSfxFlt = SwIoSystem::GetFilterOfFormat(
+ String::CreateFromAscii( FILTER_XML ),
+ SwDocShell::Factory().GetFilterContainer() );
+ }
+ break;
+ case MM_DOCTYPE_PDF:
+ {
+ pSfxFlt = pFilterContainer->GetFilter4FilterName(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("writer_pdf_Export")),
+ SFX_FILTER_EXPORT);
}
break;
case MM_DOCTYPE_WORD:
@@ -1157,7 +1065,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
//the method SwIOSystemGetFilterOfFormat( ) returns the template filter
//because it uses the same user data :-(
SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
String sFilterUserData( String::CreateFromAscii( FILTER_WW8 ));
while ( pFilter )
@@ -1175,8 +1083,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
case MM_DOCTYPE_HTML:
{
bAsBody = true;
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
break;
case MM_DOCTYPE_TEXT:
@@ -1225,7 +1133,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
}
SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName() );
String sEMailColumn = m_aMailToLB.GetSelectEntry();
- DBG_ASSERT( sEMailColumn.Len(), "No email column selected");
+ OSL_ENSURE( sEMailColumn.Len(), "No email column selected");
Reference< sdbcx::XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), UNO_QUERY);
Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0;
if(!sEMailColumn.Len() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn))
@@ -1263,7 +1171,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
pDlg->ShowDialog();
//help to force painting the dialog
//TODO/CLEANUP
- //Sollbruchstelle
+ //predetermined breaking point
for ( sal_Int16 i = 0; i < 25; i++)
Application::Reschedule();
for(sal_uInt32 nDoc = nBegin; nDoc < nEnd; ++nDoc)
@@ -1276,7 +1184,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xTempDocShell->DoInitNew( 0 );
SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 );
-// pTempFrame->GetFrame().Appear();
SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() );
pTargetView->GetWrtShell().StartAction();
SwgReaderOption aOpt;
@@ -1297,14 +1204,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
INetURLObject(), utl::TempFile::CreateTempName(0),
URIHelper::GetMaybeFileHdl()) );
-/* if(bIsPDF)
- {
- SfxDispatcher* pSfxDispatcher = pTempView->GetViewFrame()->GetDispatcher();
- pSfxDispatcher->Execute(
- SID_DIRECTEXPORTDOCASPDF,
- SFX_CALLMODE_SYNCHRON, &aName, &aFilterName, 0L );
- }
- else*/
{
uno::Sequence< beans::PropertyValue > aFilterValues(MM_DOCTYPE_TEXT == nDocType ? 2 : 1);
beans::PropertyValue* pFilterValues = aFilterValues.getArray();
@@ -1321,12 +1220,10 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
}
xTempDocShell->DoClose();
-#ifdef DBG_UTIL
- sal_Int32 nTarget =
-#endif
- rConfigItem.MoveResultSet(rInfo.nDBRow);
- DBG_ASSERT( nTarget == rInfo.nDBRow, "row of current document could not be selected");
- DBG_ASSERT( sEMailColumn.Len(), "No email column selected");
+ sal_Int32 nTarget = rConfigItem.MoveResultSet(rInfo.nDBRow);
+ OSL_ENSURE( nTarget == rInfo.nDBRow, "row of current document could not be selected");
+ (void)nTarget;
+ OSL_ENSURE( sEMailColumn.Len(), "No email column selected");
::rtl::OUString sEMail = lcl_GetColumnValueOf(sEMailColumn, xColAccess);
SwMailDescriptor aDesc;
aDesc.sEMail = sEMail;
@@ -1341,7 +1238,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
pInStream->SetStreamCharSet( eEncoding );
else
{
- DBG_ERROR("no output file created?");
+ OSL_FAIL("no output file created?");
continue;
}
ByteString sLine;
@@ -1407,13 +1304,13 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
aDesc.sBodyContent = sBody;
if(MM_DOCTYPE_HTML == nDocType)
{
- aDesc.sBodyMimeType = ::rtl::OUString::createFromAscii("text/html; charset=");
+ aDesc.sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset="));
aDesc.sBodyMimeType += ::rtl::OUString::createFromAscii(
rtl_getBestMimeCharsetFromTextEncoding( eEncoding ));
}
else
aDesc.sBodyMimeType =
- ::rtl::OUString::createFromAscii("text/plain; charset=UTF-8; format=flowed");
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain; charset=UTF-8; format=flowed"));
aDesc.sSubject = m_aSubjectED.GetText();
aDesc.sCC = m_sCC;
@@ -1438,3 +1335,5 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
//delete pDlg;
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx
index c48d6d210c4f..36c30428b024 100644
--- a/sw/source/ui/dbui/mmoutputpage.hxx
+++ b/sw/source/ui/dbui/mmoutputpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef _MAILMERGEOUTPUTPAGE_HXX
#define _MAILMERGEOUTPUTPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <vcl/combobox.hxx>
#include <vcl/field.hxx>
@@ -51,9 +50,7 @@ namespace com{ namespace sun{ namespace star{
class XMailMessage;
}
}}}
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeOutputPage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -146,9 +143,7 @@ public:
~SwMailMergeOutputPage();
};
-/*-- 21.05.2004 12:48:50---------------------------------------------------
- -----------------------------------------------------------------------*/
struct SwMailDescriptor
{
::rtl::OUString sEMail;
@@ -201,7 +196,6 @@ class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog
bool m_bDesctructionEnabled;
ImageList m_aImageList;
- ImageList m_aImageListHC;
SwSendMailDialog_Impl* m_pImpl;
SwMailMergeConfigItem* m_pConfigItem;
@@ -240,3 +234,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmoutputpage.src b/sw/source/ui/dbui/mmoutputpage.src
index cb3a635af5fb..d8ec23489756 100644
--- a/sw/source/ui/dbui/mmoutputpage.src
+++ b/sw/source/ui/dbui/mmoutputpage.src
@@ -316,7 +316,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
String ST_CONFIGUREMAIL
{
- Text[ en-US ] = "In order to be able to send mail merge documents by e-mail, %PRODUCTNAME requires information about the e-mail account to be used.\n\n Do you want to enter e-mail account information now?";
+ Text[ en-US ] = "In order to be able to send mail merge documents by e-mail, %PRODUCTNAME requires information about the e-mail account to be used.\n\nDo you want to enter e-mail account information now?";
};
};
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 8d229b94c06c..c99de01ea052 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,16 +38,10 @@
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
#include <swtypes.hxx>
#include <mmoutputtypepage.hrc>
-#include <dbui.hrc>
-
-/*-- 02.04.2004 11:06:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent) :
svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUTTYPE_PAGE)),
#ifdef MSC
@@ -90,15 +85,11 @@ SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParen
TypeHdl_Impl(&m_aLetterRB);
}
-/*-- 02.04.2004 11:06:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
{
}
-/*-- 14.04.2004 14:44:07---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergeOutputTypePage, TypeHdl_Impl, RadioButton*, EMPTYARG )
{
bool bLetter = m_aLetterRB.IsChecked();
@@ -111,3 +102,4 @@ IMPL_LINK( SwMailMergeOutputTypePage, TypeHdl_Impl, RadioButton*, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx
index 9db02409cd1c..236b0fd6f40a 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.hxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,11 @@
#define _MAILMERGEOUTPUTTYPEPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>
class SwMailMergeWizard;
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergeOutputTypePage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -65,3 +62,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx
index 8539f037ecdc..386a04a74b75 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.cxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,16 +35,10 @@
#include <mmpreparemergepage.hxx>
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
#include <swtypes.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <wrtsh.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <com/sun/star/sdbc/XConnection.hpp>
@@ -51,7 +46,6 @@
#include <mmpreparemergepage.hrc>
-#include <dbui.hrc>
#include <unomid.h>
@@ -60,9 +54,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using ::rtl::OUString;
-/*-- 02.04.2004 16:42:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent) :
svt::OWizardPage( _pParent, SW_RES(DLG_MM_PREPAREMERGE_PAGE)),
#ifdef MSC
@@ -96,24 +87,18 @@ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pP
m_ExcludeCB.SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl));
aMoveLink.Call(&m_aRecordED);
}
-/*-- 02.04.2004 16:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage()
{
}
-/*-- 13.05.2004 15:36:48---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergePrepareMergePage, EditDocumentHdl_Impl, PushButton*, EMPTYARG)
{
m_pWizard->SetRestartPage(MM_PREPAREMERGEPAGE);
m_pWizard->EndDialog(RET_EDIT_DOC);
return 0;
}
-/*-- 27.05.2004 14:16:37---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
@@ -172,23 +157,20 @@ IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl)
rSh.GetNewDBMgr()->MergeNew(aMergeDesc);
return 0;
}
-/*-- 27.05.2004 14:46:28---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergePrepareMergePage, ExcludeHdl_Impl, CheckBox*, pBox)
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
rConfigItem.ExcludeRecord( rConfigItem.GetResultSetPosition(), pBox->IsChecked());
return 0;
};
-/*-- 18.08.2004 10:36:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMailMergePrepareMergePage::ActivatePage()
{
MoveHdl_Impl(&m_aRecordED);
}
-/*-- 13.05.2004 15:38:32---------------------------------------------------
+
+/*-------------------------------------------------------------------------
merge the data into a new file
-----------------------------------------------------------------------*/
sal_Bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
@@ -202,3 +184,5 @@ sal_Bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPag
}
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx
index 8fb7ad938996..73b138938305 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.hxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,14 @@
#define _MAILMERGEPREPAREMERGEPAGE_HXX
#include <svtools/wizardmachine.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/field.hxx>
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>
#include "actctrl.hxx"
class SwMailMergeWizard;
-/*-- 02.04.2004 09:21:06---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailMergePrepareMergePage : public svt::OWizardPage
{
SwBoldFixedInfo m_aHeaderFI;
@@ -75,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 5659b45bfc3d..8d82198c0725 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,9 +58,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
-/*-- 08.04.2004 14:33:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent,
const uno::Reference< sdbc::XConnection>& rConnection) :
SfxModalDialog(pParent, SW_RES(DLG_MM_SELECTDBTABLEDDIALOG)),
@@ -148,15 +146,11 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent,
}
}
}
-/*-- 08.04.2004 14:33:57---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSelectDBTableDialog::~SwSelectDBTableDialog()
{
}
-/*-- 08.04.2004 14:33:57---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
{
SvLBoxEntry* pEntry = m_aTableLB.FirstSelected();
@@ -173,7 +167,7 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
Reference<XPropertySet> xPrSet(xSource, UNO_QUERY);
xPrSet->getPropertyValue(C2U("Name")) >>= sDataSourceName;
}
- DBG_ASSERT(sDataSourceName.getLength(), "no data source found");
+ OSL_ENSURE(sDataSourceName.getLength(), "no data source found");
Sequence<PropertyValue> aProperties(5);
PropertyValue* pProperties = aProperties.getArray();
pProperties[0].Name = C2U("DataSourceName");
@@ -195,18 +189,14 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
return 0;
}
-/*-- 19.04.2004 10:03:26---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwSelectDBTableDialog::GetSelectedTable(bool& bIsTable)
{
SvLBoxEntry* pEntry = m_aTableLB.FirstSelected();
bIsTable = pEntry->GetUserData() ? false : true;
return pEntry ? m_aTableLB.GetEntryText(pEntry, 0) : String();
}
-/*-- 13.05.2004 12:58:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSelectDBTableDialog::SetSelectedTable(const String& rTable, bool bIsTable)
{
SvLBoxEntry* pEntry = m_aTableLB.First();
@@ -221,3 +211,5 @@ void SwSelectDBTableDialog::SetSelectedTable(const String& rTable, bool bIsTab
pEntry = m_aTableLB.Next( pEntry );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/selectdbtabledialog.hxx b/sw/source/ui/dbui/selectdbtabledialog.hxx
index 25b23f692a4c..c69cae53572a 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.hxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
#include <svtools/svtabbx.hxx>
#include <svtools/headbar.hxx>
@@ -41,9 +40,6 @@ namespace com{namespace sun{namespace star{
}
}}}
-/*-- 08.04.2004 14:04:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwSelectDBTableDialog : public SfxModalDialog
{
FixedText m_aSelectFI;
@@ -77,3 +73,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx
index bb932f0f9a04..b6ee38661fb8 100644
--- a/sw/source/ui/dbui/swdbtoolsclient.cxx
+++ b/sw/source/ui/dbui/swdbtoolsclient.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,8 +36,6 @@
#include <osl/diagnose.h>
#include <tools/solar.h>
-//........................................................................
-
using namespace ::connectivity::simple;
using namespace ::com::sun::star;
using namespace ::com::sun::star::sdbc;
@@ -80,12 +79,11 @@ namespace
}
// -----------------------------------------------------------------------------
}
-// -----------------------------------------------------------------------------
+
SwDbtoolsClient::SwDbtoolsClient()
{
}
-//--------------------------------------------------------------------
SwDbtoolsClient::~SwDbtoolsClient()
{
if(m_xDataAccessFactory.is())
@@ -98,7 +96,6 @@ SwDbtoolsClient::~SwDbtoolsClient()
}
}
-//--------------------------------------------------------------------
extern "C" { static void SAL_CALL thisModule() {} }
void SwDbtoolsClient::registerClient()
@@ -109,9 +106,7 @@ void SwDbtoolsClient::registerClient()
OSL_ENSURE(NULL == getDbToolsClientModule(), "SwDbtoolsClient::registerClient: inconsistence: already have a module!");
OSL_ENSURE(NULL == getDbToolsClientFactoryFunction(), "SwDbtoolsClient::registerClient: inconsistence: already have a factory function!");
- const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(
- SVLIBRARY( "dbtools" )
- );
+ const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY("dbtools")));
// load the dbtools library
getDbToolsClientModule() = osl_loadModuleRelative(
@@ -120,14 +115,14 @@ void SwDbtoolsClient::registerClient()
if (NULL != getDbToolsClientModule())
{
// get the symbol for the method creating the factory
- const ::rtl::OUString sFactoryCreationFunc = ::rtl::OUString::createFromAscii("createDataAccessToolsFactory");
+ const ::rtl::OUString sFactoryCreationFunc(RTL_CONSTASCII_USTRINGPARAM("createDataAccessToolsFactory"));
// reinterpret_cast<createDataAccessToolsFactoryFunction> removed for gcc permissive
getDbToolsClientFactoryFunction() = reinterpret_cast< createDataAccessToolsFactoryFunction >(
osl_getFunctionSymbol(getDbToolsClientModule(), sFactoryCreationFunc.pData));
if (NULL == getDbToolsClientFactoryFunction())
{ // did not find the symbol
- OSL_ENSURE(sal_False, "SwDbtoolsClient::registerClient: could not find the symbol for creating the factory!");
+ OSL_FAIL("SwDbtoolsClient::registerClient: could not find the symbol for creating the factory!");
osl_unloadModule(getDbToolsClientModule());
getDbToolsClientModule() = NULL;
}
@@ -135,7 +130,6 @@ void SwDbtoolsClient::registerClient()
}
}
-//--------------------------------------------------------------------
void SwDbtoolsClient::revokeClient()
{
::osl::MutexGuard aGuard(getDbtoolsClientMutex());
@@ -147,9 +141,7 @@ void SwDbtoolsClient::revokeClient()
getDbToolsClientModule() = NULL;
}
}
-/* -----------------------------30.08.2001 14:58------------------------------
- ---------------------------------------------------------------------------*/
void SwDbtoolsClient::getFactory()
{
if(!m_xDataAccessFactory.is())
@@ -169,9 +161,7 @@ void SwDbtoolsClient::getFactory()
}
}
}
-/* -----------------------------30.08.2001 11:32------------------------------
- ---------------------------------------------------------------------------*/
::rtl::Reference< ::connectivity::simple::IDataAccessTools >
SwDbtoolsClient::getDataAccessTools()
{
@@ -183,9 +173,7 @@ void SwDbtoolsClient::getFactory()
}
return m_xDataAccessTools;
}
-/* -----------------------------30.08.2001 12:40------------------------------
- ---------------------------------------------------------------------------*/
::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion >
SwDbtoolsClient::getAccessTypeConversion()
{
@@ -198,9 +186,6 @@ void SwDbtoolsClient::getFactory()
return m_xAccessTypeConversion;
}
-/* -----------------------------30.08.2001 11:37------------------------------
-
- ---------------------------------------------------------------------------*/
Reference< XDataSource > SwDbtoolsClient::getDataSource(
const ::rtl::OUString& rRegisteredName,
const Reference< XMultiServiceFactory>& xFactory
@@ -212,9 +197,7 @@ Reference< XDataSource > SwDbtoolsClient::getDataSource(
xRet = xAccess->getDataSource(rRegisteredName, xFactory);
return xRet;
}
-/* -----------------------------30.08.2001 12:06------------------------------
- ---------------------------------------------------------------------------*/
sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
const Reference< XPropertySet >& rxColumn,
const Reference< XNumberFormatTypes >& rxTypes,
@@ -227,9 +210,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
nRet = xAccess->getDefaultNumberFormat( rxColumn, rxTypes, rLocale);
return nRet;
}
-/* -----------------------------30.08.2001 12:38------------------------------
- ---------------------------------------------------------------------------*/
::rtl::OUString SwDbtoolsClient::getFormattedValue(
const uno::Reference< beans::XPropertySet>& _rxColumn,
const uno::Reference< util::XNumberFormatter>& _rxFormatter,
@@ -246,3 +227,4 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
return sRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index ac8128e1a118..003d7fed8335 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -144,9 +145,7 @@ struct SpellState
pOtherCursor = 0;
}
};
-/*-- 30.10.2003 14:33:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_LeaveDrawText(SwWrtShell& rSh)
{
if(rSh.GetDrawView())
@@ -159,9 +158,7 @@ void lcl_LeaveDrawText(SwWrtShell& rSh)
rSh.GetView().AttrChangedNotify(&rSh);
}
}
-/*-- 09.09.2003 10:39:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSpellDialogChildWindow::SwSpellDialogChildWindow (
Window* _pParent,
sal_uInt16 nId,
@@ -175,9 +172,7 @@ SwSpellDialogChildWindow::SwSpellDialogChildWindow (
String aPropName( String::CreateFromAscii(UPN_IS_GRAMMAR_INTERACTIVE ) );
SvtLinguConfig().GetProperty( aPropName ) >>= m_bIsGrammarCheckingOn;
}
-/*-- 09.09.2003 10:39:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSpellDialogChildWindow::~SwSpellDialogChildWindow ()
{
SwWrtShell* pWrtShell = GetWrtShell_Impl();
@@ -186,9 +181,7 @@ SwSpellDialogChildWindow::~SwSpellDialogChildWindow ()
delete m_pSpellState;
}
-/*-- 09.09.2003 12:40:07---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const
{
SfxChildWinInfo aInfo = svx::SpellDialogChildWindow::GetInfo();
@@ -196,10 +189,7 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const
return aInfo;
}
-/*-- 09.09.2003 10:39:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
{
svx::SpellPortions aRet;
@@ -409,7 +399,7 @@ The code below would only be part of the solution.
bool bCloseMessage = true;
if(!aRet.size() && !m_pSpellState->m_bStartedInSelection)
{
- DBG_ASSERT(m_pSpellState->m_bDrawingsSpelled &&
+ OSL_ENSURE(m_pSpellState->m_bDrawingsSpelled &&
m_pSpellState->m_bOtherSpelled && m_pSpellState->m_bBodySpelled,
"not all parts of the document are already spelled");
if(m_pSpellState->m_xStartRange.is())
@@ -457,13 +447,11 @@ The code below would only be part of the solution.
return aRet;
}
-/*-- 09.09.2003 10:39:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck)
{
SwWrtShell* pWrtShell = GetWrtShell_Impl();
- DBG_ASSERT(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume");
+ OSL_ENSURE(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume");
if(pWrtShell && !m_pSpellState->m_bInitialCall)
{
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
@@ -489,39 +477,29 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
}
}
}
-/*-- 21.10.2003 09:33:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::AddAutoCorrection(
const String& rOld, const String& rNew, LanguageType eLanguage)
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
pACorr->PutText( rOld, rNew, eLanguage );
}
-/*-- 21.10.2003 09:33:59---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwSpellDialogChildWindow::HasAutoCorrection()
{
return true;
}
-/*-- 16.06.2008 11:59:17---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwSpellDialogChildWindow::HasGrammarChecking()
{
return SvtLinguConfig().HasGrammarChecker();
}
-/*-- 18.06.2008 12:27:11---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwSpellDialogChildWindow::IsGrammarChecking()
{
return m_bIsGrammarCheckingOn;
}
-/*-- 18.06.2008 12:27:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn)
{
uno::Any aVal;
@@ -547,7 +525,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn)
{
SdrView* pSdrView = pWrtShell->GetDrawView();
SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0;
- DBG_ASSERT(pOutliner, "No Outliner in SwSpellDialogChildWindow::SetGrammarChecking");
+ OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SetGrammarChecking");
if(pOutliner)
{
pOutliner->PutSpellingToSentenceStart( pSdrView->GetTextEditOutlinerView()->GetEditView() );
@@ -555,9 +533,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn)
}
}
}
-/*-- 28.10.2003 08:41:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::GetFocus()
{
if(m_pSpellState->m_bLockFocus)
@@ -599,7 +575,7 @@ void SwSpellDialogChildWindow::GetFocus()
else
{
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- DBG_ASSERT(pOLV, "no OutlinerView in SwSpellDialogChildWindow::GetFocus()");
+ OSL_ENSURE(pOLV, "no OutlinerView in SwSpellDialogChildWindow::GetFocus()");
if(!pOLV || !m_pSpellState->m_aESelection.IsEqual(pOLV->GetSelection()))
bInvalidate = true;
}
@@ -616,9 +592,7 @@ void SwSpellDialogChildWindow::GetFocus()
if(bInvalidate)
InvalidateSpellDialog();
}
-/*-- 28.10.2003 08:41:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::LoseFocus()
{
//prevent initial invalidation
@@ -655,7 +629,7 @@ void SwSpellDialogChildWindow::LoseFocus()
SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner();
m_pSpellState->m_pOutliner = pOutliner;
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- DBG_ASSERT(pOutliner && pOLV, "no Outliner/OutlinerView in SwSpellDialogChildWindow::LoseFocus()");
+ OSL_ENSURE(pOutliner && pOLV, "no Outliner/OutlinerView in SwSpellDialogChildWindow::LoseFocus()");
if(pOLV)
{
m_pSpellState->m_aESelection = pOLV->GetSelection();
@@ -668,9 +642,7 @@ void SwSpellDialogChildWindow::LoseFocus()
else
m_pSpellState->m_eSelMode = SHELL_MODE_OBJECT;
}
-/*-- 18.09.2003 12:50:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::InvalidateSpellDialog()
{
SwWrtShell* pWrtShell = GetWrtShell_Impl();
@@ -680,9 +652,6 @@ void SwSpellDialogChildWindow::InvalidateSpellDialog()
svx::SpellDialogChildWindow::InvalidateSpellDialog();
}
-/*-- 18.09.2003 12:54:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl()
{
SfxDispatcher* pDispatch = GetBindings().GetDispatcher();
@@ -701,7 +670,7 @@ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl()
return pView ? pView->GetWrtShellPtr(): 0;
}
-/*-- 13.10.2003 15:19:04---------------------------------------------------
+/*-------------------------------------------------------------------------
set the cursor into the body text - necessary if any object is selected
on start of the spelling dialog
-----------------------------------------------------------------------*/
@@ -715,7 +684,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
case SHELL_MODE_TABLE_TEXT:
case SHELL_MODE_TABLE_LIST_TEXT:
case SHELL_MODE_DRAWTEXT:
- DBG_ERROR("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()");
+ OSL_FAIL("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()");
break;
case SHELL_MODE_FRAME:
@@ -770,7 +739,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
}
return true;
}
-/*-- 13.10.2003 15:20:09---------------------------------------------------
+/*-------------------------------------------------------------------------
select the next draw text object that has a spelling error
-----------------------------------------------------------------------*/
bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
@@ -859,15 +828,13 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
return bNextDoc;
}
-/*-- 13.10.2003 15:24:27---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, ::svx::SpellPortions& rPortions)
{
bool bRet = false;
SdrView* pSdrView = rSh.GetDrawView();
SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0;
- DBG_ASSERT(pOutliner, "No Outliner in SwSpellDialogChildWindow::SpellDrawText_Impl");
+ OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SpellDrawText_Impl");
if(pOutliner)
{
bRet = pOutliner->SpellSentence(pSdrView->GetTextEditOutlinerView()->GetEditView(), rPortions, m_bIsGrammarCheckingOn);
@@ -888,13 +855,12 @@ bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, ::svx::SpellP
}
return bRet;
}
-/*-- 30.10.2003 14:54:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellDialogChildWindow::LockFocusNotification(bool bLock)
{
- DBG_ASSERT(m_pSpellState->m_bLockFocus != bLock, "invalid locking - no change of state");
+ OSL_ENSURE(m_pSpellState->m_bLockFocus != bLock, "invalid locking - no change of state");
m_pSpellState->m_bLockFocus = bLock;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx
index 3d4de9b187dc..0a651db3cb1f 100644
--- a/sw/source/ui/dialog/abstract.cxx
+++ b/sw/source/ui/dialog/abstract.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,10 +42,6 @@
#include "abstract.hrc"
-/*-----------------22.02.97 15.32-------------------
-
---------------------------------------------------*/
-
SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) :
SfxModalDialog(pParent, SW_RES(DLG_INSERT_ABSTRACT)),
aFL (this, SW_RES(FL_1 )),
@@ -60,25 +57,14 @@ SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) :
FreeResource();
}
-/*-----------------22.02.97 15.32-------------------
-
---------------------------------------------------*/
-
SwInsertAbstractDlg::~SwInsertAbstractDlg()
{
}
-/*-----------------22.02.97 15.34-------------------
-
---------------------------------------------------*/
-
sal_uInt8 SwInsertAbstractDlg::GetLevel() const
{
return static_cast< sal_uInt8 >(aLevelNF.GetValue() - 1);
}
-/*-----------------22.02.97 15.34-------------------
-
---------------------------------------------------*/
sal_uInt8 SwInsertAbstractDlg::GetPara() const
{
@@ -90,3 +76,4 @@ sal_uInt8 SwInsertAbstractDlg::GetPara() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src
index 5cb877a1549b..9d318cba23a9 100644
--- a/sw/source/ui/dialog/abstract.src
+++ b/sw/source/ui/dialog/abstract.src
@@ -34,9 +34,6 @@ ModalDialog DLG_INSERT_ABSTRACT
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 239 , 68 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */
- /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */
- /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */
Moveable = TRUE ;
FixedLine FL_1
{
@@ -71,7 +68,6 @@ ModalDialog DLG_INSERT_ABSTRACT
{
Pos = MAP_APPFONT ( 12 , 27 ) ;
Size = MAP_APPFONT ( 120 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Absätze je Kapitel : Absõtze je Kapitel */
Text [ en-US ] = "Subpoints per level" ;
};
NumericField NF_PARA
@@ -94,7 +90,6 @@ ModalDialog DLG_INSERT_ABSTRACT
{
Pos = MAP_APPFONT ( 12 , 43 ) ;
Size = MAP_APPFONT ( 165 , 16 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Im Abstrakt erscheint die ausgewählte Anzahl von Absätzen aus den einbezogenen Kapitelebenen. : Im Abstrakt erscheint die ausgewõhlte Anzahl von Absõtzen aus den einbezogenen Kapitelebenen. */
WordBreak = TRUE ;
Text [ en-US ] = "The abstract contains the selected number of paragraphs from the included outline levels." ;
};
diff --git a/sw/source/ui/dialog/addrdlg.cxx b/sw/source/ui/dialog/addrdlg.cxx
index f168d0684a81..02ba71c344bd 100644
--- a/sw/source/ui/dialog/addrdlg.cxx
+++ b/sw/source/ui/dialog/addrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,19 +37,13 @@
#include <svx/svxdlg.hxx>
#include <sfx2/sfx.hrc>
-/****************************************************************************
-Ctor
-****************************************************************************/
-
-
SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet ) :
SfxSingleTabDialog(pParent, rSet, 0)
{
- // TabPage erzeugen
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SFXPAGE_GENERAL );
if ( fnCreatePage )
{
@@ -57,13 +52,9 @@ SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet ) :
}
}
-/****************************************************************************
-Dtor
-****************************************************************************/
-
-
-__EXPORT SwAddrDlg::~SwAddrDlg()
+SwAddrDlg::~SwAddrDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index f1661b4865c4..eb82e9f2fff5 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,14 +50,9 @@
#include <shellio.hxx>
#include <docsh.hxx>
#include <doc.hxx>
-#include <errhdl.hxx>
-#ifndef _DIALOG_HRC
#include <dialog.hrc>
-#endif
-#ifndef _ASCFLDLG_HRC
#include <ascfldlg.hrc>
-#endif
#include "vcl/metric.hxx"
@@ -64,8 +60,8 @@
using namespace ::com::sun::star;
const sal_Unicode cDialogExtraDataClose = '}';
-const char __FAR_DATA sDialogImpExtraData[] = "EncImpDlg:{";
-const char __FAR_DATA sDialogExpExtraData[] = "EncExpDlg:{";
+const char sDialogImpExtraData[] = "EncImpDlg:{";
+const char sDialogExpExtraData[] = "EncExpDlg:{";
const sal_uInt16 nDialogExtraDataLen = 11; // 12345678901
SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
@@ -125,8 +121,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
aBuffer[ nBytesRead + 2 ] = '0';
}
- sal_Bool bCR = sal_False, bLF = sal_False, bNoNormalChar = sal_False,
- bNullChar = sal_False;
+ sal_Bool bCR = sal_False, bLF = sal_False, bNullChar = sal_False;
for( sal_uInt16 nCnt = 0; nCnt < nBytesRead; ++nCnt )
switch( aBuffer[ nCnt ] )
{
@@ -136,9 +131,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
case 0xC:
case 0x1A:
case 0x9: break;
- default:
- if( 0x20 > aBuffer[ nCnt ] )
- bNoNormalChar = sal_True;
+ default: break;
}
if( !bNullChar )
@@ -148,21 +141,15 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
if( bLF )
{
aOpt.SetParaFlags( LINEEND_CRLF );
-// have to check if of CharSet is type of ANSI
-// aOpt.SetCharSet( CHARSET_ANSI );
}
else
{
aOpt.SetParaFlags( LINEEND_CR );
-// have to check if CharSet is type of MAC
-// aOpt.SetCharSet( CHARSET_MAC );
}
}
else if( bLF )
{
aOpt.SetParaFlags( LINEEND_LF );
-// have to check if of CharSet is type of ANSI
-// aOpt.SetCharSet( CHARSET_ANSI );
}
}
@@ -228,7 +215,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
delete pPrt;
}
- // initialisiere Sprache
+ // initialise language
{
if( !aOpt.GetLanguage() )
{
@@ -291,7 +278,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
SetSizePixel( aSize );
}
- // initialisiere Zeichensatz
+ // initialise character set
aCharSetLB.FillFromTextEncodingTable( pStream != NULL );
aCharSetLB.SelectTextEncoding( aOpt.GetCharSet() );
@@ -329,7 +316,7 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
rOptions.SetLanguage( sal_uInt16( nLng ) );
rOptions.SetParaFlags( GetCRLF() );
- // JP: Task #71802# save the user settings
+ // save the user settings
String sData;
rOptions.WriteUserData( sData );
if( sData.Len() )
@@ -460,3 +447,4 @@ IMPL_LINK( SwAsciiFilterDlg, LineEndHdl, RadioButton*, pBtn )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/dialog.src b/sw/source/ui/dialog/dialog.src
index 26b615bff7b2..25b2a38eeadd 100644
--- a/sw/source/ui/dialog/dialog.src
+++ b/sw/source/ui/dialog/dialog.src
@@ -28,7 +28,6 @@
CheckBox CB_USE_PASSWD
{
- /* ### ACHTUNG: Neuer Text in Resource? ~Paßwort : ~Pa˜wort */
Text [ en-US ] = "~Password" ;
};
CheckBox CB_READ_ONLY
@@ -37,7 +36,6 @@ CheckBox CB_READ_ONLY
};
String STR_LINKEDIT_TEXT
{
- /* ### ACHTUNG: Neuer Text in Resource? Verknüpfungen bearbeiten : Verkn³pfungen bearbeiten */
Text [ en-US ] = "Edit links" ;
};
String STR_PATH_NOT_FOUND
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 08bb7b96e45b..2b199b46ceb5 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,37 +37,20 @@
#include <ctype.h>
#include <swwait.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _PVIEW_HXX
#include <pview.hxx>
-#endif
#include <doc.hxx>
#include <docstdlg.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
-// fuer Statistikfelder
+// for statistics fields
#include <fldmgr.hxx>
#include <fldbas.hxx>
-#ifndef _DOCSTDLG_HRC
#include <docstdlg.hrc>
-#endif
-
-
-/*--------------------------------------------------------------------
- Beschreibung: Create
- --------------------------------------------------------------------*/
SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet)
@@ -74,11 +58,6 @@ SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet)
return new SwDocStatPage(pParent, rSet);
}
-/*--------------------------------------------------------------------
- Beschreibung: Ctor
- --------------------------------------------------------------------*/
-
-
SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage (pParent, SW_RES(TP_DOC_STAT), rSet),
@@ -95,7 +74,9 @@ SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
aWordLbl (this, SW_RES( FT_WORD )),
aWordNo (this, SW_RES( FT_WORD_COUNT )),
aCharLbl (this, SW_RES( FT_CHAR )),
- aCharNo (this, SW_RES( FT_CHAR_COUNT )),
+ aCharNo (this, SW_RES( FT_CHAR_COUNT )),
+ aCharExclSpacesLbl (this, SW_RES( FT_CHAR_EXCL_SPACES )),
+ aCharExclSpacesNo (this, SW_RES( FT_CHAR_COUNT_EXCL_SPACES )),
aLineLbl (this, SW_RES( FT_LINE )),
aLineNo (this, SW_RES( FT_LINE_COUNT )),
aUpdatePB (this, SW_RES( PB_PDATE ))
@@ -121,7 +102,7 @@ SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
}
/*--------------------------------------------------------------------
- Beschreibung: ItemSet fuellen bei Aenderung
+ Description: fill ItemSet when changed
--------------------------------------------------------------------*/
@@ -130,16 +111,11 @@ sal_Bool SwDocStatPage::FillItemSet(SfxItemSet & /*rSet*/)
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDocStatPage::Reset(const SfxItemSet &/*rSet*/)
{
}
/*------------------------------------------------------------------------
- Beschreibung: Aktualisieren / Setzen der Daten
+ Description: update / set data
------------------------------------------------------------------------*/
@@ -152,10 +128,11 @@ void SwDocStatPage::SetData(const SwDocStat &rStat)
aParaNo.SetText(String::CreateFromInt32( rStat.nPara ));
aWordNo.SetText(String::CreateFromInt32( rStat.nWord ));
aCharNo.SetText(String::CreateFromInt32( rStat.nChar ));
+ aCharExclSpacesNo.SetText(String::CreateFromInt32( rStat.nCharExcludingSpaces ));
}
/*------------------------------------------------------------------------
- Beschreibung: Aktualisieren der Statistik
+ Description: update statistics
------------------------------------------------------------------------*/
@@ -168,7 +145,7 @@ void SwDocStatPage::Update()
else if ( pVSh->ISA(SwPagePreView) )
pSh = ((SwPagePreView*)pVSh)->GetViewShell();
- ASSERT( pSh, "Shell not found" );
+ OSL_ENSURE( pSh, "Shell not found" );
SwWait aWait( *pSh->GetDoc()->GetDocShell(), sal_True );
pSh->StartAction();
@@ -179,9 +156,6 @@ void SwDocStatPage::Update()
SetData(aDocStat);
}
-/*-----------------19.06.97 16.37-------------------
- Zeilennummer aktualisieren
---------------------------------------------------*/
IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG)
{
Update();
@@ -193,3 +167,4 @@ IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/docstdlg.hrc b/sw/source/ui/dialog/docstdlg.hrc
index 5084ea58dbdb..93ea9171ba60 100644
--- a/sw/source/ui/dialog/docstdlg.hrc
+++ b/sw/source/ui/dialog/docstdlg.hrc
@@ -42,6 +42,8 @@
#define FT_LINE 17
#define FT_LINE_COUNT 18
#define PB_PDATE 19
+#define FT_CHAR_COUNT_EXCL_SPACES 20
+#define FT_CHAR_EXCL_SPACES 21
#define BT_OK 100
diff --git a/sw/source/ui/dialog/docstdlg.src b/sw/source/ui/dialog/docstdlg.src
index 4976a42176a2..71706177225e 100644
--- a/sw/source/ui/dialog/docstdlg.src
+++ b/sw/source/ui/dialog/docstdlg.src
@@ -83,57 +83,70 @@ TabPage TP_DOC_STAT
Text [ en-US ] = "Number of Characters:" ;
Left = TRUE ;
};
- FixedText FT_LINE
+ FixedText FT_CHAR_EXCL_SPACES
{
Pos = MAP_APPFONT ( 6 , 96 ) ;
+ Size = MAP_APPFONT ( 138 , 8 ) ;
+ Text [ en-US ] = "Number of Characters excluding spaces:" ;
+ Left = TRUE ;
+ };
+ FixedText FT_LINE
+ {
+ Pos = MAP_APPFONT ( 6 , 110 ) ;
Size = MAP_APPFONT ( 90 , 8 ) ;
Text [ en-US ] = "Number of Lines:" ;
};
FixedText FT_PAGE_COUNT
{
- Pos = MAP_APPFONT ( 114 , 6 ) ;
+ Pos = MAP_APPFONT ( 138 , 6 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_TABLE_COUNT
{
- Pos = MAP_APPFONT ( 114 , 18 ) ;
+ Pos = MAP_APPFONT ( 138 , 18 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_GRF_COUNT
{
- Pos = MAP_APPFONT ( 114 , 30 ) ;
+ Pos = MAP_APPFONT ( 138 , 30 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_OLE_COUNT
{
- Pos = MAP_APPFONT ( 114 , 42 ) ;
+ Pos = MAP_APPFONT ( 138 , 42 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_PARA_COUNT
{
- Pos = MAP_APPFONT ( 114 , 54 ) ;
+ Pos = MAP_APPFONT ( 138 , 54 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_WORD_COUNT
{
- Pos = MAP_APPFONT ( 114 , 68 ) ;
+ Pos = MAP_APPFONT ( 138 , 68 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_CHAR_COUNT
{
- Pos = MAP_APPFONT ( 114 , 82 ) ;
+ Pos = MAP_APPFONT ( 138 , 82 ) ;
+ Size = MAP_APPFONT ( 27 , 8 ) ;
+ Left = TRUE ;
+ };
+ FixedText FT_CHAR_COUNT_EXCL_SPACES
+ {
+ Pos = MAP_APPFONT ( 138 , 96 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
};
FixedText FT_LINE_COUNT
{
- Pos = MAP_APPFONT ( 114 , 96 ) ;
+ Pos = MAP_APPFONT ( 138 , 110 ) ;
Size = MAP_APPFONT ( 27 , 8 ) ;
Left = TRUE ;
Text = "..." ;
@@ -141,7 +154,7 @@ TabPage TP_DOC_STAT
PushButton PB_PDATE
{
HelpID = "sw:PushButton:TP_DOC_STAT:PB_PDATE";
- Pos = MAP_APPFONT ( 204 , 94 ) ;
+ Pos = MAP_APPFONT ( 204 , 108 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Update" ;
};
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 4ae83ef60d77..74cd40a2d671 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,9 +39,7 @@
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
#include <svx/htmlmode.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
@@ -63,7 +62,6 @@ using ::com::sun::star::frame::XFrame;
SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
{
- // const SfxItemSet& rSet = rPg.GetItemSet();
SfxEventNamesItem aItem(SID_EVENTCONFIG);
sal_Bool bHtmlMode = sal_False;
@@ -72,17 +70,15 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
switch( eType )
{
- case MACASSGN_TEXTBAUST: // Textbausteine
- // rPg.SetGetRangeLink( &_GetRangeHdl );
+ case MACASSGN_AUTOTEXT:
aItem.AddEvent( String( SW_RES(STR_EVENT_START_INS_GLOSSARY) ), String(),
SW_EVENT_START_INS_GLOSSARY );
aItem.AddEvent( String( SW_RES(STR_EVENT_END_INS_GLOSSARY) ), String(),
SW_EVENT_END_INS_GLOSSARY);
- // damit der neue Handler aktiv wird!
- // rPg.Reset( rSet );
+ // in order for the new handler to become active!
break;
case MACASSGN_ALLFRM:
- case MACASSGN_GRAPHIC: // Grafiken
+ case MACASSGN_GRAPHIC: // graphics
{
aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ERROR) ), String(),
SVX_EVENT_IMAGE_ERROR);
@@ -91,8 +87,8 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_LOAD) ), String(),
SVX_EVENT_IMAGE_LOAD);
}
- // kein break;
- case MACASSGN_FRMURL: // Frm - URL-Attribute
+ // no break;
+ case MACASSGN_FRMURL: // Frm - URL-Attributes
{
if( !bHtmlMode &&
(MACASSGN_FRMURL == eType || MACASSGN_ALLFRM == eType))
@@ -107,15 +103,15 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
SW_EVENT_FRM_MOVE );
}
}
- // kein break;
+ // no break;
case MACASSGN_OLE: // OLE
{
if( !bHtmlMode )
aItem.AddEvent( String( SW_RES(STR_EVENT_OBJECT_SELECT) ), String(),
SW_EVENT_OBJECT_SELECT );
}
- // kein break;
- case MACASSGN_INETFMT: // INetFmt-Attribute
+ // no break;
+ case MACASSGN_INETFMT: // INetFmt-Attributes
{
aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOVER_OBJECT) ), String(),
SFX_EVENT_MOUSEOVER_OBJECT );
@@ -161,3 +157,5 @@ sal_Bool SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh,
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx
index df22cbe9e2dc..74f1e206c7f2 100644
--- a/sw/source/ui/dialog/regionsw.cxx
+++ b/sw/source/ui/dialog/regionsw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@
#include <view.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <column.hxx>
#include <fmtfsize.hxx>
#include <swunodef.hxx>
@@ -67,11 +68,6 @@
#include <svx/dlgutil.hxx>
#include "swabstdlg.hxx"
-/*--------------------------------------------------------------------
- Beschreibung: Bereiche einfuegen
- --------------------------------------------------------------------*/
-
-
void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
{
SwWrtShell& rSh = GetShell();
@@ -95,13 +91,13 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
long nWidth = aRect.Width();
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
- // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten)
+ // height=width for more consistent preview (analog to edit region)
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION,
&GetView().GetViewFrame()->GetWindow(), aSet , rSh);
- DBG_ASSERT(aTabDlg, "Dialogdiet fail!");
+ OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
aTabDlg->Execute();
rReq.Ignore();
delete aTabDlg;
@@ -147,17 +143,15 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
const sal_Bool bProtect = SFX_ITEM_SET ==
pSet->GetItemState(FN_PARAM_REGION_PROTECT, sal_True, &pItem)?
(sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
const sal_Bool bEditInReadonly = SFX_ITEM_SET ==
pSet->GetItemState(FN_PARAM_REGION_EDIT_IN_READONLY, sal_True, &pItem)?
(sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False;
- // <--
aSection.SetProtectFlag(bProtect);
aSection.SetHidden(bHidden);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
aSection.SetEditInReadonlyFlag(bEditInReadonly);
- // <--
if(SFX_ITEM_SET ==
pSet->GetItemState(FN_PARAM_REGION_CONDITION, sal_True, &pItem))
@@ -208,13 +202,13 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect )
pThis->CalcBoundRect(aRect, FLY_AS_CHAR);
long nWidth = aRect.Width();
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
- // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten)
+ // height=width for more consistent preview (analog to edit region)
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION,
&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis);
- DBG_ASSERT(aTabDlg, "Dialogdiet fail!");
+ OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
aTabDlg->SetSectionData(*pSectionData);
aTabDlg->Execute();
@@ -223,10 +217,6 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung: Bereich bearbeiten
- --------------------------------------------------------------------*/
-
void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -245,10 +235,10 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
if(bStart)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractEditRegionDlg* pEditRegionDlg = pFact->CreateEditRegionDlg( MD_EDIT_REGION,
pParentWin, rWrtShell);
- DBG_ASSERT(pEditRegionDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pEditRegionDlg, "Dialogdiet fail!");
if(pItem && pItem->ISA(SfxStringItem))
{
pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue());
@@ -262,3 +252,5 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
break;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/regionsw.hrc b/sw/source/ui/dialog/regionsw.hrc
index 0535ed46a630..b9d027fa6398 100644
--- a/sw/source/ui/dialog/regionsw.hrc
+++ b/sw/source/ui/dialog/regionsw.hrc
@@ -83,13 +83,11 @@
#define FL_END 52
#define FL_FTN 53
#define IL_BITMAPS 54
-#define ILH_BITMAPS 55
-// --> FME 2004-06-22 #114856# edit in readonly sections
+// #114856# edit in readonly sections
#define FL_PROPERTIES 56
#define CB_EDIT_IN_READONLY 57
-// <--
-/* Globale Resourcen */
+/* global resources */
#define STR_REG_DUPLICATE (RC_REGIONSW_BEGIN+6)
#define STR_INFO_DUPLICATE (RC_REGIONSW_BEGIN+7)
diff --git a/sw/source/ui/dialog/regionsw.src b/sw/source/ui/dialog/regionsw.src
index 9b0671af93f8..97d7dabdd1ec 100644
--- a/sw/source/ui/dialog/regionsw.src
+++ b/sw/source/ui/dialog/regionsw.src
@@ -31,7 +31,7 @@
#include "helpid.h"
/*************************************************************************
- Dialog "Bereich einfuegen"
+ Dialog "paste region"
*************************************************************************/
#define FT_SUBREG_TEXT \
@@ -82,7 +82,7 @@
/*************************************************************************
- Dialog "Bereiche bearbeiten"
+ Dialog "edit region"
*************************************************************************/
ModalDialog MD_EDIT_REGION
@@ -326,12 +326,6 @@ ModalDialog MD_EDIT_REGION
MaskColor = IMAGE_MASK_COLOR ;
DLG_IMAGE_IDLIST
};
- ImageList ILH_BITMAPS
- {
- Prefix = "reh";
- MaskColor = IMAGE_MASK_COLOR ;
- DLG_IMAGE_IDLIST
- };
};
String STR_REG_DUPLICATE
{
diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx
index 7a119caecbf5..2a3dedd83028 100644
--- a/sw/source/ui/dialog/swabstdlg.cxx
+++ b/sw/source/ui/dialog/swabstdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,10 +44,13 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create()
SwFuncPtrCreateDialogFactory fp = 0;
static ::osl::Module aDialogLibrary;
static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", sal_True));
- if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ) ) )
+ if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ),
+ SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = ( SwAbstractDialogFactory* (__LOADONCALLAPI*)() )
- aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+ aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory")));
if ( fp )
return fp();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdialmgr.cxx b/sw/source/ui/dialog/swdialmgr.cxx
index 308411358efa..77132e3e68dc 100644
--- a/sw/source/ui/dialog/swdialmgr.cxx
+++ b/sw/source/ui/dialog/swdialmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include <sfx2/app.hxx>
//copy from core\bastyp\swtypes.cxx
-String aEmptyStr; // Konstante Strings
+String aEmptyStr; // constant strings
ResMgr* pSwResMgr=0;
@@ -52,3 +53,5 @@ ResMgr* SwDialogsResMgr::GetResMgr()
return pSwResMgr;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 19db1f67c44b..de00a12d5704 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,13 +35,10 @@
#include "swdlgfact.hxx"
#include <svl/style.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include "dialog.hrc"
#include "misc.hrc"
#include "chrdlg.hrc"
-#include "fldui.hrc"
#include "table.hrc"
#include "frmui.hrc"
#include "dbui.hrc"
@@ -94,6 +92,7 @@
#include <instable.hxx> //add for SwInsTableDlg
#include <javaedit.hxx> //add for SwJavaEditDialog
#include <linenum.hxx> //add for SwLineNumberingDlg
+#include <titlepage.hxx> //add for SwTitlePageDlg
#include <mailmrge.hxx> //add for SwMailMergeDlg, SwMailMergeCreateFromDlg, SwMailMergeFieldConnectionsDlg
#include <mergetbl.hxx> //add for SwMergeTblDlg
#include <multmrk.hxx> //add for SwMultiTOXMarkDlg
@@ -124,8 +123,8 @@ IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for SwCharDlg, SwFootNoteOption
IMPL_ABSTDLG_BASE(AbstractSwConvertTableDlg_Impl); //add for SwConvertTableDlg
IMPL_ABSTDLG_BASE(AbstractSwInsertDBColAutoPilot_Impl); //add for SwInsertDBColAutoPilot
IMPL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl); //add for DropDownFieldDialog
-IMPL_ABSTDLG_BASE(AbstarctSwLabDlg_Impl);//add for SwLabDlg
-IMPL_ABSTDLG_BASE(AbstarctSwSelGlossaryDlg_Impl);//add for SwSelGlossaryDlg
+IMPL_ABSTDLG_BASE(AbstractSwLabDlg_Impl);//add for SwLabDlg
+IMPL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl);//add for SwSelGlossaryDlg
IMPL_ABSTDLG_BASE(AbstractSwAutoFormatDlg_Impl); //add for SwAutoFormatDlg
IMPL_ABSTDLG_BASE(AbstractSwFldDlg_Impl); //add for SwFldDlg
IMPL_ABSTDLG_BASE(AbstractSwRenameXNamedDlg_Impl); //add for SwRenameXNamedDlg
@@ -145,7 +144,6 @@ IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl);
-// AbstractTabDialog_Impl begin
void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
{
pDlg->SetCurPageId( nId );
@@ -165,24 +163,23 @@ void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
pDlg->SetInputSet( pInSet );
}
+
//From class Window.
void AbstractTabDialog_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
}
+
String AbstractTabDialog_Impl::GetText() const
{
return pDlg->GetText();
}
-//add for AbstractTabDialog_Impl end
-
void AbstractSwWordCountDialog_Impl::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
{
pDlg->SetValues(rCurrent, rDoc);
}
-//add for SwInsertAbstractDlg begin
sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const
{
return pDlg->GetLevel();
@@ -191,7 +188,6 @@ sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetPara() const
{
return pDlg->GetPara();
}
-//add for SwInsertAbstractDlg end
//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg SwFldEditDlg begin
const SfxItemSet* AbstractSfxDialog_Impl::GetOutputItemSet() const
@@ -203,26 +199,22 @@ void AbstractSfxDialog_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
}
+
String AbstractSfxDialog_Impl::GetText() const
{
return pDlg->GetText();
}
-//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg SwFldEditDlg end
-
-//add for SwAsciiFilterDlg begin
void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions )
{
pDlg->FillOptions(rOptions);
}
-//add for SwAsciiFilterDlg end
-//add for SwSplitTblDlg
sal_uInt16 AbstractSplitTableDialog_Impl::GetSplitMode()
{
return pDlg->GetSplitMode();
}
-//add for SwBreakDlg begin
+
String AbstractSwBreakDlg_Impl::GetTemplateName()
{
return pDlg->GetTemplateName();
@@ -237,17 +229,13 @@ sal_uInt16 AbstractSwBreakDlg_Impl:: GetPageNumber()
{
return pDlg->GetPageNumber();
}
-//add for SwBreakDlg end
-//add for SwConvertTableDlg begin
void AbstractSwConvertTableDlg_Impl::GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTblFlags,
SwTableAutoFmt *& prTAFmt )
{
pDlg->GetValues(rDelim,rInsTblFlags, prTAFmt);
}
-//add for SwConvertTableDlg end
-//add for SwInsertDBColAutoPilot begin
void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::Any >& rSelection,
uno::Reference< sdbc::XDataSource> rxSource,
uno::Reference< sdbc::XConnection> xConnection,
@@ -255,86 +243,77 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A
{
pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet);
}
-//add for SwInsertDBColAutoPilot end
-// add for DropDownFieldDialog begin
ByteString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const
{
return pDlg->GetWindowState(nMask);
}
+
void AbstractDropDownFieldDialog_Impl::SetWindowState( const ByteString& rStr )
{
pDlg->SetWindowState(rStr);
}
-//add for DropDownFieldDialog end
-//add for SwLabDlg begin
-
-void AbstarctSwLabDlg_Impl::SetCurPageId( sal_uInt16 nId )
+void AbstractSwLabDlg_Impl::SetCurPageId( sal_uInt16 nId )
{
pDlg->SetCurPageId( nId );
}
-const SfxItemSet* AbstarctSwLabDlg_Impl::GetOutputItemSet() const
+const SfxItemSet* AbstractSwLabDlg_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
}
-const sal_uInt16* AbstarctSwLabDlg_Impl::GetInputRanges(const SfxItemPool& pItem )
+const sal_uInt16* AbstractSwLabDlg_Impl::GetInputRanges(const SfxItemPool& pItem )
{
return pDlg->GetInputRanges( pItem );
}
-void AbstarctSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet )
+void AbstractSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet )
{
pDlg->SetInputSet( pInSet );
}
-void AbstarctSwLabDlg_Impl::SetText( const XubString& rStr )
+void AbstractSwLabDlg_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
}
-String AbstarctSwLabDlg_Impl::GetText() const
+
+String AbstractSwLabDlg_Impl::GetText() const
{
return pDlg->GetText();
}
-const String& AbstarctSwLabDlg_Impl::GetBusinessCardStr() const
+
+const String& AbstractSwLabDlg_Impl::GetBusinessCardStr() const
{
return pDlg->GetBusinessCardStr();
}
-Printer * AbstarctSwLabDlg_Impl::GetPrt()
+
+Printer * AbstractSwLabDlg_Impl::GetPrt()
{
return pDlg->GetPrt();
}
-//add for SwLabDlg end
-
-//add for SwSelGlossaryDlg begin
-
-void AbstarctSwSelGlossaryDlg_Impl::InsertGlos(const String &rRegion, const String &rGlosName)
+void AbstractSwSelGlossaryDlg_Impl::InsertGlos(const String &rRegion, const String &rGlosName)
{
pDlg->InsertGlos( rRegion, rGlosName );
}
-sal_uInt16 AbstarctSwSelGlossaryDlg_Impl::GetSelectedIdx() const
+
+sal_uInt16 AbstractSwSelGlossaryDlg_Impl::GetSelectedIdx() const
{
return pDlg->GetSelectedIdx();
}
-void AbstarctSwSelGlossaryDlg_Impl::SelectEntryPos(sal_uInt16 nIdx)
+
+void AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_uInt16 nIdx)
{
pDlg->SelectEntryPos( nIdx );
}
-//add for SwSelGlossaryDlg end
-
-//add for SwAutoFormatDlg begin
-
void AbstractSwAutoFormatDlg_Impl::FillAutoFmtOfIndex( SwTableAutoFmt*& rToFill ) const
{
pDlg->FillAutoFmtOfIndex(rToFill);
}
-//add for SwAutoFormatDlg end
-//add for SwFldDlg begin
void AbstractSwFldDlg_Impl::SetCurPageId( sal_uInt16 nId )
{
pDlg->SetCurPageId( nId );
@@ -359,10 +338,12 @@ void AbstractSwFldDlg_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
}
+
String AbstractSwFldDlg_Impl::GetText() const
{
return pDlg->GetText();
}
+
void AbstractSwFldDlg_Impl::Start( sal_Bool bShowl )
{
pDlg->Start( bShowl );
@@ -377,10 +358,12 @@ void AbstractSwFldDlg_Impl::ReInitDlg()
{
pDlg->ReInitDlg();
}
+
void AbstractSwFldDlg_Impl::ActivateDatabasePage()
{
pDlg->ActivateDatabasePage();
}
+
Window* AbstractSwFldDlg_Impl::GetWindow()
{
return (Window*)pDlg;
@@ -389,9 +372,6 @@ void AbstractSwFldDlg_Impl::ShowPage( sal_uInt16 nId )
{
pDlg->ShowPage(nId);
}
-//add for SwFldD end
-
-//add for SwRenameXNamedDlg begin
void AbstractSwRenameXNamedDlg_Impl::SetForbiddenChars( const String& rSet )
{
@@ -404,17 +384,12 @@ void AbstractSwRenameXNamedDlg_Impl::SetAlternativeAccess(
{
pDlg->SetAlternativeAccess( xSecond, xThird);
}
-//add for SwRenameXNamedDlg end
-
-//add for SwModalRedlineAcceptDlg begin
void AbstractSwModalRedlineAcceptDlg_Impl::AcceptAll( sal_Bool bAccept )
{
pDlg->AcceptAll( bAccept);
}
-//add for SwModalRedlineAcceptDlg end
-// AbstractGlossaryDlg_Impl begin
String AbstractGlossaryDlg_Impl::GetCurrGrpName() const
{
return pDlg->GetCurrGrpName();
@@ -424,9 +399,7 @@ String AbstractGlossaryDlg_Impl::GetCurrShortName() const
{
return pDlg->GetCurrShortName();
}
-// AbstractGlossaryDlg_Impl end
-// AbstractFldInputDlg_Impl begin
void AbstractFldInputDlg_Impl::SetWindowState( const ByteString& rStr )
{
pDlg->SetWindowState( rStr );
@@ -436,9 +409,7 @@ ByteString AbstractFldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const
{
return pDlg->GetWindowState( nMask );
}
-// AbstractFldInputDlg_Impl end
-// AbstractInsFootNoteDlg_Impl begin
String AbstractInsFootNoteDlg_Impl::GetFontName()
{
return pDlg->GetFontName();
@@ -447,6 +418,7 @@ sal_Bool AbstractInsFootNoteDlg_Impl::IsEndNote()
{
return pDlg->IsEndNote();
}
+
String AbstractInsFootNoteDlg_Impl::GetStr()
{
return pDlg->GetStr();
@@ -455,13 +427,12 @@ void AbstractInsFootNoteDlg_Impl::SetHelpId( const rtl::OString& sHelpId )
{
pDlg->SetHelpId( sHelpId );
}
+
void AbstractInsFootNoteDlg_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
}
-// AbstractInsFootNoteDlg_Impl end
-// AbstractInsertGrfRulerDlg_Impl begin
String AbstractInsertGrfRulerDlg_Impl::GetGraphicName()
{
return pDlg->GetGraphicName();
@@ -474,22 +445,19 @@ sal_Bool AbstractInsertGrfRulerDlg_Impl::HasImages() const
{
return pDlg->HasImages();
}
-// AbstractInsertGrfRulerDlg_Impl end
-// AbstractInsTableDlg_Impl begin
void AbstractInsTableDlg_Impl::GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol,
SwInsertTableOptions& rInsTblFlags, String& rTableAutoFmtName,
SwTableAutoFmt *& prTAFmt )
{
pDlg->GetValues( rName, rRow, rCol, rInsTblFlags, rTableAutoFmtName, prTAFmt);
}
-// AbstractInsTableDlg_Impl end
-// AbstractJavaEditDialog_Impl begin
String AbstractJavaEditDialog_Impl::GetText()
{
return pDlg->GetText();
}
+
String AbstractJavaEditDialog_Impl::GetType()
{
return pDlg->GetType();
@@ -506,13 +474,12 @@ sal_Bool AbstractJavaEditDialog_Impl::IsUpdate()
{
return pDlg->IsUpdate();
}
-// AbstractJavaEditDialog_Impl end
-// AbstractMailMergeDlg_Impl begin
sal_uInt16 AbstractMailMergeDlg_Impl::GetMergeType()
{
return pDlg->GetMergeType();
}
+
const ::rtl::OUString& AbstractMailMergeDlg_Impl::GetSaveFilter() const
{
return pDlg->GetSaveFilter();
@@ -522,6 +489,7 @@ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > AbstractMail
{
return pDlg->GetSelection();
}
+
uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() const
{
return pDlg->GetResultSet();
@@ -543,74 +511,66 @@ String AbstractMailMergeDlg_Impl::GetPath() const
return pDlg->GetPath();
}
-// AbstractMailMergeDlg_Impl end
-// AbstractMailMergeCreateFromDlg_Impl begin
sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
{
return pDlg->IsThisDocument();
}
-// AbstractMailMergeCreateFromDlg_Impl end
-//AbstractMailMergeFieldConnectionsDlg_Impl begin
+
sal_Bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const
{
return pDlg->IsUseExistingConnections();
}
-// AbstractMailMergeFieldConnectionsDlg_Impl end
-// AbstractMultiTOXTabDialog_Impl begin
SwForm* AbstractMultiTOXTabDialog_Impl::GetForm(CurTOXType eType)
{
return pDlg->GetForm(eType);
}
+
CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const
{
return pDlg->GetCurrentTOXType();
}
+
SwTOXDescription& AbstractMultiTOXTabDialog_Impl::GetTOXDescription(CurTOXType eTOXTypes)
{
return pDlg->GetTOXDescription(eTOXTypes);
}
+
const SfxItemSet* AbstractMultiTOXTabDialog_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
}
-// AbstractMultiTOXTabDialog_Impl end
-// AbstractEditRegionDlg_Impl begin
void AbstractEditRegionDlg_Impl::SelectSection(const String& rSectionName)
{
pDlg->SelectSection(rSectionName);
}
-// AbstractEditRegionDlg_Impl end
-//AbstractInsertSectionTabDialog_Impl begin
+
void
AbstractInsertSectionTabDialog_Impl::SetSectionData(SwSectionData const& rSect)
{
pDlg->SetSectionData(rSect);
}
-// AbstractInsertSectionTabDialog_Impl end
-//AbstractIndexMarkFloatDlg_Impl begin
void AbstractIndexMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell)
{
pDlg->ReInitDlg( rWrtShell);
}
+
Window* AbstractIndexMarkFloatDlg_Impl::GetWindow()
{
return (Window*)pDlg;
}
-// AbstractIndexMarkFloatDlg_Impl end
-//AbstractAuthMarkFloatDlg_Impl begin
void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell)
{
pDlg->ReInitDlg( rWrtShell);
}
+
Window* AbstractAuthMarkFloatDlg_Impl::GetWindow()
{
return (Window*)pDlg;
}
-// AbstractAuthMarkFloatDlg_Impl end
AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl()
{
@@ -629,13 +589,15 @@ long AbstractMailMergeWizard_Impl::GetResult()
return pDlg->GetResult();
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog )
#else
IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG )
#endif
{
- DBG_ASSERT( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" );
+#endif
aEndDlgHdl.Call( this );
aEndDlgHdl = Link();
@@ -647,6 +609,7 @@ void AbstractMailMergeWizard_Impl::SetReloadDocument(const String& rURL)
{
pDlg->SetReloadDocument(rURL);
}
+
const String& AbstractMailMergeWizard_Impl::GetReloadDocument() const
{
return pDlg->GetReloadDocument();
@@ -655,20 +618,18 @@ sal_Bool AbstractMailMergeWizard_Impl::ShowPage( sal_uInt16 nLevel )
{
return pDlg->skipUntil(nLevel);
}
+
sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const
{
return pDlg->GetRestartPage();
}
-//-------------- SwAbstractDialogFactory implementation--------------
-
AbstractSwWordCountDialog* SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(Window* pParent)
{
SwWordCountDialog* pDlg = new SwWordCountDialog( pParent );
return new AbstractSwWordCountDialog_Impl( pDlg );
}
-//add for SwInsertAbstractDlg begin
AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg( Window* pParent,
int nResId )
{
@@ -686,7 +647,6 @@ AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstra
return new AbstractSwInsertAbstractDlg_Impl( pDlg );
return 0;
}
-//add for SwInsertAbstractDlg end
SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
const SfxItemSet& rSet,
@@ -718,7 +678,6 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParen
return 0;
}
-// add for SwAsciiFilterDlg begin
AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( Window* pParent,
SwDocShell& rDocSh,
SvStream* pStream,
@@ -740,9 +699,6 @@ AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg(
return 0;
}
-//add for SwAsciiFilterDlg end
-
-// add for SwInsertBookmarkDlg begin
VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Window *pParent,
SwWrtShell &rSh,
SfxRequest& rReq,
@@ -764,10 +720,6 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Wind
return 0;
}
-//add for SwInsertBookmarkDlg end
-
-//add for SwBreakDlg begin
-
AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg ( Window *pParent,
SwWrtShell &rSh,
int nResId )
@@ -787,9 +739,7 @@ AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg ( Window *pP
return new AbstractSwBreakDlg_Impl( pDlg );
return 0;
}
-//add for SwBreakDlg end
-// add for SwChangeDBDlg begin
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& rVw, int nResId )
{
Dialog* pDlg=NULL;
@@ -808,9 +758,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView&
return 0;
}
-// add for SwChangeDBDlg end
-// add for SwCharDlg begin
SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg
const String* pFmtStr , sal_Bool bIsDrwTxtDlg )
{
@@ -830,9 +778,7 @@ SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pP
return 0;
}
-// add for SwCharDlg end
-//add for SwConvertTableDlg begin
AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg (
SwView& rView,int nResId, bool bToTable )
{
@@ -851,9 +797,6 @@ AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg
return 0;
}
-//add for SwConvertTableDlg end
-
-//add for SwCaptionDialog begin
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId)
{
Dialog* pDlg=NULL;
@@ -871,9 +814,6 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( Window
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
-//add for SwCaptionDialog end
-
-//add for SwInsertDBColAutoPilot begin
AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView, // add for SwInsertDBColAutoPilot
uno::Reference< sdbc::XDataSource> rxSource,
@@ -895,8 +835,7 @@ AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBCo
return new AbstractSwInsertDBColAutoPilot_Impl( pDlg );
return 0;
}
-//add for SwInsertDBColAutoPilot end
-//add for SwFootNoteOptionDlg begin
+
SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg( Window *pParent, SwWrtShell &rSh,int nResId)
{
SfxTabDialog* pDlg=NULL;
@@ -914,10 +853,6 @@ SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for SwFootNoteOptionDlg begin
-
-
-//add for DropDownFieldDialog begin
AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog
SwField* pField,int nResId, sal_Bool bNextButton )
@@ -937,9 +872,7 @@ AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownField
return new AbstractDropDownFieldDialog_Impl( pDlg );
return 0;
}
-//add for DropDownFieldDialog end
-//add for SwEnvDlg begin
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet,
SwWrtShell* pWrtSh, Printer* pPrt,
sal_Bool bInsert,int nResId ) //add for SwEnvDlg
@@ -959,11 +892,8 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pPa
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for SwEnvDlg end
-//add for SwLabDlg begin
-
-AbstarctSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
+AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId )
{
SwLabDlg* pDlg=NULL;
@@ -978,7 +908,7 @@ AbstarctSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent
}
if ( pDlg )
- return new AbstarctSwLabDlg_Impl( pDlg );
+ return new AbstractSwLabDlg_Impl( pDlg );
return 0;
}
@@ -987,9 +917,7 @@ SwLabDlgMethod SwAbstractDialogFactory_Impl::GetSwLabDlgStaticMethod ()
return SwLabDlg::UpdateFieldInformation;
}
-//add for SwLabDlg end
-//add for SwParaDlg begin
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pParent, SwView& rVw,
const SfxItemSet& rCoreSet ,
sal_uInt8 nDialogMode,
@@ -1013,9 +941,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pP
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for SwParaDlg end
-//add for SwTableHeightDlg SwSortDlg begin
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Window *pParent, SwWrtShell &rSh, int nResId )
{
Dialog* pDlg=NULL;
@@ -1042,16 +968,13 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Wind
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
-//add for SwTableHeightDlg SwSortDlg ,end
-//add for SwSplitTblDlg begin
+
AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( Window *pParent, SwWrtShell &rSh )
{
return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) );
}
-//add SwSplitTblDlg end
-//add for SwSelGlossaryDlg begin
-AbstarctSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId )
+AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId )
{
SwSelGlossaryDlg* pDlg=NULL;
switch ( nResId )
@@ -1065,13 +988,10 @@ AbstarctSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg
}
if ( pDlg )
- return new AbstarctSwSelGlossaryDlg_Impl( pDlg );
+ return new AbstractSwSelGlossaryDlg_Impl( pDlg );
return 0;
}
-//add for SwSelGlossaryDlg end
-
-//add for SwAutoFormatDlg begin
AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell,
int nResId,
sal_Bool bSetAutoFmt,
@@ -1092,9 +1012,7 @@ AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( W
return new AbstractSwAutoFormatDlg_Impl( pDlg );
return 0;
}
-//add for SwAutoFormatDlg end
-//add for SwBorderDlg begin
SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId )
{
SfxModalDialog* pDlg=NULL;
@@ -1111,9 +1029,7 @@ SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pPa
return new AbstractSfxDialog_Impl( pDlg );
return 0;
}
-//add for SwBorderDlg end
-//add for SwWrapDlg begin
SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId )
{
SfxModalDialog* pDlg=NULL;
@@ -1130,9 +1046,7 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pPare
return new AbstractSfxDialog_Impl( pDlg );
return 0;
}
-//add for SwWrapDlg end
-//add for SwTableWidthDlg begin
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId )
{
Dialog* pDlg=NULL;
@@ -1150,9 +1064,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
-//add for SwTableWidthDlg end
- //add for SwTableTabDlg begin
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool,
const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId )
{
@@ -1171,9 +1083,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window*
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
- //add for SwTableTabDlg end
-//add for SwFldDlg begin
AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId )
{
SwFldDlg* pDlg=NULL;
@@ -1191,9 +1101,7 @@ AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* p
return new AbstractSwFldDlg_Impl( pDlg );
return 0;
}
-//add for SwFldDlg end
-//add for SwFldEditDlg begin
SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId )
{
SfxModalDialog* pDlg=NULL;
@@ -1210,9 +1118,7 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView&
return new AbstractSfxDialog_Impl( pDlg );
return 0;
}
-//add for SwFldEditDlg
-//add for SwRenameXNamedDlg begin
AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg( Window* pParent,
STAR_REFERENCE( container::XNamed ) & xNamed,
STAR_REFERENCE( container::XNameAccess ) & xNameAccess,int nResId )
@@ -1232,9 +1138,6 @@ AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDl
return 0;
}
-//add for SwRenameXNamedDlg end
-
-//add for SwModalRedlineAcceptDlg begin
AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId )
{
SwModalRedlineAcceptDlg* pDlg=NULL;
@@ -1251,7 +1154,6 @@ AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRed
return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg );
return 0;
}
-//add for SwModalRedlineAcceptDlg end
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId,
Window* pParent, sal_Bool& rWithPrev ) //add for SwMergeTblDlg
@@ -1269,6 +1171,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId,
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
+
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId,
SfxViewFrame *pFrame, Window *pParent,
const SfxItemSet& rCoreSet,
@@ -1372,6 +1275,14 @@ AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg( int
return 0;
}
+VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( Window *pParent )
+{
+ Dialog* pDlg = new SwTitlePageDlg( pParent );
+ if ( pDlg )
+ return new VclAbstractDialog_Impl( pDlg );
+ return 0;
+}
+
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool /*bCol*/ ) //add for SwInsRowColDlg, SwLineNumberingDlg
{
@@ -1463,6 +1374,7 @@ AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nRe
return new AbstractMailMergeDlg_Impl( pDlg );
return 0;
}
+
AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg( int nResId,
Window* pParent ) //add for SwMailMergeCreateFromDlg
{
@@ -1479,6 +1391,7 @@ AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCr
return new AbstractMailMergeCreateFromDlg_Impl( pDlg );
return 0;
}
+
AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId,
Window* pParent ) //add for SwMailMergeFieldConnectionsDlg
{
@@ -1512,6 +1425,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nRe
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
+
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,
@@ -1534,6 +1448,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResI
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
+
AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog( int nResId,
Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
@@ -1553,6 +1468,7 @@ AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialo
return new AbstractMultiTOXTabDialog_Impl( pDlg );
return 0;
}
+
AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg( int nResId,
Window* pParent, SwWrtShell& rWrtSh ) //add for SwEditRegionDlg
{
@@ -1569,6 +1485,7 @@ AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg( int n
return new AbstractEditRegionDlg_Impl( pDlg );
return 0;
}
+
AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( int nResId,
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) //add for SwInsertSectionTabDialog
{
@@ -1649,6 +1566,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( int n
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
+
//add for SwIndexMarkModalDlg end
AbstractMailMergeWizard* SwAbstractDialogFactory_Impl::CreateMailMergeWizard(
SwView& rView, SwMailMergeConfigItem& rConfigItem)
@@ -1713,7 +1631,7 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI
break;
case RID_SW_TP_OPTTEST_PAGE :
case TP_OPTTEST_PAGE :
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
pRet = SwTestTabPage::Create;
#endif
break;
@@ -1757,3 +1675,5 @@ GetTabPageRanges SwAbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 4c970c58aca7..9b883eaa979f 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,6 @@
#ifndef _SW_DLGFACT_HXX
#define _SW_DLGFACT_HXX
-// include ---------------------------------------------------------------
#include "swabstdlg.hxx"
class SwSaveLabelDlg;
@@ -181,9 +181,9 @@ class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog //ad
//add for DropDownFieldDialog end
-class AbstarctSwLabDlg_Impl : public AbstarctSwLabDlg
+class AbstractSwLabDlg_Impl : public AbstractSwLabDlg
{
- DECL_ABSTDLG_BASE(AbstarctSwLabDlg_Impl,SwLabDlg)
+ DECL_ABSTDLG_BASE(AbstractSwLabDlg_Impl,SwLabDlg)
virtual void SetCurPageId( sal_uInt16 nId );
virtual const SfxItemSet* GetOutputItemSet() const;
virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem );
@@ -197,9 +197,9 @@ class AbstarctSwLabDlg_Impl : public AbstarctSwLabDlg
//add for SwLabDlg end
//add for SwSelGlossaryDlg begin
-class AbstarctSwSelGlossaryDlg_Impl : public AbstarctSwSelGlossaryDlg
+class AbstractSwSelGlossaryDlg_Impl : public AbstractSwSelGlossaryDlg
{
- DECL_ABSTDLG_BASE(AbstarctSwSelGlossaryDlg_Impl,SwSelGlossaryDlg)
+ DECL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl,SwSelGlossaryDlg)
virtual void InsertGlos(const String &rRegion, const String &rGlosName); // inline
virtual sal_uInt16 GetSelectedIdx() const; // inline
virtual void SelectEntryPos(sal_uInt16 nIdx); // inline
@@ -458,7 +458,7 @@ public:
virtual AbstractDropDownFieldDialog * CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog
SwField* pField,int nResId, sal_Bool bNextButton = sal_False );
virtual SfxAbstractTabDialog* CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ); //add for SwEnvDlg
- virtual AbstarctSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
+ virtual AbstractSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg
SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId );
virtual SwLabDlgMethod GetSwLabDlgStaticMethod (); //add for SwLabDlg
@@ -471,7 +471,7 @@ public:
sal_Bool bDraw = sal_False,
sal_uInt16 nDefPage = 0);
- virtual AbstarctSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg
+ virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg
virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg
virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg
@@ -518,6 +518,7 @@ public:
SwField* pField, sal_Bool bNextButton = sal_False ); //add for SwFldInputDlg
virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg( int nResId,
Window * pParent, SwWrtShell &rSh, sal_Bool bEd = sal_False); //add for SwInsFootNoteDlg
+ virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent );
virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId,
@@ -586,3 +587,5 @@ struct SwDialogsResMgr
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx
index 3957a233f5e2..0c2bdd4c3a56 100644
--- a/sw/source/ui/dialog/swuiexp.cxx
+++ b/sw/source/ui/dialog/swuiexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ extern "C"
return ::swui::GetFactory();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swwrtshitem.cxx b/sw/source/ui/dialog/swwrtshitem.cxx
index 8bc635cf769c..1385705b9488 100644
--- a/sw/source/ui/dialog/swwrtshitem.cxx
+++ b/sw/source/ui/dialog/swwrtshitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ SfxPoolItem* SwWrtShellItem::Clone( SfxItemPool * /*pPool*/ ) const
{
return new SwWrtShellItem( *this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index e0ec8cdf2a0b..8199981d1d19 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,13 +55,13 @@
#include <IMark.hxx>
#include <section.hxx>
#include <docary.hxx>
-#include <doc.hxx> // fuers SwSectionFmt-Array
+#include <doc.hxx> // for the SwSectionFmt-Array
#include <basesh.hxx>
#include <wdocsh.hxx>
#include <view.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <column.hxx>
#include <fmtfsize.hxx>
#include <swunodef.hxx>
@@ -148,9 +149,6 @@ void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pA
}
}
-/* -----------------25.06.99 15:38-------------------
-
- --------------------------------------------------*/
class SwTestPasswdDlg : public SfxPasswordDialog
{
public:
@@ -162,7 +160,7 @@ public:
};
/*----------------------------------------------------------------------------
- Beschreibung: User Data Klasse fuer Bereichsinformationen
+ Description: user data class for region information
----------------------------------------------------------------------------*/
class SectRepr
@@ -177,9 +175,9 @@ private:
SvxFrameDirectionItem m_FrmDirItem;
SvxLRSpaceItem m_LRSpaceItem;
sal_uInt16 m_nArrPos;
- // zeigt an, ob evtl. Textinhalt im Bereich ist
+ // shows, if maybe textcontent is in the region
bool m_bContent : 1;
- // fuer Multiselektion erst markieren, dann mit der TreeListBox arbeiten!
+ // for multiselection, mark at first, then work with TreeListBox!
bool m_bSelected : 1;
uno::Sequence<sal_Int8> m_TempPasswd;
@@ -255,7 +253,7 @@ void SectRepr::SetFile( const String& rFile )
if( rFile.Len() || sSub.Len() )
{
sNewFile += sfx2::cTokenSeperator;
- if( rFile.Len() ) // Filter nur mit FileName
+ if( rFile.Len() ) // Filter only with FileName
sNewFile += sOldFileName.GetToken( 1, sfx2::cTokenSeperator );
sNewFile += sfx2::cTokenSeperator;
@@ -349,14 +347,9 @@ String SectRepr::GetSubRegion() const
return sLinkFile;
}
-
-
/*----------------------------------------------------------------------------
- Beschreibung: Dialog Bearbeiten Bereiche
+ Description: dialog edit regions
----------------------------------------------------------------------------*/
-
-//---------------------------------------------------------------------
-
SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
: SfxModalDialog( pParent, SW_RES(MD_EDIT_REGION) ),
aNameFL ( this, SW_RES( FL_NAME ) ),
@@ -383,10 +376,9 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aConditionFT ( this, SW_RES( FT_CONDITION ) ),
aConditionED ( this, SW_RES( ED_CONDITION ) ),
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ),
aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ),
- // <--
aOK ( this, SW_RES( PB_OK ) ),
aCancel ( this, SW_RES( PB_CANCEL ) ),
@@ -395,7 +387,6 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aHelp ( this, SW_RES( PB_HELP ) ),
aImageIL ( SW_RES(IL_BITMAPS)),
- aImageILH ( SW_RES(ILH_BITMAPS)),
rSh( rWrtSh ),
pAktEntry( 0 ),
@@ -415,9 +406,8 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aPasswdCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl));
aPasswdPB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl));
aHideCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeHideHdl));
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeEditInReadonlyHdl));
- // <--
aOptionsPB.Show();
aOptionsPB.SetClickHdl ( LINK( this, SwEditRegionDlg, OptionsHdl));
@@ -448,11 +438,10 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aDDECB.SetClickHdl ( LINK( this, SwEditRegionDlg, DDEHdl ));
- //Ermitteln der vorhandenen Bereiche
pCurrSect = rSh.GetCurrSection();
RecurseList( 0, 0 );
- //falls der Cursor nicht in einem Bereich steht,
- //wird immer der erste selektiert
+ // if the cursor is not in a region
+ // the first one will always be selected
if( !aTree.FirstSelected() && aTree.First() )
aTree.Select( aTree.First() );
aTree.Show();
@@ -462,9 +451,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB);
aSubRegionED.SetAccessibleName(aSubRegionFT.GetText());
}
-/* -----------------------------26.04.01 14:56--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
{
if(bDontCheckPasswd)
@@ -509,10 +496,10 @@ sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
return bRet;
}
+
/*---------------------------------------------------------------------
- Beschreibung: Durchsuchen nach Child-Sections, rekursiv
+ Description: recursively look for child-sections
---------------------------------------------------------------------*/
-
void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry )
{
SwSection* pSect = 0;
@@ -531,11 +518,8 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry
{
SectRepr* pSectRepr = new SectRepr( n,
*(pSect=pFmt->GetSection()) );
- Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_False);
+ Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden());
pEntry = aTree.InsertEntry(pSect->GetSectionName(), aImg, aImg);
- Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_True);
- aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
pEntry->SetUserData(pSectRepr);
RecurseList( pFmt, pEntry );
if (pEntry->HasChilds())
@@ -564,12 +548,9 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry
SectRepr* pSectRepr=new SectRepr(
FindArrPos( pSect->GetFmt() ), *pSect );
Image aImage = BuildBitmap( pSect->IsProtect(),
- pSect->IsHidden(), sal_False);
+ pSect->IsHidden());
pNEntry = aTree.InsertEntry(
pSect->GetSectionName(), aImage, aImage, pEntry);
- Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_True);
- aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
pNEntry->SetUserData(pSectRepr);
RecurseList( aTmpArr[n]->GetFmt(), pNEntry );
if( pNEntry->HasChilds())
@@ -586,9 +567,6 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry
aTree.Select(pSelEntry);
}
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt )
{
@@ -597,12 +575,9 @@ sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt )
if (pFmt==&rSh.GetSectionFmt(i))
return i;
- DBG_ERROR( "SectionFormat nicht in der Liste" );
+ OSL_FAIL("SectionFormat not on the list" );
return USHRT_MAX;
}
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
SwEditRegionDlg::~SwEditRegionDlg( )
{
@@ -616,9 +591,7 @@ SwEditRegionDlg::~SwEditRegionDlg( )
aSectReprArr.DeleteAndDestroy( 0, aSectReprArr.Count() );
delete m_pDocInserter;
}
-/* -----------------------------09.10.2001 15:41------------------------------
- ---------------------------------------------------------------------------*/
void SwEditRegionDlg::SelectSection(const String& rSectionName)
{
SvLBoxEntry* pEntry = aTree.First();
@@ -636,20 +609,20 @@ void SwEditRegionDlg::SelectSection(const String& rSectionName)
aTree.MakeVisible(pEntry);
}
}
+
/*---------------------------------------------------------------------
- Beschreibung: Selektierte Eintrag in der TreeListBox wird im
- Edit-Fenster angezeigt
- Bei Multiselektion werden einige Controls disabled
+ Description: selected entry in TreeListBox is showed in
+ Edit window
+ in case of multiselection some controls are disabled
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
{
bDontCheckPasswd = sal_True;
SvLBoxEntry* pEntry=pBox->FirstSelected();
aHideCB .Enable(sal_True);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.Enable(sal_True);
- // <--
+
aProtectCB .Enable(sal_True);
aFileCB .Enable(sal_True);
UNO_NMSPC::Sequence <sal_Int8> aCurPasswd;
@@ -657,18 +630,18 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
{
aHideCB.EnableTriState( sal_True );
aProtectCB.EnableTriState( sal_True );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.EnableTriState ( sal_True );
- // <--
+
aFileCB.EnableTriState( sal_True );
bool bHiddenValid = true;
bool bProtectValid = true;
bool bConditionValid = true;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
bool bEditInReadonlyValid = true;
bool bEditInReadonly = true;
- // <--
+
bool bHidden = true;
bool bProtect = true;
String sCondition;
@@ -686,9 +659,9 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
sCondition = rData.GetCondition();
bHidden = rData.IsHidden();
bProtect = rData.IsProtectFlag();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
bEditInReadonly = rData.IsEditInReadonlyFlag();
- // <--
+
bFile = (rData.GetType() != CONTENT_SECTION);
aCurPasswd = rData.GetPassword();
}
@@ -699,10 +672,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
bConditionValid = sal_False;
bHiddenValid = (bHidden == rData.IsHidden());
bProtectValid = (bProtect == rData.IsProtectFlag());
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
bEditInReadonlyValid =
(bEditInReadonly == rData.IsEditInReadonlyFlag());
- // <--
+
bFileValid = (bFile ==
(rData.GetType() != CONTENT_SECTION));
bPasswdValid = (aCurPasswd == rData.GetPassword());
@@ -715,10 +688,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
bHidden ? STATE_CHECK : STATE_NOCHECK);
aProtectCB.SetState( !bProtectValid ? STATE_DONTKNOW :
bProtect ? STATE_CHECK : STATE_NOCHECK);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.SetState( !bEditInReadonlyValid ? STATE_DONTKNOW :
bEditInReadonly ? STATE_CHECK : STATE_NOCHECK);
- // <--
+
aFileCB.SetState(!bFileValid ? STATE_DONTKNOW :
bFile ? STATE_CHECK : STATE_NOCHECK);
@@ -726,7 +699,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
aConditionED.SetText(sCondition);
else
{
-// aConditionED.SetText(aEmptyStr);
aConditionFT.Enable(sal_False);
aConditionED.Enable(sal_False);
}
@@ -736,7 +708,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
aFileNameED .Enable(sal_False);
aSubRegionFT.Enable(sal_False);
aSubRegionED.Enable(sal_False);
-// aNameFT .Enable(sal_False);
aCurName .Enable(sal_False);
aOptionsPB .Enable(sal_False);
aDDECB .Enable(sal_False);
@@ -757,7 +728,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
}
else if (pEntry )
{
-// aNameFT .Enable(sal_True);
aCurName .Enable(sal_True);
aOptionsPB .Enable(sal_True);
SectRepr* pRepr=(SectRepr*) pEntry->GetUserData();
@@ -799,11 +769,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
? STATE_CHECK : STATE_NOCHECK);
aProtectCB.Enable();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.SetState((rData.IsEditInReadonlyFlag())
? STATE_CHECK : STATE_NOCHECK);
aEditInReadonlyCB.Enable();
- // <--
sal_Bool bPasswdEnabled = aProtectCB.IsChecked();
aPasswdCB.Enable(bPasswdEnabled);
@@ -812,18 +781,16 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
bDontCheckPasswd = sal_False;
return 0;
}
-/*-----------------28.06.97 09:19-------------------
---------------------------------------------------*/
IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox )
{
if( !pBox->GetSelectionCount() )
{
aHideCB .Enable(sal_False);
aProtectCB .Enable(sal_False);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.Enable(sal_False);
- // <--
+
aPasswdCB .Enable(sal_False);
aPasswdCB .Enable(sal_False);
aConditionFT .Enable(sal_False);
@@ -834,7 +801,6 @@ IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox )
aFileNameED .Enable(sal_False);
aSubRegionFT .Enable(sal_False);
aSubRegionED .Enable(sal_False);
-// aNameFT .Enable(sal_False);
aCurName .Enable(sal_False);
aDDECB .Enable(sal_False);
aDDECommandFT .Enable(sal_False);
@@ -846,19 +812,17 @@ IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox )
}
/*---------------------------------------------------------------------
- Beschreibung: Im OkHdl werden die veraenderten Einstellungen
- uebernommen und aufgehobene Bereiche geloescht
+ Description: in OkHdl the modified settings are being applied
+ and reversed regions are deleted
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG )
{
- // JP 13.03.96:
- // temp. Array weil sich waehrend des aendern eines Bereiches die
- // Position innerhalb des "Core-Arrays" verschieben kann:
- // - bei gelinkten Bereichen, wenn sie weitere SubBereiche haben oder
- // neu erhalten.
- // JP 30.05.97: StartUndo darf natuerlich auch erst nach dem Kopieren
- // der Formate erfolgen (ClearRedo!)
+ // temp. Array because during changing of a region the position
+ // inside of the "Core-Arrays" can be shifted:
+ // - at linked regions, when they have more SubRegions or get
+ // new ones.
+ // StartUndo must certainly also happen not before the formats
+ // are copied (ClearRedo!)
const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections();
SwSectionFmts aOrigArray( 0, 5 );
@@ -916,12 +880,11 @@ IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG )
if( USHRT_MAX != nNewPos )
rSh.DelSectionFmt( nNewPos );
}
-// rSh.ChgSectionPasswd(aNewPasswd);
aOrigArray.Remove( 0, aOrigArray.Count() );
- //JP 21.05.97: EndDialog muss vor Ende der EndAction gerufen werden,
- // sonst kann es ScrollFehler geben.
+ // EndDialog must be called ahead of EndAction's end,
+ // otherwise ScrollError can occur.
EndDialog(RET_OK);
rSh.EndUndo();
@@ -929,58 +892,52 @@ IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG )
return 0;
}
+
/*---------------------------------------------------------------------
- Beschreibung: Toggle protect
+ Description: Toggle protect
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox )
{
if(!CheckPasswd(pBox))
return 0;
pBox->EnableTriState( sal_False );
SvLBoxEntry* pEntry=aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
sal_Bool bCheck = STATE_CHECK == pBox->GetState();
while( pEntry )
{
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
pRepr->GetSectionData().SetProtectFlag(bCheck);
Image aImage = BuildBitmap( bCheck,
- STATE_CHECK == aHideCB.GetState(), sal_False);
- aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
- aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
- Image aHCImg = BuildBitmap( bCheck, STATE_CHECK == aHideCB.GetState(), sal_True);
- aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
+ STATE_CHECK == aHideCB.GetState());
+ aTree.SetExpandedEntryBmp( pEntry, aImage );
+ aTree.SetCollapsedEntryBmp( pEntry, aImage );
pEntry = aTree.NextSelected(pEntry);
}
aPasswdCB.Enable(bCheck);
aPasswdPB.Enable(bCheck);
return 0;
}
+
/*---------------------------------------------------------------------
- Beschreibung: Toggle hide
+ Description: Toggle hide
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox )
{
if(!CheckPasswd(pBox))
return 0;
pBox->EnableTriState( sal_False );
SvLBoxEntry* pEntry=aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
pRepr->GetSectionData().SetHidden(STATE_CHECK == pBox->GetState());
+
Image aImage = BuildBitmap(STATE_CHECK == aProtectCB.GetState(),
- STATE_CHECK == pBox->GetState(), sal_False);
- aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
- aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
- Image aHCImg = BuildBitmap( STATE_CHECK == aProtectCB.GetState(),
- STATE_CHECK == pBox->GetState(), sal_True);
- aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
- aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
+ STATE_CHECK == pBox->GetState());
+ aTree.SetExpandedEntryBmp( pEntry, aImage );
+ aTree.SetCollapsedEntryBmp( pEntry, aImage );
pEntry = aTree.NextSelected(pEntry);
}
@@ -992,16 +949,15 @@ IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox )
}
/*---------------------------------------------------------------------
- Beschreibung: Toggle edit in readonly
+ Description: Toggle edit in readonly
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox )
{
if(!CheckPasswd(pBox))
return 0;
pBox->EnableTriState( sal_False );
SvLBoxEntry* pEntry=aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
@@ -1014,9 +970,8 @@ IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox )
}
/*---------------------------------------------------------------------
- Beschreibung: selektierten Bereich aufheben
+ Description: clear selected region
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
{
if(!CheckPasswd())
@@ -1024,7 +979,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
SvLBoxEntry* pEntry = aTree.FirstSelected();
SvLBoxEntry* pChild;
SvLBoxEntry* pParent;
- //zuerst alle selektierten markieren
+ // at first mark all selected
while(pEntry)
{
const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
@@ -1032,7 +987,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
pEntry = aTree.NextSelected(pEntry);
}
pEntry = aTree.FirstSelected();
- // dann loeschen
+ // then delete
while(pEntry)
{
const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
@@ -1043,7 +998,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
aSectReprArr.Insert( pSectRepr );
while( (pChild = aTree.FirstChild(pEntry) )!= 0 )
{
- //durch das Umhaengen muss wieder am Anfang aufgesetzt werden
+ // because of the repositioning we have to start at the beginning again
bRestart = sal_True;
pParent=aTree.GetParent(pEntry);
aTree.GetModel()->Move(pChild, pParent, aTree.GetModel()->GetRelPos(pEntry));
@@ -1067,24 +1022,23 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
aProtectCB. Enable(sal_False);
aPasswdCB. Enable(sal_False);
aHideCB. Enable(sal_False);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.Enable(sal_False);
aEditInReadonlyCB.SetState(STATE_NOCHECK);
- // <--
aProtectCB. SetState(STATE_NOCHECK);
aPasswdCB. Check(sal_False);
aHideCB. SetState(STATE_NOCHECK);
aFileCB. Check(sal_False);
- //sonst liegt der Focus auf dem HelpButton
+ // otherwise the focus would be on HelpButton
aOK.GrabFocus();
UseFileHdl(&aFileCB);
}
return 0;
}
+
/*---------------------------------------------------------------------
- Beschreibung: CheckBox mit Datei verknuepfen?
+ Description: link CheckBox to file?
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
{
if(!CheckPasswd(pBox))
@@ -1132,7 +1086,6 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
{
aDDECB.Check(sal_False);
DDEHdl(&aDDECB);
-// aFileNameED.SetText(aEmptyStr);
aSubRegionED.SetText(aEmptyStr);
}
}
@@ -1153,9 +1106,8 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
}
/*---------------------------------------------------------------------
- Beschreibung: Dialog Datei einfuegen rufen
+ Description: call dialog paste file
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG )
{
if(!CheckPasswd(0))
@@ -1170,10 +1122,6 @@ IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG )
return 0;
}
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG )
{
if(!CheckPasswd())
@@ -1276,10 +1224,9 @@ IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG )
}
/*---------------------------------------------------------------------
- Beschreibung: Uebernahme des Dateinamen oder
- des verknuepften Bereichs
+ Description: Applying of the filename or the
+ linked region
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit )
{
Selection aSelect = pEdit->GetSelection();
@@ -1287,7 +1234,7 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit )
return 0;
pEdit->SetSelection(aSelect);
SvLBoxEntry* pEntry=aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
if(pEdit == &aFileNameED)
{
@@ -1328,9 +1275,6 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit )
}
return 0;
}
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
{
@@ -1382,9 +1326,6 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
}
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
{
@@ -1397,7 +1338,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
}
SvLBoxEntry* pEntry=aTree.FirstSelected();
sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
@@ -1438,18 +1379,18 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
}
return 0;
}
+
/*---------------------------------------------------------------------
- Beschreibung: Aktueller Bereichsname wird sofort beim editieren
- in die TreeListBox eingetragen, mit leerem String
- kein Ok()
+ Description: the current region name is being added to the
+ TreeListBox immediately during editing, with empty
+ string no Ok()
---------------------------------------------------------------------*/
-
IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG )
{
if(!CheckPasswd(0))
return 0;
SvLBoxEntry* pEntry=aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
if (pEntry)
{
String aName = aCurName.GetText();
@@ -1461,9 +1402,6 @@ IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG )
}
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit )
{
@@ -1472,7 +1410,7 @@ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit )
return 0;
pEdit->SetSelection(aSelect);
SvLBoxEntry* pEntry = aTree.FirstSelected();
- DBG_ASSERT(pEntry,"kein Entry gefunden");
+ OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
@@ -1501,7 +1439,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg )
}
SvLBoxEntry* pEntry = aTree.FirstSelected();
- DBG_ASSERT( pEntry, "no entry found" );
+ OSL_ENSURE( pEntry, "no entry found" );
if ( pEntry )
{
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
@@ -1514,9 +1452,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg )
Application::SetDefDialogParent( m_pOldDefDlgParent );
return 0;
}
-/*-- 03.09.2009 16:24:18---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent )
{
if( !bSubRegionsFilled && pEvent && pEvent->GetId() == VCLEVENT_DROPDOWN_PRE_OPEN )
@@ -1545,19 +1481,15 @@ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent )
return 0;
}
-/* -----------------------------08.05.2002 15:00------------------------------
-
- ---------------------------------------------------------------------------*/
-Image SwEditRegionDlg::BuildBitmap(sal_Bool bProtect,sal_Bool bHidden, sal_Bool bHighContrast)
+Image SwEditRegionDlg::BuildBitmap( sal_Bool bProtect, sal_Bool bHidden )
{
- ImageList& rImgLst = bHighContrast ? aImageILH : aImageIL;
+ ImageList& rImgLst = aImageIL;
return rImgLst.GetImage((!bHidden+(bProtect<<1)) + 1);
}
/*--------------------------------------------------------------------
- Beschreibung: Hilfsfunktion - Bereichsnamen aus dem Medium lesen
+ Description: helper function - read region names from medium
--------------------------------------------------------------------*/
-
static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
{
rBox.Clear();
@@ -1576,9 +1508,7 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
aArr.DeleteAndDestroy(0, aArr.Count());
}
}
-/* -----------------21.05.99 10:16-------------------
- *
- * --------------------------------------------------*/
+
SwInsertSectionTabDialog::SwInsertSectionTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) :
SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ),
@@ -1589,15 +1519,15 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
GetOKButton().SetText(sInsert);
FreeResource();
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0);
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0);
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
@@ -1609,15 +1539,11 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
}
SetCurPageId(TP_INSERT_SECTION);
}
-/* -----------------21.05.99 10:17-------------------
- *
- * --------------------------------------------------*/
+
SwInsertSectionTabDialog::~SwInsertSectionTabDialog()
{
}
-/* -----------------21.05.99 10:23-------------------
- *
- * --------------------------------------------------*/
+
void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if(TP_INSERT_SECTION == nId)
@@ -1638,21 +1564,16 @@ void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
else if(TP_SECTION_INDENTS == nId)
((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh);
}
-/* -----------------21.05.99 13:08-------------------
- *
- * --------------------------------------------------*/
void SwInsertSectionTabDialog::SetSectionData(SwSectionData const& rSect)
{
m_pSectionData.reset( new SwSectionData(rSect) );
}
-/* -----------------21.05.99 13:10-------------------
- *
- * --------------------------------------------------*/
+
short SwInsertSectionTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
- DBG_ASSERT(m_pSectionData.get(),
+ OSL_ENSURE(m_pSectionData.get(),
"SwInsertSectionTabDialog: no SectionData?");
const SfxItemSet* pOutputItemSet = GetOutputItemSet();
rWrtSh.InsertSection(*m_pSectionData, pOutputItemSet);
@@ -1676,10 +1597,9 @@ short SwInsertSectionTabDialog::Ok()
m_pSectionData->IsHidden()));
aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_PROTECT,
m_pSectionData->IsProtectFlag()));
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_EDIT_IN_READONLY,
m_pSectionData->IsEditInReadonlyFlag()));
- // <--
String sLinkFileName( m_pSectionData->GetLinkFileName() );
aRequest.AppendItem(SfxStringItem( FN_PARAM_1, sLinkFileName.GetToken( 0, sfx2::cTokenSeperator )));
@@ -1690,9 +1610,6 @@ short SwInsertSectionTabDialog::Ok()
return nRet;
}
-/* -----------------21.05.99 10:31-------------------
- *
- * --------------------------------------------------*/
SwInsertSectionTabPage::SwInsertSectionTabPage(
Window *pParent, const SfxItemSet &rAttrSet) :
SfxTabPage( pParent, SW_RES(TP_INSERT_SECTION), rAttrSet ),
@@ -1717,10 +1634,9 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
aHideCB ( this, SW_RES( CB_HIDE ) ),
aConditionFT ( this, SW_RES( FT_CONDITION ) ),
aConditionED ( this, SW_RES( ED_CONDITION ) ),
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ),
aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ),
- // <--
m_pWrtSh(0),
m_pDocInserter(NULL),
@@ -1732,9 +1648,8 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
aPasswdCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
aPasswdPB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
aHideCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeHideHdl));
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aEditInReadonlyCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeEditInReadonlyHdl));
- // <--
aFileCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, UseFileHdl ));
aFilePB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, FileSearchHdl ));
aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl));
@@ -1743,9 +1658,7 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
aSubRegionED.EnableAutocomplete( sal_True, sal_True );
}
-/* -----------------21.05.99 10:31-------------------
- *
- * --------------------------------------------------*/
+
SwInsertSectionTabPage::~SwInsertSectionTabPage()
{
delete m_pDocInserter;
@@ -1786,9 +1699,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh)
aCurName.SetText( rSh.GetUniqueSectionName() );
}
}
-/* -----------------21.05.99 10:32-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& )
{
SwSectionData aSection(CONTENT_SECTION, aCurName.GetText());
@@ -1796,9 +1707,9 @@ sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& )
sal_Bool bProtected = aProtectCB.IsChecked();
aSection.SetProtectFlag(bProtected);
aSection.SetHidden(aHideCB.IsChecked());
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aSection.SetEditInReadonlyFlag(aEditInReadonlyCB.IsChecked());
- // <--
+
if(bProtected)
{
aSection.SetPassword(m_aNewPasswd);
@@ -1850,23 +1761,16 @@ sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& )
((SwInsertSectionTabDialog*)GetTabDialog())->SetSectionData(aSection);
return sal_True;
}
-/* -----------------21.05.99 10:32-------------------
- *
- * --------------------------------------------------*/
+
void SwInsertSectionTabPage::Reset( const SfxItemSet& )
{
}
-/* -----------------21.05.99 11:22-------------------
- *
- * --------------------------------------------------*/
+
SfxTabPage* SwInsertSectionTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwInsertSectionTabPage(pParent, rAttrSet);
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox )
{
@@ -1875,17 +1779,11 @@ IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox )
aConditionFT.Enable(bHide);
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK( SwInsertSectionTabPage, ChangeEditInReadonlyHdl, CheckBox *, EMPTYARG )
{
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox )
{
@@ -1894,9 +1792,7 @@ IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox )
aPasswdPB.Enable(bCheck);
return 0;
}
-/* -----------------------------26.04.01 14:50--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton )
{
sal_Bool bChange = pButton == &aPasswdPB;
@@ -1927,9 +1823,6 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton )
m_aNewPasswd.realloc(0);
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG )
{
@@ -1939,10 +1832,6 @@ IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG )
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
-
IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox )
{
if( pBox->IsChecked() )
@@ -1962,7 +1851,6 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox )
aDDECB.Enable(bFile);
if( bFile )
{
-// aFileNameED.SetText( aFileName );
aFileNameED.GrabFocus();
aProtectCB.Check( sal_True );
}
@@ -1970,15 +1858,10 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox )
{
aDDECB.Check(sal_False);
DDEHdl(&aDDECB);
-// aFileNameED.SetText(aEmptyStr);
}
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
-
IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG )
{
m_pOldDefDlgParent = Application::GetDefDialogParent();
@@ -1990,10 +1873,6 @@ IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG )
return 0;
}
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
-
IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
{
sal_Bool bDDE = pBox->IsChecked();
@@ -2048,8 +1927,8 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil
// --------------------------------------------------------------
-// Numerierungsformat Umsetzung:
-// ListBox - Format - Enum-Wert
+// numbering format conversion:
+// ListBox - format - enum-value
// 0 - A, B, C, ... - 0
// 1 - a, b, c, ... - 1
// 2 - I, II, III, ... - 2
@@ -2204,7 +2083,6 @@ void SwSectionFtnEndTabPage::ResetState( sal_Bool bFtn,
sal_uInt16 eState = rAttr.GetValue();
switch( eState )
{
- // case FTNEND_ATPGORDOCEND:
case FTNEND_ATTXTEND_OWNNUMANDFMT:
pNtNumFmtCB->SetState( STATE_CHECK );
// no break;
@@ -2261,7 +2139,6 @@ SfxTabPage* SwSectionFtnEndTabPage::Create( Window* pParent,
IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox )
{
-// pBox->EnableTriState( sal_False );
sal_Bool bFoot = &aFtnNtAtTextEndCB == pBox || &aFtnNtNumCB == pBox ||
&aFtnNtNumFmtCB == pBox ;
@@ -2316,9 +2193,6 @@ IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox )
return 0;
}
-/* -----------------21.05.99 13:59-------------------
- *
- * --------------------------------------------------*/
SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) :
SfxTabDialog(pParent, SW_RES(DLG_SECTION_PROPERTIES), &rSet),
@@ -2326,14 +2200,14 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
{
FreeResource();
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
{
@@ -2343,15 +2217,11 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
RemoveTabPage(TP_COLUMN);
}
}
-/* -----------------21.05.99 13:59-------------------
- *
- * --------------------------------------------------*/
+
SwSectionPropertyTabDialog::~SwSectionPropertyTabDialog()
{
}
-/* -----------------21.05.99 13:59-------------------
- *
- * --------------------------------------------------*/
+
void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if( TP_BACKGROUND == nId )
@@ -2368,9 +2238,7 @@ void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage
else if(TP_SECTION_INDENTS == nId)
((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh);
}
-/*-- 13.06.2003 09:59:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet ) :
SfxTabPage(pParent, SW_RES(TP_SECTION_INDENTS), rAttrSet),
aIndentFL(this, SW_RES(FL_INDENT )),
@@ -2386,15 +2254,11 @@ SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSe
aAfterMF.SetModifyHdl(aLk);
aPreviewWin.SetAccessibleName(aIndentFL.GetText());
}
-/*-- 13.06.2003 09:59:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwSectionIndentTabPage::~SwSectionIndentTabPage()
{
}
-/*-- 13.06.2003 09:59:23---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwSectionIndentTabPage::FillItemSet( SfxItemSet& rSet)
{
if(aBeforeMF.IsValueModified() ||
@@ -2407,9 +2271,7 @@ sal_Bool SwSectionIndentTabPage::FillItemSet( SfxItemSet& rSet)
}
return sal_True;
}
-/*-- 13.06.2003 09:59:24---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSectionIndentTabPage::Reset( const SfxItemSet& rSet)
{
//this page doesn't show up in HTML mode
@@ -2435,16 +2297,12 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet& rSet)
aAfterMF.SaveValue();
IndentModifyHdl(0);
}
-/*-- 13.06.2003 09:59:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwSectionIndentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet)
{
return new SwSectionIndentTabPage(pParent, rAttrSet);
}
-/* -----------------13.06.2003 13:57-----------------
- --------------------------------------------------*/
void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh)
{
//set sensible values at the preview
@@ -2454,9 +2312,7 @@ void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh)
Size aPageSize(rPageRect.Width(), rPageRect.Height());
aPreviewWin.SetSize(aPageSize);
}
-/* -----------------13.06.2003 14:02-----------------
- --------------------------------------------------*/
IMPL_LINK(SwSectionIndentTabPage, IndentModifyHdl, MetricField*, EMPTYARG)
{
aPreviewWin.SetLeftMargin( static_cast< long >(aBeforeMF.Denormalize(aBeforeMF.GetValue(FUNIT_TWIP))) );
@@ -2465,3 +2321,4 @@ IMPL_LINK(SwSectionIndentTabPage, IndentModifyHdl, MetricField*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index 4af058eeae1f..4a98a4e19294 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,9 +48,6 @@
#include <helpid.h>
#endif /* ENABLE_LAYOUT */
-/*-- 06.04.2004 16:05:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwWordCountDialog::SwWordCountDialog(Window* pParent) :
SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)),
#if defined _MSC_VER
@@ -60,12 +58,16 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) :
aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )),
aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )),
aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )),
+ aCurrentCharacterExcludingSpacesFT( this, SW_RES( FT_CURRENTCHARACTEREXCLUDINGSPACES )),
+ aCurrentCharacterExcludingSpacesFI( this, SW_RES( FI_CURRENTCHARACTEREXCLUDINGSPACES )),
aDocFL( this, SW_RES( FL_DOC )),
aDocWordFT( this, SW_RES( FT_DOCWORD )),
aDocWordFI( this, SW_RES( FI_DOCWORD )),
aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )),
aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )),
+ aDocCharacterExcludingSpacesFT( this, SW_RES( FT_DOCCHARACTEREXCLUDINGSPACES )),
+ aDocCharacterExcludingSpacesFI( this, SW_RES( FI_DOCCHARACTEREXCLUDINGSPACES )),
aBottomFL(this, SW_RES( FL_BOTTOM )),
aOK( this, SW_RES( PB_OK )),
aHelp( this, SW_RES( PB_HELP ))
@@ -78,22 +80,19 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) :
#endif /* ENABLE_LAYOUT */
FreeResource();
}
-/*-- 06.04.2004 16:05:56---------------------------------------------------
- -----------------------------------------------------------------------*/
SwWordCountDialog::~SwWordCountDialog()
{
}
-/*-- 06.04.2004 16:05:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
{
aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord ));
aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
+ aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces ));
aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord ));
aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar ));
+ aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces ));
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc
index 00749412ac97..af6f3a79c76c 100644
--- a/sw/source/ui/dialog/wordcountdialog.hrc
+++ b/sw/source/ui/dialog/wordcountdialog.hrc
@@ -26,18 +26,22 @@
************************************************************************/
#ifndef SW_WORDCOUNTDIALOG_HRC
#define SW_WORDCOUNTDIALOG_HRC
-#define FL_CURRENT 1
-#define FT_CURRENTWORD 2
-#define FI_CURRENTWORD 3
-#define FT_CURRENTCHARACTER 4
-#define FI_CURRENTCHARACTER 5
-#define FL_DOC 6
-#define FT_DOCWORD 7
-#define FI_DOCWORD 8
-#define FT_DOCCHARACTER 9
-#define FI_DOCCHARACTER 10
-#define FL_BOTTOM 11
-#define PB_OK 12
-#define PB_HELP 13
+#define FL_CURRENT 1
+#define FT_CURRENTWORD 2
+#define FI_CURRENTWORD 3
+#define FT_CURRENTCHARACTER 4
+#define FI_CURRENTCHARACTER 5
+#define FT_CURRENTCHARACTEREXCLUDINGSPACES 6
+#define FI_CURRENTCHARACTEREXCLUDINGSPACES 7
+#define FL_DOC 8
+#define FT_DOCWORD 9
+#define FI_DOCWORD 10
+#define FT_DOCCHARACTER 11
+#define FI_DOCCHARACTER 12
+#define FT_DOCCHARACTEREXCLUDINGSPACES 13
+#define FI_DOCCHARACTEREXCLUDINGSPACES 14
+#define FL_BOTTOM 15
+#define PB_OK 16
+#define PB_HELP 17
#endif
diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src
index 454a6c050b34..767913a0e5c9 100644
--- a/sw/source/ui/dialog/wordcountdialog.src
+++ b/sw/source/ui/dialog/wordcountdialog.src
@@ -32,7 +32,7 @@ ModalDialog DLG_WORDCOUNT
HelpID = HID_DLG_WORDCOUNT ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 170 , 108 ) ;
+ Size = MAP_APPFONT ( 170 , 132 ) ;
Text [ en-US ] = "Word Count" ;
Moveable = TRUE ;
@@ -66,50 +66,74 @@ ModalDialog DLG_WORDCOUNT
Size = MAP_APPFONT ( 50 , 8 ) ;
Right = TRUE;
};
+ FixedText FT_CURRENTCHARACTEREXCLUDINGSPACES
+ {
+ Pos = MAP_APPFONT ( 12 , 38 ) ;
+ Size = MAP_APPFONT ( 98 , 8 ) ;
+ Text [ en-US ] = "Characters excluding spaces:";
+ };
+ FixedText FI_CURRENTCHARACTEREXCLUDINGSPACES
+ {
+ Pos = MAP_APPFONT ( 111 , 38 ) ;
+ Size = MAP_APPFONT ( 50 , 8 ) ;
+ Right = TRUE;
+ };
FixedLine FL_DOC
{
- Pos = MAP_APPFONT ( 6, 40 ) ;
+ Pos = MAP_APPFONT ( 6, 52 ) ;
Size = MAP_APPFONT ( 158 , 8 ) ;
Text [ en-US ] = "Whole document";
};
FixedText FT_DOCWORD
{
- Pos = MAP_APPFONT ( 12, 51 ) ;
+ Pos = MAP_APPFONT ( 12, 63 ) ;
Size = MAP_APPFONT ( 80 , 8 ) ;
Text [ en-US ] = "Words:";
};
FixedText FI_DOCWORD
{
- Pos = MAP_APPFONT ( 111 , 51 ) ;
+ Pos = MAP_APPFONT ( 111 , 63 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Right = TRUE;
};
FixedText FT_DOCCHARACTER
{
- Pos = MAP_APPFONT ( 12 , 63 ) ;
+ Pos = MAP_APPFONT ( 12 , 75 ) ;
Size = MAP_APPFONT ( 80 , 8 ) ;
Text [ en-US ] = "Characters:";
};
FixedText FI_DOCCHARACTER
{
- Pos = MAP_APPFONT ( 111, 63 ) ;
+ Pos = MAP_APPFONT ( 111, 75 ) ;
+ Size = MAP_APPFONT ( 50, 8 ) ;
+ Right = TRUE;
+ };
+ FixedText FT_DOCCHARACTEREXCLUDINGSPACES
+ {
+ Pos = MAP_APPFONT ( 12 , 87 ) ;
+ Size = MAP_APPFONT ( 98 , 8 ) ;
+ Text [ en-US ] = "Characters excluding spaces:";
+ };
+ FixedText FI_DOCCHARACTEREXCLUDINGSPACES
+ {
+ Pos = MAP_APPFONT ( 111, 87 ) ;
Size = MAP_APPFONT ( 50, 8 ) ;
Right = TRUE;
};
FixedLine FL_BOTTOM
{
- Pos = MAP_APPFONT ( 6 , 77 ) ;
+ Pos = MAP_APPFONT ( 6 , 101 ) ;
Size = MAP_APPFONT ( 158 , 8 ) ;
};
OKButton PB_OK
{
- Pos = MAP_APPFONT ( 61 , 88 ) ;
+ Pos = MAP_APPFONT ( 61 , 112 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
HelpButton PB_HELP
{
- Pos = MAP_APPFONT ( 114 , 88 ) ;
+ Pos = MAP_APPFONT ( 114 , 112 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index 96ad51872363..4adc1f59896e 100755..100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,12 +36,7 @@
#ifndef __RSC //autogen
#include <tools/errinf.hxx>
#endif
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
#include <svl/macitem.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/docfile.hxx>
@@ -52,32 +48,24 @@
#include <fmtcol.hxx>
#include <docary.hxx>
#include <wrtsh.hxx>
-#include <uitool.hxx> // Fehlermeldungen
+#include <uitool.hxx> // error messages
#include <view.hxx>
#include <swevent.hxx>
#include <gloshdl.hxx>
#include <glosdoc.hxx>
#include <shellio.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <expfld.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
+#include <initui.hxx> // for ::GetGlossaries()
#include <gloslst.hxx>
#include <swdtflvr.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <crsskip.hxx>
-#ifndef _DOCHDL_HRC
#include <dochdl.hrc>
-#endif
-#ifndef _SWERROR_H
#include <swerror.h>
-#endif
#include <frmmgr.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <editeng/acorrcfg.hxx>
#include "swabstdlg.hxx"
@@ -90,7 +78,7 @@ using namespace ::com::sun::star;
const short RET_EDIT = 100;
-// PUBLIC METHODES -------------------------------------------------------
+// PUBLIC METHODS -------------------------------------------------------
struct TextBlockInfo_Impl
{
String sTitle;
@@ -101,18 +89,17 @@ typedef TextBlockInfo_Impl* TextBlockInfo_ImplPtr;
SV_DECL_PTRARR_DEL( TextBlockInfoArr, TextBlockInfo_ImplPtr, 0, 4 )
SV_IMPL_PTRARR( TextBlockInfoArr, TextBlockInfo_ImplPtr )
SV_IMPL_REF( SwDocShell )
+
/*------------------------------------------------------------------------
- Beschreibung: Dialog fuer Bearbeiten Vorlagen
+ Description: Dialog for edit templates
------------------------------------------------------------------------*/
-
-
void SwGlossaryHdl::GlossaryDlg()
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractGlossaryDlg* pDlg = pFact->CreateGlossaryDlg( DLG_RENAME_GLOS,
pViewFrame, this, pWrtShell);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
String sName, sShortName;
if( RET_EDIT == pDlg->Execute() )
@@ -133,12 +120,9 @@ void SwGlossaryHdl::GlossaryDlg()
}
/*------------------------------------------------------------------------
- Beschreibung: Setzen der aktuellen Gruppe; falls aus dem Dialog
- gerufen, wird die Gruppe temp. erzeugt fuer einen
- schnelleren Zugriff
+ Description: set the default group; if called from the dialog
+ the group is created temporarily for faster access
------------------------------------------------------------------------*/
-
-
void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlwaysCreateNew )
{
String sGroup(rGrp);
@@ -172,12 +156,9 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw
sGroup.GetToken(0, GLOS_DELIM) == sCurBase)
bPathEqual = sal_True;
}
-// const String aMac_Tmp(pCurGrp->GetName());
- // Beim Pfadwechsel kann man sich auf den Namen nicht verlassen
- if(!bAlwaysCreateNew &&
- bPathEqual
-// aMac_Tmp == sGroup
- )
+
+ // When path changed, the name is not reliable
+ if(!bAlwaysCreateNew && bPathEqual)
return;
}
aCurGrp = sGroup;
@@ -192,21 +173,11 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
sal_uInt16 SwGlossaryHdl::GetGroupCnt() const
{
return rStatGlossaries.GetGroupCnt();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle )
{
String sRet = rStatGlossaries.GetGroupName(nId);
@@ -228,10 +199,6 @@ String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle )
}
return sRet;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle)
{
@@ -239,9 +206,7 @@ sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle)
FindGroupName(rGrpName);
return rStatGlossaries.NewGroupDoc(rGrpName, rTitle);
}
-/* -----------------23.11.98 13:10-------------------
- * Umbenennen eines Textbausteins
- * --------------------------------------------------*/
+
sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String& rNewTitle)
{
sal_Bool bRet = sal_False;
@@ -271,9 +236,7 @@ sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const Str
}
return bRet;
}
-/* -----------------27.11.98 13:49-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
const String& rDestGroupName, const String& rLongName, sal_Bool bMove )
{
@@ -282,18 +245,14 @@ sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSo
SwTextBlocks* pDestGroup = rStatGlossaries.GetGroupDoc(rDestGroupName, sal_False);
if(pDestGroup->IsReadOnly() || (bMove && pSourceGroup->IsReadOnly()) )
return sal_False;
- /*if(pDestGroup->IsOld()&& 0!= pDestGroup->ConvertToNew())
- return sal_False;
- if(bMove && pSourceGroup->IsOld() && 0 != pSourceGroup->ConvertToNew())
- return sal_False;*/
- //Der Index muss hier ermittelt werden, weil rSourceShortName in CopyBlock evtl veraendert wird
+ //The index must be determined here because rSourceShortName maybe changed in CopyBlock
sal_uInt16 nDeleteIdx = pSourceGroup->GetIndex( rSourceShortName );
- DBG_ASSERT(USHRT_MAX != nDeleteIdx, "Eintrag nicht gefunden");
+ OSL_ENSURE(USHRT_MAX != nDeleteIdx, "entry not found");
sal_uLong nRet = pSourceGroup->CopyBlock( *pDestGroup, rSourceShortName, rLongName );
if(!nRet && bMove)
{
- // der Index muss existieren
+ // the index must be existing
nRet = pSourceGroup->Delete( nDeleteIdx ) ? 0 : 1;
}
rStatGlossaries.PutGroupDoc( pSourceGroup );
@@ -302,10 +261,8 @@ sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSo
}
/*------------------------------------------------------------------------
- Beschreibung: Loeschen einer Textbausteindatei-Gruppe
+ Description: delete a autotext-file-group
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName)
{
String sGroup(rGrpName);
@@ -325,40 +282,28 @@ sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName)
}
/*------------------------------------------------------------------------
- Beschreibung: Anzahl Textbausteine erfragen
+ Description: ask for number of autotexts
------------------------------------------------------------------------*/
-
-
sal_uInt16 SwGlossaryHdl::GetGlossaryCnt()
{
return pCurGrp ? pCurGrp->GetCount() : 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
String SwGlossaryHdl::GetGlossaryName( sal_uInt16 nId )
{
- ASSERT(nId < GetGlossaryCnt(), Textbausteinarray ueberindiziert.);
+ OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert.");
return pCurGrp->GetLongName( nId );
}
-/* -----------------30.11.98 13:18-------------------
- *
- * --------------------------------------------------*/
+
String SwGlossaryHdl::GetGlossaryShortName(sal_uInt16 nId)
{
- ASSERT(nId < GetGlossaryCnt(), Textbausteinarray ueberindiziert.);
+ OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert.");
return pCurGrp->GetShortName( nId );
}
-
/*------------------------------------------------------------------------
- Beschreibung: Kurzname erfragen
+ Description: ask for short name
------------------------------------------------------------------------*/
-
-
String SwGlossaryHdl::GetGlossaryShortName(const String &rName)
{
String sReturn;
@@ -376,10 +321,8 @@ String SwGlossaryHdl::GetGlossaryShortName(const String &rName)
}
/*------------------------------------------------------------------------
- Beschreibung: Kuerzel fuer Textbaustein bereits verwendet?
+ Description: short name for autotext already used?
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::HasShortName(const String& rShortName) const
{
SwTextBlocks *pBlock = pCurGrp ? pCurGrp
@@ -390,32 +333,14 @@ sal_Bool SwGlossaryHdl::HasShortName(const String& rShortName) const
return bRet;
}
-/* -----------------------------20.03.01 10:52--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool SwGlossaryHdl::ConvertToNew(SwTextBlocks& /*rOld*/)
{
- /*if( rOld.IsOld() )
- {
- QueryBox aAsk( pWrtShell->GetView().GetWindow(), SW_RES( MSG_UPDATE_NEW_GLOS_FMT ) );
- if( aAsk.Execute() == RET_YES )
- {
- if( rOld.ConvertToNew() )
- {
- InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute();
- return sal_False;
- }
- }
- else
- return sal_False;
- }*/
return sal_True;
}
/*------------------------------------------------------------------------
- Beschreibung: Erzeugen eines Textbausteines
+ Desription: Create autotext
------------------------------------------------------------------------*/
-
sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortName,
sal_Bool bCreateGroup, sal_Bool bNoAttr)
{
@@ -436,10 +361,10 @@ sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortNam
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
const sal_uInt16 nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName,
- pCfg->IsSaveRelFile(), pOnlyTxt );
+ rCfg.IsSaveRelFile(), pOnlyTxt );
if(nSuccess == (sal_uInt16) -1 )
{
InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute();
@@ -449,10 +374,8 @@ sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortNam
return sal_Bool( nSuccess != (sal_uInt16) -1 );
}
/*------------------------------------------------------------------------
- Beschreibung: Loeschen eines Textbausteines
+ Description: Delete a autotext
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::DelGlossary(const String &rShortName)
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
@@ -470,18 +393,16 @@ sal_Bool SwGlossaryHdl::DelGlossary(const String &rShortName)
}
/*------------------------------------------------------------------------
- Beschreibung: Kurzform expandieren
+ Description: expand short name
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::ExpandGlossary()
{
- ASSERT(pWrtShell->CanInsert(), illegal);
+ OSL_ENSURE(pWrtShell->CanInsert(), "illegal");
SwTextBlocks *pGlossary;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc( DLG_RENAME_GLOS );
- DBG_ASSERT(fnGetCurrGroup, "Dialogdiet fail!");
+ OSL_ENSURE(fnGetCurrGroup, "Dialogdiet fail!");
String sGroupName( (*fnGetCurrGroup)() );
if(STRING_NOTFOUND == sGroupName.Search(GLOS_DELIM))
FindGroupName(sGroupName);
@@ -489,7 +410,7 @@ sal_Bool SwGlossaryHdl::ExpandGlossary()
String aShortName;
- // bei Textselektion diese verwenden
+ // use this at text selection
if(pWrtShell->SwCrsrShell::HasSelection() && !pWrtShell->IsBlockMode())
{
aShortName = pWrtShell->GetSelTxt();
@@ -502,9 +423,9 @@ sal_Bool SwGlossaryHdl::ExpandGlossary()
pWrtShell->LeaveBlockMode();
else if(pWrtShell->IsExtMode())
pWrtShell->LeaveExtMode();
- // Wort selektieren
+ // select word
pWrtShell->SelNearestWrd();
- // Wort erfragen
+ // ask for word
if(pWrtShell->IsSelection())
aShortName = pWrtShell->GetSelTxt();
}
@@ -519,9 +440,9 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
String aShortName( rShortName );
sal_Bool bCancel = sal_False;
// search for text block
- //#b6633427# - don't prefer current group depending on configuration setting
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- sal_uInt16 nFound = !pCfg->IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
+ // - don't prefer current group depending on configuration setting
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
// if not found then search in all groups
if( nFound == (sal_uInt16) -1 )
{
@@ -530,7 +451,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
sal_uInt16 nGroupCount = pGlossaryList->GetGroupCount();
for(sal_uInt16 i = 1; i <= nGroupCount; i++)
{
- // Gruppenname mit Pfad-Extension besorgen
+ // get group name with path-extension
String sTitle;
String sGroupName = pGlossaryList->GetGroupName(i - 1, sal_False, &sTitle);
if(sGroupName == pGlossary->GetName())
@@ -553,7 +474,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
}
}
}
- if( aFoundArr.Count() ) // einer wurde gefunden
+ if( aFoundArr.Count() ) // one was found
{
pGlossaries->PutGroupDoc(pGlossary);
if(1 == aFoundArr.Count())
@@ -565,10 +486,10 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- AbstarctSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS );
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
for(sal_uInt16 i = 0; i < aFoundArr.Count(); ++i)
{
TextBlockInfo_Impl* pData = aFoundArr.GetObject(i);
@@ -594,7 +515,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
}
}
- // nicht gefunden
+ // not found
if( nFound == (sal_uInt16) -1 )
{
if( !bCancel )
@@ -621,10 +542,10 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC);
GetMacros( aShortName, aStartMacro, aEndMacro, pGlossary );
- // StartAction darf nich vor HasSelection und DelRight stehen,
- // sonst wird der moeglich Shellwechsel verzoegert und
- // API-Programme wuerden dann haengenbleiben
- // ausserdem darf das Ereignismacro ebenfalls nicht in einer Action gerufen werden
+ // StartAction must not be before HasSelection and DelRight,
+ // otherwise the possible Shell change gets delayed and
+ // API-programs would hang.
+ // Moreover the event macro must also not be called in an action
pWrtShell->StartUndo(UNDO_INSGLOSSARY);
if( aStartMacro.GetMacName().Len() )
pWrtShell->ExecMacro( aStartMacro );
@@ -632,7 +553,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
pWrtShell->DelLeft();
pWrtShell->StartAllAction();
- // alle InputFelder zwischenspeichern
+ // cache all InputFields
SwInputFieldList aFldLst( pWrtShell, sal_True );
pWrtShell->InsertGlossary(*pGlossary, aShortName);
@@ -643,7 +564,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
}
pWrtShell->EndUndo(UNDO_INSGLOSSARY);
- // fuer alle neuen InputFelder die Eingaben abfordern
+ // demand input for all new InputFields
if( aFldLst.BuildSortLst() )
pWrtShell->UpdateInputFlds( &aFldLst );
}
@@ -652,13 +573,11 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
}
/*------------------------------------------------------------------------
- Beschreibung: Textbaustein einfuegen
+ Description: add autotext
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName)
{
- ASSERT(pWrtShell->CanInsert(), illegal);
+ OSL_ENSURE(pWrtShell->CanInsert(), "illegal");
SwTextBlocks *pGlos =
pCurGrp? pCurGrp: rStatGlossaries.GetGroupDoc(aCurGrp);
@@ -670,17 +589,17 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName)
SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC);
GetMacros( rName, aStartMacro, aEndMacro, pGlos );
- // StartAction darf nich vor HasSelection und DelRight stehen,
- // sonst wird der moeglich Shellwechsel verzoegert und
- // API-Programme wuerden dann haengenbleiben
- // ausserdem darf das Ereignismacro ebenfalls nicht in einer Action gerufen werden
+ // StartAction must not be before HasSelection and DelRight,
+ // otherwise the possible Shell change gets delayed and
+ // API-programs would hang.
+ // Moreover the event macro must also not be called in an action
if( aStartMacro.GetMacName().Len() )
pWrtShell->ExecMacro( aStartMacro );
if( pWrtShell->HasSelection() )
pWrtShell->DelRight();
pWrtShell->StartAllAction();
- // alle InputFelder zwischenspeichern
+ // cache all InputFields
SwInputFieldList aFldLst( pWrtShell, sal_True );
pWrtShell->InsertGlossary(*pGlos, rName);
@@ -690,7 +609,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName)
pWrtShell->ExecMacro( aEndMacro );
}
- // fuer alle neuen InputFelder die Eingaben abfordern
+ // demand input for all new InputFields
if( aFldLst.BuildSortLst() )
pWrtShell->UpdateInputFlds( &aFldLst );
@@ -700,10 +619,8 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName)
}
/*------------------------------------------------------------------------
- Beschreibung: Macro setzen / erfragen
+ Description: set / ask for macro
------------------------------------------------------------------------*/
-
-
void SwGlossaryHdl::SetMacros(const String& rShortName,
const SvxMacro* pStart,
const SvxMacro* pEnd,
@@ -755,10 +672,8 @@ void SwGlossaryHdl::GetMacros( const String &rShortName,
/*------------------------------------------------------------------------
- Beschreibung: ctor, dtor
+ Description: ctor, dtor
------------------------------------------------------------------------*/
-
-
SwGlossaryHdl::SwGlossaryHdl(SfxViewFrame* pVwFrm, SwWrtShell *pSh)
: rStatGlossaries( *::GetGlossaries() ),
aCurGrp( rStatGlossaries.GetDefName() ),
@@ -768,7 +683,6 @@ SwGlossaryHdl::SwGlossaryHdl(SfxViewFrame* pVwFrm, SwWrtShell *pSh)
{
}
-
SwGlossaryHdl::~SwGlossaryHdl()
{
if( pCurGrp )
@@ -776,10 +690,8 @@ SwGlossaryHdl::~SwGlossaryHdl()
}
/*------------------------------------------------------------------------
- Beschreibung: Umbenennen eines Textbausteines
+ Description: rename an autotext
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortName,
const String& rNewName )
{
@@ -839,17 +751,14 @@ sal_Bool SwGlossaryHdl::IsOld() const
return bRet;
}
-/*-----------------09.06.97 16:15-------------------
- Gruppe ohne Pfadindex finden
+/*--------------------------------------------------
+ find group without path index
--------------------------------------------------*/
sal_Bool SwGlossaryHdl::FindGroupName(String & rGroup)
{
return rStatGlossaries.FindGroupName(rGroup);
}
-/* -----------------29.07.99 08:34-------------------
-
- --------------------------------------------------*/
sal_Bool SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName)
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
@@ -885,9 +794,9 @@ sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName )
SwReader aReader( *pMed, rName );
if( aReader.HasGlossaries( *pR ) )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
bRet = aReader.ReadGlossaries( *pR, *pGlossary,
- pCfg->IsSaveRelFile() );
+ rCfg.IsSaveRelFile() );
}
}
}
@@ -896,3 +805,4 @@ sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName )
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dochdl/selglos.cxx b/sw/source/ui/dochdl/selglos.cxx
index 79c18bb96e54..981ff2b9f2d7 100644
--- a/sw/source/ui/dochdl/selglos.cxx
+++ b/sw/source/ui/dochdl/selglos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,15 +64,15 @@ SwSelGlossaryDlg::SwSelGlossaryDlg(Window * pParent, const String &rShortName)
aGlosBox.SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl));
}
-/*-----------------25.02.94 20:50-------------------
- dtor ueberladen
+/*--------------------------------------------------
+ overload dtor
--------------------------------------------------*/
SwSelGlossaryDlg::~SwSelGlossaryDlg() {}
-/* -----------------25.10.99 08:33-------------------
- --------------------------------------------------*/
IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/)
{
EndDialog(RET_OK);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dochdl/selglos.src b/sw/source/ui/dochdl/selglos.src
index d48e61aea37b..960c7855d41c 100644
--- a/sw/source/ui/dochdl/selglos.src
+++ b/sw/source/ui/dochdl/selglos.src
@@ -37,7 +37,6 @@ ModalDialog DLG_SEL_GLOS
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 100 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? AutoText einfügen : AutoText einf³gen */
Text [ en-US ] = "Insert AutoText" ;
Moveable = TRUE ;
OKButton BT_OK
@@ -63,7 +62,6 @@ ModalDialog DLG_SEL_GLOS
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 152 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? AutoTexte zum Kürzel : AutoTexte zum K³rzel */
Text [ en-US ] = "AutoTexts for shortcut " ;
};
ListBox LB_GLOS
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index c12b4a9e7878..c7591f96cc28 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,6 +44,7 @@
#include <unotools/tempfile.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <sot/filelist.hxx>
#include <svx/svxdlg.hxx>
@@ -103,7 +105,7 @@
#include <docsh.hxx>
#include <wdocsh.hxx>
#include <fldbas.hxx> //DDE
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <pam.hxx>
#include <ndole.hxx>
#include <swwait.hxx>
@@ -124,7 +126,7 @@
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
#include <globals.hrc>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swserv.hxx>
#include <switerator.hxx>
@@ -174,8 +176,8 @@ protected:
public:
SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh );
- virtual void DataChanged( const String& rMimeType,
- const uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
virtual void Closed();
sal_Bool WriteData( SvStream& rStrm );
@@ -206,9 +208,6 @@ public:
}
};
-
-// -----------------------------------------------------------------------
-
SwTransferable::SwTransferable( SwWrtShell& rSh )
: pWrtShell( &rSh ),
pCreatorView( 0 ),
@@ -239,13 +238,11 @@ SwTransferable::SwTransferable( SwWrtShell& rSh )
}
}
-// -----------------------------------------------------------------------
-
SwTransferable::~SwTransferable()
{
Application::GetSolarMutex().acquire();
- // der DDELink braucht noch die WrtShell!
+ // the DDELink still needs the WrtShell!
if( refDdeLink.Is() )
{
((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( sal_True );
@@ -254,14 +251,13 @@ SwTransferable::~SwTransferable()
pWrtShell = 0;
- // dvo 2002-05-30, #99239#: release reference to the document so that
- // aDocShellRef will delete it (if aDocShellRef is set). Otherwise, the OLE
- // nodes keep references to their sub-storage when the storage is already
- // dead.
+ // release reference to the document so that aDocShellRef will delete
+ // it (if aDocShellRef is set). Otherwise, the OLE nodes keep references
+ // to their sub-storage when the storage is already dead.
delete pClpDocFac;
- //JP 22.04.95: erst schliessen, dann kann die Ref. auch gecleared werden,
- // so das die DocShell auch tatsaechlich geloescht wird!
+ // first close, then the Ref. can be cleared as well, so that
+ // the DocShell really gets deleted!
if( aDocShellRef.Is() )
{
SfxObjectShell * pObj = aDocShellRef;
@@ -291,12 +287,10 @@ SwTransferable::~SwTransferable()
Application::GetSolarMutex().release();
}
-// -----------------------------------------------------------------------
-
static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
{
SwDoc *const pDoc = rDocFac.GetDoc();
- ASSERT( pDoc, "Document not found" );
+ OSL_ENSURE( pDoc, "Document not found" );
if (pDoc)
{
pDoc->SetClipBoard( true );
@@ -304,8 +298,6 @@ static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
return pDoc;
}
-// -----------------------------------------------------------------------
-
void SwTransferable::ObjectReleased()
{
SwModule *pMod = SW_MOD();
@@ -315,8 +307,6 @@ void SwTransferable::ObjectReleased()
pMod->pXSelection = 0;
}
-// -----------------------------------------------------------------------
-
void SwTransferable::AddSupportedFormats()
{
// only need if we are the current XSelection Object
@@ -327,20 +317,16 @@ void SwTransferable::AddSupportedFormats()
}
}
-// -----------------------------------------------------------------------
-
void SwTransferable::InitOle( SfxObjectShell* pDoc, SwDoc& rDoc )
{
- //OleVisArea einstellen. Linke obere Ecke der Seite und Groesse
- //der RealSize in Twips.
+ //set OleVisArea. Upper left corner of the page and size of
+ //RealSize in Twips.
const Size aSz( OLESIZE );
SwRect aVis( Point( DOCUMENTBORDER, DOCUMENTBORDER ), aSz );
pDoc->SetVisArea( aVis.SVRect() );
rDoc.set(IDocumentSettingAccess::BROWSE_MODE, true );
}
-// -----------------------------------------------------------------------
-
uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64& nAspect ) const
{
uno::Reference < embed::XEmbeddedObject > xObj;
@@ -358,8 +344,6 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64&
return xObj;
}
-// -----------------------------------------------------------------------
-
Graphic* SwTransferable::FindOLEReplacementGraphic() const
{
if( pClpDocFac )
@@ -375,17 +359,12 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const
return NULL;
}
-
-// -----------------------------------------------------------------------
-
void SwTransferable::RemoveDDELinkFormat( const Window& rWin )
{
RemoveFormat( SOT_FORMATSTR_ID_LINK );
CopyToClipboard( (Window*)&rWin );
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
@@ -401,7 +380,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
{
SelectionType nSelectionType = pWrtShell->GetSelectionType();
-// SEL_GRF kommt vom ContentType der editsh
+// SEL_GRF comes from ContentType of editsh
if( (nsSelectionType::SEL_GRF | nsSelectionType::SEL_DRW_FORM) & nSelectionType )
{
pClpGraphic = new Graphic;
@@ -411,7 +390,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap ))
pOrigGrf = pClpBitmap;
- // ist es ein URL-Button ?
+ // is it an URL-Button ?
String sURL, sDesc;
if( pWrtShell->GetURLFromButton( sURL, sDesc ) )
{
@@ -423,10 +402,10 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
pClpDocFac = new SwDocFac;
SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
- pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
+ pTmpDoc->LockExpFlds(); // never update fields - leave text as it is
pWrtShell->Copy( pTmpDoc );
- // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!)
+ // in CORE a new one was created (OLE-Objekte copied!)
aDocShellRef = pTmpDoc->GetTmpDocShell();
if( aDocShellRef.Is() )
SwTransferable::InitOle( aDocShellRef, *pTmpDoc );
@@ -469,8 +448,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
if( TRNSFR_OLE == eBufferType )
{
//TODO/MBA: testing - is this the "single OLE object" case?!
- // aus dem ClipDoc das OLE-Object besorgen und von dem die Daten
- // besorgen.
+ // get OLE-Object from ClipDoc and get the data from that.
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; // will be set in the next statement
uno::Reference < embed::XEmbeddedObject > xObj = FindOLEObj( nAspect );
Graphic* pOLEGraph = FindOLEReplacementGraphic();
@@ -544,7 +522,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
bOK = SetGDIMetaFile( pClpGraphic->GetGDIMetaFile(), rFlavor );
break;
case SOT_FORMAT_BITMAP:
- // #126398# Neither pClpBitmap nor pClpGraphic are necessarily set
+ // Neither pClpBitmap nor pClpGraphic are necessarily set
if( (eBufferType & TRNSFR_GRAPHIC) && (pClpBitmap != 0 || pClpGraphic != 0))
bOK = SetBitmap( (pClpBitmap ? pClpBitmap
: pClpGraphic)->GetBitmap(),
@@ -572,7 +550,6 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
break;
case SOT_FORMATSTR_ID_EMBED_SOURCE:
-// default:
if( !aDocShellRef.Is() )
{
SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
@@ -590,8 +567,6 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
return bOK;
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
void* pObject, sal_uInt32 nObjectType,
const DATA_FLAVOR& /*rFlavor*/ )
@@ -603,18 +578,17 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
{
case SWTRANSFER_OBJECTTYPE_DRAWMODEL:
{
- //JP 28.02.2001: dont change the sequence of commands - Bug 8
+ // dont change the sequence of commands
SdrModel *pModel = (SdrModel*)pObject;
xStream->SetBufferSize( 16348 );
- // #108584#
// for the changed pool defaults from drawing layer pool set those
// attributes as hard attributes to preserve them for saving
const SfxItemPool& rItemPool = pModel->GetItemPool();
const SvxFontHeightItem& rDefaultFontHeight = (const SvxFontHeightItem&)rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT);
// SW should have no MasterPages
- DBG_ASSERT(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
+ OSL_ENSURE(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++)
{
@@ -714,7 +688,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
aAOpt.SetCharSet( RTL_TEXTENCODING_UTF8 );
xWrt->SetAsciiOptions( aAOpt );
- // #102841# no start char for clipboard
+ // no start char for clipboard
xWrt->bUCS2_WithStartChar = sal_False;
}
break;
@@ -738,8 +712,6 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
return bRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::Cut()
{
int nRet = Copy( sal_True );
@@ -748,13 +720,11 @@ int SwTransferable::Cut()
return nRet;
}
-// -----------------------------------------------------------------------
-
void SwTransferable::DeleteSelection()
{
if(!pWrtShell)
return;
- // Selektionsart vor Action-Klammerung erfragen
+ // ask for type of selection before action-bracketing
const int nSelection = pWrtShell->GetSelectionType();
pWrtShell->StartUndo( UNDO_DELETE );
if( ( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL ) & nSelection )
@@ -763,8 +733,6 @@ void SwTransferable::DeleteSelection()
pWrtShell->EndUndo( UNDO_DELETE );
}
-// -----------------------------------------------------------------------
-
int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
{
int nRet = 1;
@@ -792,10 +760,8 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
PrepareOLE( aObjDesc );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
- // --> OD 2005-02-09 #119353# - robust
const Graphic* pGrf = pWrtShell->GetGraphic();
if( pGrf && pGrf->IsSupportedGraphic() )
- // <--
{
AddFormat( FORMAT_GDIMETAFILE );
AddFormat( FORMAT_BITMAP );
@@ -823,7 +789,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
AddFormat( FORMAT_GDIMETAFILE );
eBufferType = TRNSFR_OLE;
}
- //Gibt es ueberhaupt etwas zum bereitstellen?
+ // Is there anything to provide anyway?
else if ( pWrtShell->IsSelection() || pWrtShell->IsFrmSelected() ||
pWrtShell->IsObjSelected() )
{
@@ -833,10 +799,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
pClpDocFac = new SwDocFac;
- // zusaetzlichen Cursor erzeugen, damit eine Gleichbehandlung
- // von Tastatur- und Mausselektion moeglich ist.
- // Im AddMode wird bei Tastaturselektion der neue Cursor erst
- // beim Bewegen des Cursors nach Selektionsende erzeugt.
+ // create additional cursor so that equal treatment of keyboard
+ // and mouse selection is possible.
+ // In AddMode with keyboard selection, the new cursor is not created
+ // before the cursor is moved after end of selection.
if( pWrtShell->IsAddMode() && pWrtShell->SwCrsrShell::HasSelection() )
pWrtShell->CreateCrsr();
@@ -863,7 +829,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
pMarkAccess->deleteMark(*ppMark);
}
- // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!)
+ // a new one was created in CORE (OLE-Objekte copied!)
aDocShellRef = pTmpDoc->GetTmpDocShell();
if( aDocShellRef.Is() )
SwTransferable::InitOle( aDocShellRef, *pTmpDoc );
@@ -885,11 +851,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
bDDELink = pWrtShell->HasWholeTabSelection();
}
- //Wenn's einer braucht OLE'n wir ihm was.
+ //When someone needs it, we 'OLE' him something
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
- //RTF vor das Metafile von OLE stellen, weil mit weniger verlusten
- //behaftet.
+ //put RTF ahead of the OLE's Metafile to have less loss
if( !pWrtShell->IsObjSelected() )
{
AddFormat( FORMAT_RTF );
@@ -915,7 +880,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap ))
pOrigGrf = pClpBitmap;
- // ist es ein URL-Button ?
+ // is it an URL-Button ?
String sURL, sDesc;
if( pWrtShell->GetURLFromButton( sURL, sDesc ) )
{
@@ -930,7 +895,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
}
}
- // beim Cut hat DDE-Link keinen Sinn!!
+ // at Cut, DDE-Link doesn't make sense!!
SwDocShell* pDShell;
if( !bIsCut && bDDELink &&
0 != ( pDShell = pWrtShell->GetDoc()->GetDocShell()) &&
@@ -940,9 +905,9 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
refDdeLink = new SwTrnsfrDdeLink( *this, *pWrtShell );
}
- //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt.
- //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage
- //auch noch mit delayed rendering beantwortet werden.
+ //ObjectDescriptor was already filly from the old DocShell.
+ //Now adjust it. Thus in GetData the first query can still
+ //be answered with delayed rendering.
aObjDesc.mbCanLink = sal_False;
Size aSz( OLESIZE );
aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
@@ -987,8 +952,6 @@ int SwTransferable::Copy( sal_Bool bIsCut )
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::CalculateAndCopy()
{
if(!pWrtShell)
@@ -1008,8 +971,6 @@ int SwTransferable::CalculateAndCopy()
return 1;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
const String& rStr )
{
@@ -1022,14 +983,14 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
SwNodes& rNds = pCDoc->GetNodes();
SwNodeIndex aNodeIdx( *rNds.GetEndOfContent().StartOfSectionNode() );
- SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // gehe zum 1. ContentNode
+ SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // go to 1st ContentNode
SwPaM aPam( *pCNd );
- pCDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
+ pCDoc->LockExpFlds(); // never update fields - leave text as it is
pCDoc->InsertGlossary( rGlossary, rStr, aPam, 0 );
- // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!)
+ // a new one was created in CORE (OLE-Objects copied!)
aDocShellRef = pCDoc->GetTmpDocShell();
if( aDocShellRef.Is() )
SwTransferable::InitOle( aDocShellRef, *pCDoc );
@@ -1037,15 +998,15 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
eBufferType = TRNSFR_DOCUMENT;
- //Wenn's einer braucht OLE'n wir ihm was.
+ //When someone needs it, we 'OLE' her something.
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( FORMAT_RTF );
AddFormat( SOT_FORMATSTR_ID_HTML );
AddFormat( FORMAT_STRING );
- //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt.
- //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage
- //auch noch mit delayed rendering beantwortet werden.
+ //ObjectDescriptor was already filled from the old DocShell.
+ //Now adjust it. Thus in GetData the first query can still
+ //be answered with delayed rendering.
aObjDesc.mbCanLink = sal_False;
Size aSz( OLESIZE );
aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
@@ -1062,13 +1023,12 @@ static inline uno::Reference < XTransferable > * lcl_getTransferPointer ( uno::R
{
return &xRef;
}
-// -----------------------------------------------------------------------
sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh,
const TransferableDataHelper& rData )
{
// Check the common case first: We can always paste our own data!
- // #106503#: If _only_ the internal format can be pasted, this check will
+ // If _only_ the internal format can be pasted, this check will
// yield 'true', while the one below would give a (wrong) result 'false'.
bool bIsPaste = ( GetSwTransferable( rData ) != NULL );
@@ -1105,8 +1065,6 @@ sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh,
return bIsPaste;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData )
{
sal_uInt16 nEventAction, nAction=0,
@@ -1151,8 +1109,6 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData )
nDestination, sal_False, sal_False );
}
-// -----------------------------------------------------------------------
-
int SwTransferable::PasteData( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uInt16 nAction, sal_uLong nFormat,
sal_uInt16 nDestination, sal_Bool bIsPasteFmt,
@@ -1183,13 +1139,10 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
case EXCHG_DEST_DOC_DRAWOBJ:
case EXCHG_DEST_DOC_URLBUTTON:
case EXCHG_DEST_DOC_GROUPOBJ:
- // Rahmen/Objecte selektieren
+ // select frames/objects
SwTransferable::SetSelInShell( rSh, sal_True, pPt );
break;
- // case EXCHG_DEST_DOC_TEXTFRAME:
- // case EXCHG_DEST_SWDOC_FREE_AREA:
- // case EXCHG_DEST_DOC_URLFIELD:
default:
SwTransferable::SetSelInShell( rSh, sal_False, pPt );
break;
@@ -1199,13 +1152,13 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
else if( ( !GetSwTransferable( rData ) || bIsPasteFmt ) &&
!rSh.IsTableMode() && rSh.HasSelection() )
{
- // dann die Selektionen loeschen
+ // then delete the selections
- //Selektierten Inhalt loeschen,
- // - nicht bei Tabellen-Selektion
- // - nicht bei ReRead einer Grafik/DDEDaten
- // - nicht bei D&D, fuer die richtige Selektion wurde im
- // Drop-Handler gesorgt
+ //don't delete selected content
+ // - at table-selection
+ // - at ReRead of a graphic/DDEData
+ // - at D&D, for the right selection was taken care of
+ // in Drop-Handler
sal_Bool bDelSel = sal_False;
switch( nDestination )
{
@@ -1218,20 +1171,12 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
}
if( bDelSel )
- // --> FME 2004-10-19 #i34830#
+ // #i34830#
pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL,
sal_True );
- // <--
}
SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData );
-// uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY );
-// if ( xTunnel.is() )
-// {
-// sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
-// if ( nHandle )
-// pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle;
-// }
if( pPt && ( bPasteSelection ? 0 != ( pTrans = pMod->pXSelection )
: 0 != ( pTrans = pMod->pDragDrop) ))
@@ -1250,25 +1195,24 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
{
if( !pAction )
{
- // #111827#
pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD);
}
- // im Drag&Drop duerfen keine MessageBoxen angezeigt werden
+ // in Drag&Drop MessageBoxes must not be showed
sal_Bool bMsg = 0 == pPt;
sal_uInt8 nActionFlags = static_cast< sal_uInt8 >(( nAction >> 8 ) & 0xFF);
sal_uInt16 nClearedAction = ( nAction & EXCHG_ACTION_MASK );
- // Selektionen loeschen
+ // delete selections
switch( nClearedAction )
{
case EXCHG_OUT_ACTION_INSERT_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: was soll hier passieren?" );
+ OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: what should happen here?" );
break;
case EXCHG_OUT_ACTION_MOVE_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
+ OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: what should happen here?" );
break;
@@ -1280,7 +1224,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
case EXCHG_OUT_ACTION_INSERT_IMAGEMAP:
case EXCHG_OUT_ACTION_REPLACE_IMAGEMAP:
- // dann muss ueber das Format gegangen werden
+ // then we have to use the format
switch( nFormat )
{
case SOT_FORMATSTR_ID_DRAWING:
@@ -1347,7 +1291,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
break;
case SOT_FORMAT_FILE_LIST:
- // dann nur als Grafiken einfuegen
+ // then insert as graphics only
nRet = SwTransferable::_PasteFileList( rData, rSh,
EXCHG_IN_ACTION_LINK == nClearedAction,
pPt, bMsg );
@@ -1382,7 +1326,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
break;
default:
- ASSERT( pPt, "unbekanntes Format" );
+ OSL_ENSURE( pPt, "unknown format" );
}
break;
@@ -1458,7 +1402,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
nActionFlags, bMsg );
break;
default:
- ASSERT( sal_False, "unbekanntes Format" );
+ OSL_FAIL( "unknown format" );
}
break;
@@ -1497,7 +1441,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
break;
default:
- ASSERT( sal_False, "unbekannte Action" );
+ OSL_FAIL("unknown action" );
}
}
@@ -1516,8 +1460,6 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
return nRet;
}
-// -----------------------------------------------------------------------
-
sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh,
const Point* pPt )
{
@@ -1575,22 +1517,9 @@ sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh,
case OBJCNT_URLBUTTON: nRet = EXCHG_DEST_DOC_URLBUTTON; break;
case OBJCNT_GROUPOBJ: nRet = EXCHG_DEST_DOC_GROUPOBJ; break;
-// was mmchen wir bei Mehrfachselektion???
-// case OBJCNT_DONTCARE:
+// what do we do at multiple selections???
default:
{
-/*
-JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die
- Inhalte zugelassen. Das ist aber bestimmt nicht das
- gewollte.
- SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR );
- SfxItemSet aSet( (SfxItemPool&)rSh.GetAttrPool(),
- RES_TXTATR_INETFMT, RES_TXTATR_INETFMT );
- if( pPt ? ((SwWrtShell&)rSh).GetContentAtPos( *pPt, aCntntAtPos, sal_False )
- : (rSh.GetAttr( aSet ) && aSet.Count()) )
- nRet = EXCHG_DEST_DOC_URLFIELD;
- else
-*/
if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
nRet = EXCHG_DEST_SWDOC_FREE_AREA_WEB;
else
@@ -1601,8 +1530,6 @@ JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bMsg )
{
@@ -1648,7 +1575,6 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
pStream = aMSE40ClpObj.IsValid( *xStrm );
pRead = ReadHTML;
pRead->SetReadUTF8( sal_True );
- //pRead->SetBaseURL( aMSE40ClpObj.GetBaseURL() );
sal_Bool bNoComments =
( nFmt == SOT_FORMATSTR_ID_HTML_NO_COMMENT );
@@ -1700,8 +1626,6 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
sal_uLong nFmt, sal_uInt8 nActionFlags, sal_Bool bMsg )
{
@@ -1781,7 +1705,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
if ( !rData.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) )
{
- DBG_ASSERT( !xStrm.is(), "An object without descriptor in clipboard!");
+ OSL_ENSURE( !xStrm.is(), "An object without descriptor in clipboard!");
}
}
else
@@ -1828,18 +1752,6 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
Graphic aGraphic;
sal_uLong nGrFormat = 0;
-// (wg. Selection Manager bei Trustet Solaris)
-#ifndef SOLARIS
-/*
- if( rData.GetGraphic( SOT_FORMATSTR_ID_SVXB, aGraphic ) )
- nGrFormat = SOT_FORMATSTR_ID_SVXB;
- else if( rData.GetGraphic( FORMAT_GDIMETAFILE, aGraphic ) )
- nGrFormat = SOT_FORMAT_GDIMETAFILE;
- else if( rData.GetGraphic( FORMAT_BITMAP, aGraphic ) )
- nGrFormat = SOT_FORMAT_BITMAP;
-*/
-#endif
-
// insert replacement image ( if there is one ) into the object helper
if ( nGrFormat )
{
@@ -1859,8 +1771,8 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
xObjRef.SetGraphic( aGraphic, aMimeType );
}
- //Size einstellen. Ist ein Hack wg. Auslieferung, die Size sollte
- //an das InsertOle uebergeben werden!!!!!!!!!!
+ //set size. This is a hack because of handing over, size should be
+ //passed to the InsertOle!!!!!!!!!!
Size aSize;
if ( aObjDesc.mnViewAspect == embed::Aspects::MSOLE_ICON )
{
@@ -1874,7 +1786,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
}
else if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() )
{
- aSize = Size( aObjDesc.maSize ); //immer 100TH_MM
+ aSize = Size( aObjDesc.maSize ); //always 100TH_MM
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) );
aSize = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit );
awt::Size aSz;
@@ -1907,7 +1819,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
}
}
- //Ende mit Hack!
+ //End of Hack!
rSh.InsertOleObject( xObjRef );
nRet = 1;
@@ -1923,11 +1835,6 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
return nRet;
}
-// -----------------------------------------------------------------------
-
-
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uInt16 nAction,
const Point* pPt, sal_Bool bInsertGRF )
@@ -1944,11 +1851,10 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
String sURL( aINetImg.GetImageURL() );
SwTransferable::_CheckForURLOrLNKFile( rData, sURL );
- //!!! auf FileSystem abpruefen - nur dann ist es sinnvoll die
- // Grafiken zu testen !!!!
+ //!!! check at FileSystem - only then it make sense to test graphics !!!
Graphic aGrf;
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
- nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, pFlt );
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
+ nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, &rFlt );
if( nRet )
{
switch( nAction )
@@ -2007,15 +1913,12 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
return nRet;
}
-
-// -----------------------------------------------------------------------
-
void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm,
const Point* pPt )
{
if( bSelectFrm )
{
- // Rahmen/Objecte selektieren
+ // select frames/objects
if( pPt && !rSh.GetView().GetViewFrame()->GetDispatcher()->IsLocked() )
{
rSh.GetView().NoRotate();
@@ -2045,22 +1948,20 @@ void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm,
}
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
SwWrtShell& rWrtShell, sal_Bool bReReadGrf,
sal_Bool bMsg )
{
- // Daten aus dem Clipboardformat
+ // data from Clipboardformat
String aApp, aTopic, aItem;
{
SotStorageStreamRef xStrm;
if( !rData.GetSotStorageStream( SOT_FORMATSTR_ID_LINK, xStrm ))
{
- ASSERT( !&rWrtShell, "DDE Data not found." );
+ OSL_ENSURE( !&rWrtShell, "DDE Data not found." );
return 0;
- } //sinnvollen Fehler melden!!
+ } // report useful error!!
rtl_TextEncoding eEncoding = DDE_TXT_ENCODING;
xStrm->ReadCString( aApp, eEncoding );
@@ -2071,7 +1972,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
String aCmd;
sfx2::MakeLnkName( aCmd, &aApp, aTopic, aItem );
- // wollen wir jetzt eine Grafik einlesen ?
+ // do we want to read in a graphic now?
sal_uLong nFormat;
if( !rData.HasFormat( FORMAT_RTF ) &&
!rData.HasFormat( SOT_FORMATSTR_ID_HTML ) &&
@@ -2144,8 +2045,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
{
do { // middle checked loop
- // Wenn die Daten von einer Tabellenkalkulation kommen
- // fuegen wir eine DDE-Tabelle ein
+ // When data comes from a spreadsheet, we add a DDE-table
if( ( rData.HasFormat( SOT_FORMATSTR_ID_SYLK ) ||
rData.HasFormat( SOT_FORMATSTR_ID_SYLK_BIGCAPS ) ) &&
aExpand.Len() &&
@@ -2159,7 +2059,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
sTmp = sTmp.GetToken( 0, '\n' );
xub_StrLen nCols = sTmp.GetTokenCount( '\t' );
- // mindestens eine Spalte & Zeile muss vorhanden sein
+ // at least one column & row must be there
if( !nRows || !nCols )
{
if( bMsg )
@@ -2169,12 +2069,12 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
}
rWrtShell.InsertDDETable(
- SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ), // TODO MULTIHEADER
+ SwInsertTableOptions( tabopts::SPLIT_LAYOUT, 1 ), // TODO MULTIHEADER
pDDETyp, nRows, nCols );
}
else if( 1 < aExpand.GetTokenCount( '\n' ) )
{
- // mehrere Absaetze -> eine geschuetzte Section einfuegen
+ // multiple paragraphs -> insert a protected section
if( rWrtShell.HasSelection() )
rWrtShell.DelRight();
@@ -2183,7 +2083,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
aSect.SetProtectFlag(true);
rWrtShell.InsertSection( aSect );
- pDDETyp = 0; // FeldTypen wieder entfernen
+ pDDETyp = 0; // remove FieldTypes again
}
else
{
@@ -2195,11 +2095,11 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
} while( sal_False );
}
else
- pDDETyp = 0; // FeldTypen wieder entfernen
+ pDDETyp = 0; // remove FieldTypes again
if( !pDDETyp && !bDoublePaste )
{
- // FeldTyp wieder entfernen - Fehler aufgetreten!
+ // remove FieldType again - error occured!
for( j = nSize; j >= INIT_FLDTYPES; --j )
if( pTyp == rWrtShell.GetFldType( j ) )
{
@@ -2211,8 +2111,6 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
return 1;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uInt16 nAction,
const Point* pPt, sal_uInt8 nActionFlags )
@@ -2232,8 +2130,6 @@ int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt,
sal_uInt8 nActionFlags, sal_Bool /*bMsg*/ )
@@ -2256,13 +2152,6 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
case SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR:
if( 0 != ( nRet = rData.GetINetBookmark( nFmt, aBkmk ) ))
{
-/* if( SW_PASTESDR_SETATTR != nAction )
- {
- INetURLObject aURL( aBkmk.GetURL() );
- bCheckForGrf = INET_PROT_FILE == aURL.GetProtocol();
- nRet = 0 != bCheckForGrf;
- }
-*/
if( SW_PASTESDR_SETATTR == nAction )
nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK;
else
@@ -2294,17 +2183,16 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
if( bCheckForGrf )
{
- //!!! auf FileSystem abpruefen - nur dann ist es sinnvoll die
- // Grafiken zu testen !!!!
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
+ //!!! check at FileSystem - only then it makes sense to test the graphics !!!
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( aBkmk.GetURL(), aEmptyStr,
- aGrf, pFlt );
+ aGrf, &rFlt );
if( !nRet && SW_PASTESDR_SETATTR == nAction &&
SOT_FORMAT_FILE == nFmt &&
- // Bug 63031 - nur bei Rahmenselektion
+ // only at frame selection
rSh.IsFrmSelected() )
{
- // dann als Hyperlink hinter die Grafik setzen
+ // then set as hyperlink after the graphic
nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK;
nRet = sal_True;
}
@@ -2376,7 +2264,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
}
else if( bCheckForImageMap )
{
- // oder sollte das File ein ImageMap-File sein?
+ // or should the file be an ImageMap-File?
ImageMap aMap;
SfxMedium aMed( INetURLObject(aBkmk.GetURL()).GetFull(),
STREAM_STD_READ, sal_False );
@@ -2400,8 +2288,6 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteImageMap( TransferableDataHelper& rData,
SwWrtShell& rSh )
{
@@ -2413,7 +2299,7 @@ int SwTransferable::_PasteImageMap( TransferableDataHelper& rData,
SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) );
const ImageMap* pOld = aURL.GetMap();
- // setzen oder ersetzen ist hier die Frage
+ // set or replace, that is the question
ImageMap aImageMap;
if( rData.GetImageMap( SOT_FORMATSTR_ID_SVIM, aImageMap ) &&
( !pOld || aImageMap != *pOld ))
@@ -2427,8 +2313,6 @@ int SwTransferable::_PasteImageMap( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uLong nFmt )
{
@@ -2439,7 +2323,7 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData,
String sDesc;
SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc );
- //#41801# ersteinmal die URL absolut machen
+ // first, make the URL absolute
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( sFile );
@@ -2473,8 +2357,6 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uLong nFmt,
sal_uInt16 nAction, const Point* pPt,
@@ -2505,22 +2387,14 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
{
sal_Bool bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc );
- //Eigenes FileFormat? -->Einfuegen, nicht fuer StarWriter/Web
+ //Own FileFormat? --> insert, not for StarWriter/Web
String sFileURL = URIHelper::SmartRel2Abs(INetURLObject(), sFile, Link(), false );
const SfxFilter* pFlt = SW_PASTESDR_SETATTR == nAction
? 0 : SwIoSystem::GetFileFilter(
sFileURL, aEmptyStr );
- if( pFlt && !rSh.GetView().GetDocShell()->ISA(SwWebDocShell)
- /*
- JP 02.07.98: warum nur fuer die Formate ??
- && ( pFlt->GetUserData() == FILTER_SW5 ||
- pFlt->GetUserData() == FILTER_SW4 ||
- pFlt->GetUserData() == FILTER_SW3 ||
- pFlt->GetUserData() == FILTER_SWG )
- */
- )
+ if( pFlt && !rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
{
- // und dann per PostUser Event den Bereich-Einfuegen-Dialog hochreissen
+ // and then pull up the insert-region-dialog by PostUser event
SwSectionData * pSect = new SwSectionData(
FILE_LINK_SECTION,
rSh.GetDoc()->GetUniqueSectionName() );
@@ -2534,10 +2408,9 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
else if( SW_PASTESDR_SETATTR == nAction ||
( bIsURLFile && SW_PASTESDR_INSERT == nAction ))
{
- //Fremde Files koennen wir immerhin noch als Links
- //Einfuegen.
+ //we can insert foreign files as links after all
- //#41801# ersteinmal die URL absolut machen
+ // first, make the URL absolute
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( sFile );
@@ -2574,8 +2447,6 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bLink,
const Point* pDragPt, sal_Bool bMsg )
@@ -2678,8 +2549,6 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_PasteFileList( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_Bool bLink,
const Point* pPt, sal_Bool bMsg )
@@ -2719,8 +2588,6 @@ int SwTransferable::_PasteFileList( TransferableDataHelper& rData,
return nRet;
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData,
String& rFileName, String* pTitle )
{
@@ -2741,15 +2608,13 @@ sal_Bool SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData,
String sExt( rFileName.Copy( nLen - 3 ));
if( sExt.EqualsIgnoreCaseAscii( "url" ))
{
-ASSERT( !&rFileName, "how do we read today .URL - Files?" );
+ OSL_ENSURE( !&rFileName, "how do we read today .URL - Files?" );
}
}
}
return bIsURLFile;
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell,
const TransferableDataHelper& rData )
{
@@ -2759,8 +2624,6 @@ sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell,
return aClipboardFmtItem.Count() > 0;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::PasteFormat( SwWrtShell& rSh,
TransferableDataHelper& rData,
sal_uLong nFormat )
@@ -2803,8 +2666,6 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh,
return nRet;
}
-// -----------------------------------------------------------------------
-
int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData,
sal_uLong nFormat, sal_uInt16 nDestination )
{
@@ -2821,8 +2682,6 @@ int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData,
return EXCHG_INOUT_ACTION_NONE != nAction;
}
-// -----------------------------------------------------------------------
-
/**
* the list of formats which will be offered to the user in the 'Paste
* Special...' dialog and the paste button menu
@@ -2845,15 +2704,12 @@ static sal_uInt16 aPasteSpecialIds[] =
0
};
-
int SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& rData )
{
// Plain text == unformatted
return SwTransferable::PasteFormat( rSh, rData, SOT_FORMAT_STRING );
}
-// -----------------------------------------------------------------------
-
int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong& rFormatUsed )
{
int nRet = 0;
@@ -2925,7 +2781,6 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData
return nRet;
}
-
void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh,
const TransferableDataHelper& rData,
SvxClipboardFmtItem & rToFill )
@@ -2988,10 +2843,8 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
if( nsSelectionType::SEL_GRF == nSelection)
{
AddFormat( SOT_FORMATSTR_ID_SVXB );
- // --> OD 2005-02-09 #119353# - robust
const Graphic* pGrf = pWrtShell->GetGraphic();
if ( pGrf && pGrf->IsSupportedGraphic() )
- // <--
{
AddFormat( FORMAT_GDIMETAFILE );
AddFormat( FORMAT_BITMAP );
@@ -3007,7 +2860,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
AddFormat( FORMAT_GDIMETAFILE );
eBufferType = TRNSFR_OLE;
}
- //Gibt es ueberhaupt etwas zum bereitstellen?
+ //Is there anything to provide anyway?
else if ( pWrtShell->IsSelection() || pWrtShell->IsFrmSelected() ||
pWrtShell->IsObjSelected() )
{
@@ -3027,8 +2880,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
- //RTF vor das Metafile von OLE stellen, weil mit weniger verlusten
- //behaftet.
+ //put RTF ahead of the OLE's Metafile for less loss
if( !pWrtShell->IsObjSelected() )
{
AddFormat( FORMAT_RTF );
@@ -3054,7 +2906,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap ))
pOrigGrf = pClpBitmap;
- // ist es ein URL-Button ?
+ // is it an URL-Button ?
String sURL, sDesc;
if( pWrtShell->GetURLFromButton( sURL, sDesc ) )
{
@@ -3068,9 +2920,9 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
}
}
- //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt.
- //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage
- //auch noch mit delayed rendering beantwortet werden.
+ //ObjectDescriptor was already filled from the old DocShell.
+ //Now adjust it. Thus in GetData the first query can still
+ //be answered with delayed rendering.
aObjDesc.mbCanLink = sal_False;
aObjDesc.maDragStartPos = rSttPos;
aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ),
@@ -3080,7 +2932,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
}
else if( nSelection & nsSelectionType::SEL_TXT && !pWrtShell->HasMark() )
{
- // ist nur ein Feld - Selektiert?
+ // is only one field - selected?
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR );
Point aPos( SwEditWin::GetDDStartPosX(), SwEditWin::GetDDStartPosY());
@@ -3142,13 +2994,13 @@ void SwTransferable::StartDrag( Window* pWin, const Point& rPos )
void SwTransferable::DragFinished( sal_Int8 nAction )
{
- //Und noch die letzten Nacharbeiten damit alle Stati stimmen.
+ //And the last finishing work so that all statuses are right
if( DND_ACTION_MOVE == nAction )
{
if( bCleanUp )
{
- //Es wurde auserhalb des Writers gedroped. Wir muessen noch
- //loeschen.
+ //It was dropped outside of Writer. We still have to
+ //delete.
pWrtShell->StartAllAction();
pWrtShell->StartUndo( UNDO_UI_DRAG_AND_MOVE );
@@ -3157,7 +3009,7 @@ void SwTransferable::DragFinished( sal_Int8 nAction )
else
{
if ( !(pWrtShell->IsSelFrmMode() || pWrtShell->IsObjSelected()) )
- //SmartCut, eines der Blanks mitnehmen.
+ //SmartCut, take one of the blanks along
pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), sal_True );
pWrtShell->DelRight();
}
@@ -3180,52 +3032,39 @@ void SwTransferable::DragFinished( sal_Int8 nAction )
pWrtShell->HideCrsr();
else
pWrtShell->ShowCrsr();
-//!! else if( DND_ACTION_NONE != nAction )
-//!! pWrtShell->ShowCrsr();
-//!! else
-//!! {
-//!! //Muss wohl sein weil gescrollt wurde und ?...?
-//!! pWrtShell->StartAction();
-//!! pWrtShell->EndAction();
-//!! }
((SwViewOption *)pWrtShell->GetViewOptions())->SetIdle( bOldIdle );
}
-
-/* */
-
int SwTransferable::PrivatePaste( SwWrtShell& rShell )
{
- // erst den SelectionType erfragen, dann Action-Klammerung !!!!
- // (sonst wird nicht in eine TabellenSelektion gepastet!!!)
- ASSERT( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
+ // first, ask for the SelectionType, then action-bracketing !!!!
+ // (otherwise it's not pasted into a TableSelection!!!)
+ OSL_ENSURE( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
if ( !pClpDocFac )
return sal_False; // the return value of the SwFEShell::Paste also is sal_Bool!
const int nSelection = rShell.GetSelectionType();
- // #111827#
SwRewriter aRewriter;
SwTrnsfrActionAndUndo aAction( &rShell, UNDO_PASTE_CLIPBOARD);
bool bKillPaMs = false;
- //Selektierten Inhalt loeschen, nicht bei Tabellen-Selektion und
- //Tabelle im Clipboard
+ //Delete selected content, not at table-selection and table in Clipboard
if( rShell.HasSelection() && !( nSelection & nsSelectionType::SEL_TBL_CELLS))
{
bKillPaMs = true;
rShell.SetRetainSelection( true );
rShell.DelRight();
- // war ein Fly selektiert, so muss jetzt fuer eine gueltige
- // Cursor-Position gesorgt werden! (geparkter Cursor!)
+ // when a Fly was selected, a valid cursor position has to be found now
+ // (parked Cursor!)
if( ( nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF |
nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_FORM ) & nSelection )
{
- // den Cursor wieder positionieren
+ // position the cursor again
Point aPt( rShell.GetCharRect().Pos() );
rShell.SwCrsrShell::SetCrsr( aPt, sal_True );
}
@@ -3236,14 +3075,9 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
bSmart = 0 != (TRNSFR_DOCUMENT_WORD & eBufferType);
if( bSmart )
{
-// #108491# Why not for other Scripts? If TRNSFR_DOCUMENT_WORD is set, we have
-// a word in the buffer, word in this context means 'something with spaces at
-// beginning and end'. In this case we definitely want these spaces to be inserted
-// here.
-// if( SCRIPTTYPE_LATIN != rShell.GetScriptType() )
-// bSmart = sal_False;
-// else
-// {
+// Why not for other Scripts? If TRNSFR_DOCUMENT_WORD is set, we have a word
+// in the buffer, word in this context means 'something with spaces at beginning
+// and end'. In this case we definitely want these spaces to be inserted here.
bInWrd = rShell.IsInWrd();
bEndWrd = rShell.IsEndWrd();
bSmart = bInWrd || bEndWrd;
@@ -3253,7 +3087,6 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
if( bSmart && !bSttWrd && (bInWrd || bEndWrd) )
rShell.SwEditShell::Insert(' ');
}
-// }
}
int nRet = rShell.Paste( pClpDocFac->GetDoc() );
@@ -3261,7 +3094,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
if( bKillPaMs )
rShell.KillPams();
- // Wenn Smart Paste dann Leerzeichen einfuegen
+ // If Smart Paste then insert blank
if( nRet && bSmart && ((bInWrd && !bEndWrd )|| bSttWrd) )
rShell.SwEditShell::Insert(' ');
@@ -3291,7 +3124,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
if( (TRNSFR_INETFLD & eBufferType) && pBkmk )
aTmp = *pBkmk;
- // Zielgrafik selektieren
+ // select target graphic
if( rSh.SelectObj( rDragPt ) )
{
rSh.HideCrsr();
@@ -3301,7 +3134,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
const int nSelection = rSh.GetSelectionType();
- // Draw-Objekte erstmal noch nicht beruecksichtigen
+ // not yet consider Draw objects
if( nsSelectionType::SEL_GRF & nSelection )
{
SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
@@ -3326,14 +3159,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
if( &rSh != &rSrcSh && (nsSelectionType::SEL_GRF & rSh.GetSelectionType()) &&
TRNSFR_GRAPHIC == eBufferType )
{
- // ReRead auf die Grafik
+ // ReRead the graphic
String sGrfNm, sFltNm;
rSrcSh.GetGrfNms( &sGrfNm, &sFltNm );
rSh.ReRead( sGrfNm, sFltNm, rSrcSh.GetGraphic() );
return 1;
}
- //Nicht in Selektionen oder selektierten Rahmen
+ //not in selections or selected frames
if( rSh.ChgCurrPam( rDragPt ) ||
( rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj( rDragPt )) )
return 0;
@@ -3342,7 +3175,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
bTblSel = sal_True;
else if( rSrcSh.IsSelFrmMode() || rSrcSh.IsObjSelected() )
{
- // keine positionsgeschuetzten Objecte verschieben!
+ // don't move position-protected objects!
if( bMove && rSrcSh.IsSelObjProtected( FLYPROTECT_POS ) )
return 0;
@@ -3353,7 +3186,6 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
SwUndoId eUndoId = bMove ? UNDO_UI_DRAG_AND_MOVE : UNDO_UI_DRAG_AND_COPY;
- // #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, rSrcSh.GetSelDescr());
@@ -3375,13 +3207,13 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
{
if( !rSh.IsAddMode() )
{
- // --> OD 2008-03-19 #i87233#
+ // #i87233#
if ( rSh.IsBlockMode() )
{
// preserve order of cursors for block mode
rSh.GoPrevCrsr();
}
- // <--
+
rSh.SwCrsrShell::CreateCrsr();
}
rSh.SwCrsrShell::SetCrsr( rDragPt, sal_True, false );
@@ -3397,7 +3229,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
Point aSttPt( SwEditWin::GetDDStartPosX(), SwEditWin::GetDDStartPosY() );
- //JP 05.03.96: INetFelder erstmal selektieren !
+ // at first, select INetFelder!
if( TRNSFR_INETFLD == eBufferType )
{
if( &rSrcSh == &rSh )
@@ -3407,7 +3239,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSh.SelectTxtAttr( RES_TXTATR_INETFMT );
if( rSh.ChgCurrPam( rDragPt ) )
{
- // nicht in sich selbst kopieren/verschieben
+ // don't copy/move inside of yourself
rSh.DestroyCrsr();
rSh.EndUndo();
rSh.EndAction();
@@ -3422,15 +3254,15 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSrcSh.SelectTxtAttr( RES_TXTATR_INETFMT );
}
- // ist am Einfuege Punkt ein URL-Attribut? Dann das ersetzen,
- // also einfach eine Selektion aufspannen?
+ // is there an URL attribute at the insert point? Then replace that,
+ // so simply put up a selection?
rSh.DelINetAttrWithText();
bDDINetAttr = sal_True;
}
if ( rSrcSh.IsSelFrmMode() )
{
- //Hack: Spezialbehandlung austricksen
+ //Hack: fool the special treatment
aSttPt -= aSttPt - rSrcSh.GetObjRect().Pos();
}
@@ -3444,12 +3276,12 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
{
if ( bTblSel )
{
- /* #109590# delete table contents not cells */
+ /* delete table contents not cells */
rSrcSh.Delete();
}
else
{
- //SmartCut, eines der Blank mitnehmen.
+ //SmartCut, take one of the blanks along.
rSh.SwCrsrShell::DestroyCrsr();
if ( cWord == SwWrtShell::WORD_SPACE_BEFORE )
rSh.ExtendSelection( sal_False );
@@ -3461,7 +3293,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSrcSh.KillPams();
rSrcSh.Pop( sal_False );
- /* #109590# after dragging a table selection inside one shell
+ /* after dragging a table selection inside one shell
set cursor to the drop position. */
if( &rSh == &rSrcSh && ( bTblSel || rSh.IsBlockMode() ) )
{
@@ -3506,7 +3338,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSh.SwCrsrShell::CreateCrsr();
else
{
- // Selektionsmodus einschalten
+ // turn on selection mode
rSh.SttSelect();
rSh.EndSelect();
}
@@ -3520,7 +3352,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSrcSh.EndUndo();
rSh.EndUndo();
- // Shell in den richtigen Status versetzen
+ // put the shell in the right state
if( &rSrcSh != &rSh && ( rSh.IsFrmSelected() || rSh.IsObjSelected() ))
rSh.EnterSelFrmMode();
@@ -3536,7 +3368,6 @@ void SwTransferable::CreateSelection( SwWrtShell& rSh,
SwModule *pMod = SW_MOD();
SwTransferable* pNew = new SwTransferable( rSh );
- /* #96392#*/
pNew->pCreatorView = _pCreatorView;
uno::Reference<
@@ -3551,30 +3382,22 @@ void SwTransferable::ClearSelection( SwWrtShell& rSh,
SwModule *pMod = SW_MOD();
if( pMod->pXSelection &&
((!pMod->pXSelection->pWrtShell) || (pMod->pXSelection->pWrtShell == &rSh)) &&
- /* #96392# */
(!_pCreatorView || (pMod->pXSelection->pCreatorView == _pCreatorView)) )
{
TransferableHelper::ClearSelection( rSh.GetWin() );
}
}
-/* -----------------3/31/2003 11:46AM----------------
- --------------------------------------------------*/
+namespace
+{
+ class theSwTransferableUnoTunnelId : public rtl::Static< UnoTunnelIdInit, SwTransferable > {};
+}
+
const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq;
- if( !aSeq.getLength() )
- {
- static osl::Mutex aCreateMutex;
- osl::Guard< osl::Mutex > aGuard( aCreateMutex );
- aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
- }
- return aSeq;
+ return theSwTransferableUnoTunnelId::get().getSeq();
}
-/* -----------------3/31/2003 11:46AM----------------
- --------------------------------------------------*/
sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw( RuntimeException )
{
sal_Int64 nRet;
@@ -3604,15 +3427,11 @@ SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper&
}
-/* */
-
-// -----------------------------------------------------------------------
-
SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
: rTrnsfr( rTrans ), pDocShell( 0 ),
bDelBookmrk( sal_False ), bInDisconnect( sal_False )
{
- // hier kommen wir nur bei Tabellen- oder Text-Selection an
+ // we only end up here with table- or text selection
const int nSelection = rSh.GetSelectionType();
if( nsSelectionType::SEL_TBL_CELLS & nSelection )
{
@@ -3647,14 +3466,12 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
if( sName.Len() &&
0 != ( pDocShell = rSh.GetDoc()->GetDocShell() ) )
{
- // dann erzeugen wir uns mal unseren "Server" und connecten uns
- // zu diesem
+ // then we create our "server" and connect to it
refObj = pDocShell->DdeCreateLinkSource( sName );
if( refObj.Is() )
{
refObj->AddConnectAdvise( this );
refObj->AddDataAdvise( this,
-// SotExchange::GetFormatMimeType( FORMAT_RTF ),
aEmptyStr,
ADVISEMODE_NODATA | ADVISEMODE_ONLYONCE );
nOldTimeOut = refObj->GetUpdateTimeout();
@@ -3663,30 +3480,25 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
}
}
-// -----------------------------------------------------------------------
-
SwTrnsfrDdeLink::~SwTrnsfrDdeLink()
{
if( refObj.Is() )
Disconnect( sal_True );
}
-// -----------------------------------------------------------------------
-
-void SwTrnsfrDdeLink::DataChanged( const String& ,
+::sfx2::SvBaseLink::UpdateResult SwTrnsfrDdeLink::DataChanged( const String& ,
const uno::Any& )
{
- // tja das wars dann mit dem Link
+ // well, that's it with the link
if( !bInDisconnect )
{
if( FindDocShell() && pDocShell->GetView() )
rTrnsfr.RemoveDDELinkFormat( pDocShell->GetView()->GetEditWin() );
Disconnect( sal_False );
}
+ return SUCCESS;
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
{
if( !refObj.Is() || !FindDocShell() )
@@ -3714,12 +3526,6 @@ sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
rStrm.Write( pMem, nLen );
delete[] pMem;
- //if( bDelBookmrk )
- //{
- // // er wird das erstemal abgeholt, also ins Undo mitaufnehmen
- // // aber wie??
- //}
-
IDocumentMarkAccess* const pMarkAccess = pDocShell->GetDoc()->getIDocumentMarkAccess();
IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(sName);
if(ppMark != pMarkAccess->getMarksEnd()
@@ -3757,27 +3563,23 @@ sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
return true;
}
-// -----------------------------------------------------------------------
-
void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
{
- //JP 29.01.96 Bug 24432:
- // kein DataChanged mehr entgegen nehmen, wenn man
- // sich schon im Disconnet befindet!
- // (DTOR vom Bookmark verschickt einen DataChanged!)
+ // don't accept DataChanged anymore, when already in Disconnect!
+ // (DTOR from Bookmark sends a DataChanged!)
sal_Bool bOldDisconnect = bInDisconnect;
bInDisconnect = sal_True;
- // den nicht verwendeten Bookmark wieder zerstoeren (ohne Undo!)?
+ // destroy the unused bookmark again (without Undo!)?
if( bDelBookmrk && refObj.Is() && FindDocShell() )
{
SwDoc* pDoc = pDocShell->GetDoc();
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
- // --> OD, CD, OS 2005-11-25 #i58448#
+ // #i58448#
Link aSavedOle2Link( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- // <--
+
sal_Bool bIsModified = pDoc->IsModified();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
@@ -3785,9 +3587,8 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
if( !bIsModified )
pDoc->ResetModified();
- // --> OD, CD, OS 2005-11-25 #i58448#
+ // #i58448#
pDoc->SetOle2Link( aSavedOle2Link );
- // <--
bDelBookmrk = sal_False;
}
@@ -3797,29 +3598,27 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
refObj->SetUpdateTimeout( nOldTimeOut );
refObj->RemoveConnectAdvise( this );
if( bRemoveDataAdvise )
- // in einem DataChanged darf das SelectionObject NIE geloescht
- // werden; wird schon von der Basisklasse erledigt
+ // in a DataChanged the SelectionObject must NEVER be deleted
+ // is already handled by the base class
// (ADVISEMODE_ONLYONCE!!!!)
- // Im normalen Disconnet aber schon!
+ // but always in normal Disconnect!
refObj->RemoveAllDataAdvise( this );
refObj.Clear();
}
bInDisconnect = bOldDisconnect;
}
-// -----------------------------------------------------------------------
-
sal_Bool SwTrnsfrDdeLink::FindDocShell()
{
TypeId aType( TYPE( SwDocShell ) );
SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( &aType );
while( pTmpSh )
{
- if( pTmpSh == pDocShell ) // die wollen wir haben
+ if( pTmpSh == pDocShell ) // that's what we want to have
{
if( pDocShell->GetDoc() )
return sal_True;
- break; // das Doc ist nicht mehr vorhanden, also raus!
+ break; // the Doc is not there anymore, so leave!
}
pTmpSh = SfxObjectShell::GetNext( *pTmpSh, &aType );
}
@@ -3828,8 +3627,6 @@ sal_Bool SwTrnsfrDdeLink::FindDocShell()
return sal_False;
}
-// -----------------------------------------------------------------------
-
void SwTrnsfrDdeLink::Closed()
{
if( !bInDisconnect && refObj.Is() )
@@ -3839,3 +3636,5 @@ void SwTrnsfrDdeLink::Closed()
refObj.Clear();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx
index 5ed5b076a967..3e38eb97fb0a 100644
--- a/sw/source/ui/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: postit.cxx,v $
- * $Revision: 1.8.42.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -465,3 +463,4 @@ void AnchorOverlayObject::SetAnchorState( const AnchorState aState)
} } // end of namespace sw::annotation
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.hxx b/sw/source/ui/docvw/AnchorOverlayObject.hxx
index cea567f22921..6cc02cf37a52 100644
--- a/sw/source/ui/docvw/AnchorOverlayObject.hxx
+++ b/sw/source/ui/docvw/AnchorOverlayObject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -141,3 +138,5 @@ class AnchorOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition
} } // end of namespace sw::annotation
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx
index 8cef565545ff..4407e1c6fd34 100644
--- a/sw/source/ui/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -171,7 +169,7 @@ void AnnotationMenuButton::Paint( const Rectangle& /*rRect*/ )
aFont.SetWeight(WEIGHT_MEDIUM);
SetFont( aFont );
DrawText( aRect ,
- rtl::OUString::createFromAscii("Edit Note"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Edit Note")),
TEXT_DRAW_CENTER );
SetFont( aOldFont );
}
@@ -213,3 +211,4 @@ void AnnotationMenuButton::KeyInput( const KeyEvent& rKeyEvt )
} } // end of namespace sw::annotation
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/AnnotationMenuButton.hxx b/sw/source/ui/docvw/AnnotationMenuButton.hxx
index c74719f1cad4..a20eb86b0e02 100644
--- a/sw/source/ui/docvw/AnnotationMenuButton.hxx
+++ b/sw/source/ui/docvw/AnnotationMenuButton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -61,3 +58,5 @@ class AnnotationMenuButton : public MenuButton
} } // end of namespace sw::annotation
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index 7419ee060e29..e936496374e3 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -224,18 +222,18 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor());
aText = aRewriter.Apply(aText);
- aText.Append(String(rtl::OUString::createFromAscii(" (") +
- String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString::createFromAscii(", ") +
- String(rLocalData.getTime( pWin->GetTime(),false)) + rtl::OUString::createFromAscii("): \"")));
+ aText.Append(String(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) +
+ String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")) +
+ String(rLocalData.getTime( pWin->GetTime(),false)) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("): \""))));
GetOutlinerView()->InsertText(aText,false);
// insert old, selected text or "..."
// TOOD: iterate over all paragraphs, not only first one to find out if it is empty
- if (pText->GetTextObject().GetText(0) != String(rtl::OUString::createFromAscii("")))
+ if (pText->GetTextObject().GetText(0).Len())
GetOutlinerView()->GetEditView().InsertText(pText->GetTextObject());
else
- GetOutlinerView()->InsertText(rtl::OUString::createFromAscii("..."),false);
- GetOutlinerView()->InsertText(rtl::OUString::createFromAscii("\"\n"),false);
+ GetOutlinerView()->InsertText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("...")),false);
+ GetOutlinerView()->InsertText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")),false);
GetOutlinerView()->SetSelection(ESelection(0x0,0x0,0xFFFF,0xFFFF));
SfxItemSet aAnswerSet( DocView().GetDocShell()->GetPool() );
@@ -282,7 +280,7 @@ SvxLanguageItem SwAnnotationWin::GetLanguage(void)
case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE ; break;
case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
case SCRIPTTYPE_COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
- default: DBG_ERROR("GetLanguage: wrong script tye");
+ default: OSL_FAIL("GetLanguage: wrong script type");
}
return SvxLanguageItem(mpFld->GetLanguage(),nLangWhichId);
}
@@ -310,3 +308,5 @@ Time SwAnnotationWin::GetTime()
}
} } // end of namespace sw::annotation
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e093616f072a..a47a28e8b0d1 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,34 +98,10 @@
using namespace sw::sidebarwindows;
-/*
-bool comp_author( const SwPostItItem* a, const SwPostItItem* b)
-{
- return a->pFmtFld->GetFld()->GetPar1() < b->pFmtFld->GetFld()->GetPar1();
-}
-
-bool comp_date( const SwPostItItem* a, const SwPostItItem* b)
-{
- return static_cast<SwPostItField*>(a->pFmtFld->GetFld())->GetDate() < static_cast<SwPostItField*>(b->pFmtFld->GetFld())->GetDate();
-}
-*/
-
-//
bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
{
- // --> OD 2010-01-19 #i88070#
// sort by anchor position
-//// if position is on the same line, sort by x (Left) position, otherwise by y(Bottom) position
-//// if two notes are at the same position, sort by logical node position
-// return (a->maLayoutInfo.mPosition.Bottom() == b->maLayoutInfo.mPosition.Bottom())
-// ? ( ( (a->maLayoutInfo.mPosition.Left() == b->maLayoutInfo.mPosition.Left()) &&
-// (a->GetBroadCaster()->ISA(SwFmtFld) && b->GetBroadCaster()->ISA(SwFmtFld)) )
-// ? *(static_cast<SwFmtFld*>(a->GetBroadCaster())->GetTxtFld()->GetStart()) <
-// *(static_cast<SwFmtFld*>(b->GetBroadCaster())->GetTxtFld()->GetStart())
-// : a->maLayoutInfo.mPosition.Left() < b->maLayoutInfo.mPosition.Left() )
-// : a->maLayoutInfo.mPosition.Bottom() < b->maLayoutInfo.mPosition.Bottom();
return a->GetAnchorPosition() < b->GetAnchorPosition();
- // <--
}
SwPostItMgr::SwPostItMgr(SwView* pView)
@@ -175,7 +152,7 @@ SwPostItMgr::~SwPostItMgr()
RemoveSidebarWin();
EndListening( *mpView->GetDocShell() );
- for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++)
+ for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i)
delete (*i);
mPages.clear();
@@ -222,7 +199,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
{
if (bCheckExistance)
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->GetBroadCaster() == pItem )
return;
@@ -231,19 +208,14 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
mbLayout = bFocus;
if (pItem->ISA(SwFmtFld))
mvPostItFlds.push_back(new SwAnnotationItem(static_cast<SwFmtFld*>(pItem), true, bFocus) );
- /*
- else
- if (pItem->ISA(SwRedline))
- mvPostItFlds.push_back(new SwRedCommentItem( static_cast<SwRedline*>(pItem), true, bFocus)) ;
- */
- DBG_ASSERT(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new stuff was added");
+ OSL_ENSURE(pItem->ISA(SwFmtFld),"Mgr::InsertItem: seems like new stuff was added");
StartListening(*pItem);
}
void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
{
EndListening(*pBroadcast);
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->GetBroadCaster() == pBroadcast )
{
@@ -312,42 +284,13 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if ( mpView->GetDocShell() != &rBC )
{
// field to be removed is the broadcaster
- DBG_ERROR("Notification for removed SwFmtFld was not sent!");
+ OSL_FAIL("Notification for removed SwFmtFld was not sent!");
RemoveItem(&rBC);
}
break;
}
}
}
- /*
- else if ( rHint.IsA(TYPE(SwRedlineHint) ) )
- {
- const SwRedlineHint rRedlineHint = static_cast<const SwRedlineHint&>(rHint);
- SwRedline* pRedline = const_cast<SwRedline*>(rRedlineHint.GetRedline());
- switch ( rRedlineHint.Which() )
- {
- case SWREDLINE_INSERTED :
- {
- bool bEmpty = !HasNotes();
- InsertItem( pRedline, true, false );
- if (bEmpty && !mvPostItFlds.empty())
- PrepareView(true);
- break;
- }
- case SWREDLINE_REMOVED:
- {
- RemoveItem(pRedline);
- break;
- }
- case SWREDLINE_FOCUS:
- {
- if (rRedlineHint.GetView()== mpView)
- Focus(rBC);
- break;
- }
- }
- }
- */
else if ( rHint.IsA(TYPE(SwFmtFldHint) ) )
{
const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint);
@@ -371,7 +314,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- DBG_ERROR( "Inserted field not in document!" );
+ OSL_FAIL("Inserted field not in document!" );
}
break;
}
@@ -397,7 +340,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
case SWFMTFLD_CHANGED:
{
SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC);
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( pFmtFld == (*i)->GetBroadCaster() )
{
@@ -414,7 +357,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
case SWFMTFLD_LANGUAGE:
{
SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC);
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( pFmtFld == (*i)->GetBroadCaster() )
{
@@ -448,7 +391,7 @@ void SwPostItMgr::Focus(SfxBroadcaster& rBC)
mpView->ExecViewOptions(aRequest);
}
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
// field to get the focus is the broadcaster
if ( &rBC == (*i)->GetBroadCaster() )
@@ -482,12 +425,12 @@ bool SwPostItMgr::CalcRects()
PreparePageContainer();
if ( !mvPostItFlds.empty() )
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
SwSidebarItem* pItem = (*i);
if ( !pItem->UseElement() )
{
- DBG_ERROR("PostIt is not in doc or other wrong use");
+ OSL_FAIL("PostIt is not in doc or other wrong use");
bRepair = true;
continue;
}
@@ -500,7 +443,7 @@ bool SwPostItMgr::CalcRects()
SwPosition aPosition = pItem->GetAnchorPosition();
pItem->mLayoutStatus = SwPostItHelper::getLayoutInfos( aInfo, aPosition );
}
- if( aInfo.size() )
+ if( !aInfo.empty() )
{
pItem->maLayoutInfo = aInfo[0];
}
@@ -514,7 +457,7 @@ bool SwPostItMgr::CalcRects()
Sort(SORT_POS);
// sort the items into the right page vector, so layout can be done by page
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
SwSidebarItem* pItem = (*i);
if( SwPostItHelper::INVISIBLE == pItem->mLayoutStatus )
@@ -572,7 +515,7 @@ bool SwPostItMgr::CalcRects()
bool SwPostItMgr::HasScrollbars() const
{
- for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ((*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->HasScrollbar())
return true;
@@ -601,7 +544,7 @@ void SwPostItMgr::PreparePageContainer()
}
}
// only clear the list, DO NOT delete the objects itself
- for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++)
+ for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i)
{
(*i)->mList->clear();
if (mvPostItFlds.empty())
@@ -713,7 +656,7 @@ void SwPostItMgr::LayoutPostIts()
}
}
- if ((aVisiblePostItList.size()>0) && ShowNotes())
+ if ((!aVisiblePostItList.empty()) && ShowNotes())
{
bool bOldScrollbar = mPages[n]->bScrollbar;
if (ShowNotes())
@@ -770,17 +713,7 @@ void SwPostItMgr::LayoutPostIts()
(*i)->ShowAnchorOnly(Point(mPages[n]->mPageRect.Right(),
mPages[n]->mPageRect.Bottom()));
}
- DBG_ASSERT(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true");
- }
- }
-
- // do some magic so we really see the focused note
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
- {
- if ((*i)->HasChildPathFocus())
- {
- MakeVisible((*i),n+1);
- break;
+ OSL_ENSURE(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true");
}
}
}
@@ -810,7 +743,7 @@ void SwPostItMgr::LayoutPostIts()
SwSidebarItem* pItem = (*i);
if ( !pItem->UseElement() )
{
- DBG_ERROR("PostIt is not in doc!");
+ OSL_FAIL("PostIt is not in doc!");
bRepair = true;
continue;
}
@@ -843,13 +776,13 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
{
if ( mPages[aPage-1]->mList->empty() )
{
- DBG_ERROR("Notes SidePane painted but no rects and page lists calculated!");
+ OSL_FAIL("Notes SidePane painted but no rects and page lists calculated!");
return false;
}
SwSidebarItem_iterator aItem = mPages[aPage-1]->mList->end();
--aItem;
- DBG_ASSERT ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
+ OSL_ENSURE ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
if ((*aItem)->pPostIt)
{
const long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
@@ -862,7 +795,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
{
- DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
+ OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
// do not scroll more than neccessary up or down
if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && (lScroll<0)) )
return;
@@ -1004,9 +937,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
long lTopBorder = rBorder.Top() + 5;
long lBottomBorder = rBorder.Bottom() - 5;
const long lVisibleHeight = lBottomBorder - lTopBorder; //rBorder.GetHeight() ;
- long lSpaceUsed = 0;
long lTranslatePos = 0;
- int loop = 0;
bool bDone = false;
bool bScrollbars = false;
@@ -1036,6 +967,8 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
//start the real layout so nothing overlaps anymore
if (aVisiblePostItList.size()>1)
{
+ long lSpaceUsed = 0;
+ int loop = 0;
// if no window is moved anymore we are finished
while (!bDone)
{
@@ -1109,7 +1042,6 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
//(*i) is the last visible item
SwSidebarWin_iterator aPrevPostIt = i;
--aPrevPostIt;
- //lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)->VirtualSize().Height() + GetSpaceBetween() ) - (*i)->VirtualPos().Y();
lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)->VirtualSize().Height() ) - (*i)->VirtualPos().Y();
if (lTranslatePos > 0)
{
@@ -1141,7 +1073,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
// security check so we don't loop forever
if (loop>MAX_LOOP_COUNT)
{
- DBG_ERROR("PostItMgr::Layout(): We are looping forever");
+ OSL_FAIL("PostItMgr::Layout(): We are looping forever");
break;
}
}
@@ -1164,22 +1096,6 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
return bScrollbars;
}
-/*
-void SwPostItMgr::AddRedlineComments(bool bCheckExistance, bool bFocus)
-{
- bool bEmpty = mvPostItFlds.empty();
- const SwRedlineTbl& aTable = mpView->GetDocShell()->GetDoc()->GetRedlineTbl();
- for( sal_uInt16 i = 0; i < aTable.Count(); ++i )
- {
- SwRedline* pRedline = const_cast<SwRedline*>((aTable)[i]);
- if ( pRedline->GetComment() != String(rtl::OUString::createFromAscii("")) )
- InsertItem(pRedline, bCheckExistance, bFocus);
- }
- if (bEmpty && !mvPostItFlds.empty())
- PrepareView(true);
- }
- */
-
void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus)
{
bool bEmpty = mvPostItFlds.empty();
@@ -1205,7 +1121,7 @@ void SwPostItMgr::RemoveSidebarWin()
{
if (!mvPostItFlds.empty())
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
EndListening( *((*i)->GetBroadCaster()) );
if ((*i)->pPostIt)
@@ -1237,12 +1153,12 @@ void SwPostItMgr::Delete(String aAuthor)
std::vector<SwFmtFld*> aTmp;
aTmp.reserve( mvPostItFlds.size() );
- for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++)
+ for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt)
{
if ((*pPostIt)->GetFmtFld() && ((*pPostIt)->pPostIt->GetAuthor() == aAuthor) )
aTmp.push_back( (*pPostIt)->GetFmtFld() );
}
- for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++)
+ for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i)
{
mpWrtShell->GotoField( *(*i) );
mpWrtShell->DelRight();
@@ -1265,34 +1181,17 @@ void SwPostItMgr::Delete()
std::vector<SwFmtFld*> aTmp;
aTmp.reserve( mvPostItFlds.size() );
- for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++)
+ for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt)
{
if ((*pPostIt)->GetFmtFld())
aTmp.push_back( (*pPostIt)->GetFmtFld() );
}
- for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++)
+ for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i)
{
mpWrtShell->GotoField( *(*i) );
mpWrtShell->DelRight();
}
-/*
- for(std::list<SwPostItItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
- {
- SwPostItItem* pItem = (*i);
- // stop listening, we delete ourselves
- EndListening( *(pItem->pFmtFld) );
- // delete the actual SwPostItField
- mpWrtShell->GotoField(*pItem->pFmtFld);
- mpWrtShell->DelRight();
- // delete visual representation
- delete pItem->pPostIt;
- // delete struct saving the pointers
- delete pItem;
- }
- mvPostItFlds.clear();
-*/
-
mpWrtShell->EndUndo();
PrepareView();
mpWrtShell->EndAllAction();
@@ -1300,26 +1199,6 @@ void SwPostItMgr::Delete()
CalcRects();
LayoutPostIts();
}
-#if 0
-void SwPostItMgr::Hide(SwPostItField* pPostItField )
-{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
- {
- if ((*i)->GetFmtFld())
- {
- SwPostItField* pField = static_cast<SwPostItField*>((*i)->GetFmtFld()->GetFld());
- if (pPostItField==pField)
- {
- (*i)->bShow = false;
- (*i)->pPostIt->HideNote();
- break;
- }
- }
- }
-
- LayoutPostIts();
-}
-#endif
void SwPostItMgr::Hide( const String& rAuthor )
{
for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
@@ -1362,21 +1241,13 @@ void SwPostItMgr::Sort(const short aType)
case SORT_POS:
mvPostItFlds.sort(comp_pos);
break;
- /*
- case SORT_AUTHOR:
- mvPostItFlds.sort(comp_author);
- break;
- case SORT_DATE:
- mvPostItFlds.sort(comp_date);
- break;
- */
}
}
}
SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) const
{
- for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->GetBroadCaster() == pBroadcaster)
return (*i)->pPostIt;
@@ -1386,7 +1257,7 @@ SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) co
sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItField* pFld) const
{
- for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld() == pFld))
return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt);
@@ -1459,7 +1330,7 @@ long SwPostItMgr::GetNextBorder()
}
}
- DBG_ERROR("SwPostItMgr::GetNextBorder(): We have to find a next border here");
+ OSL_FAIL("SwPostItMgr::GetNextBorder(): We have to find a next border here");
return -1;
}
@@ -1521,7 +1392,6 @@ void SwPostItMgr::PrepareView(bool bIgnoreCount)
if (!HasNotes() || bIgnoreCount)
{
mpWrtShell->StartAllAction();
- //mpEditWin->Invalidate(); // really not needed anymore??
SwRootFrm* pLayout = mpWrtShell->GetLayout();
if ( pLayout )
SwPostItHelper::setSidebarChanged( pLayout,
@@ -1549,7 +1419,7 @@ bool SwPostItMgr::IsHit(const Point &aPointPixel)
if( nPageNum )
{
Rectangle aRect;
- DBG_ASSERT(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
+ OSL_ENSURE(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
aRect = mPages[nPageNum-1]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT
? Rectangle(Point(aPageFrm.Left()-GetSidebarWidth()-GetSidebarBorderWidth(),aPageFrm.Top()),Size(GetSidebarWidth(),aPageFrm.Height()))
: Rectangle( Point(aPageFrm.Right()+GetSidebarBorderWidth(),aPageFrm.Top()) , Size(GetSidebarWidth(),aPageFrm.Height()));
@@ -1642,14 +1512,13 @@ void SwPostItMgr::CorrectPositions()
return;
// yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it
- // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists.
+ // check, if anchor overlay object exists.
const long aAnchorX = pFirstPostIt->Anchor()
? mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X()
: 0;
const long aAnchorY = pFirstPostIt->Anchor()
? mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1
: 0;
- // <--
if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel())
{
long aAnchorPosX = 0;
@@ -1658,9 +1527,8 @@ void SwPostItMgr::CorrectPositions()
{
for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
{
- // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists.
+ // check, if anchor overlay object exists.
if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() )
- // <--
{
aAnchorPosX = mPages[n]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT
? mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSeventhPosition().getX()),0)).X()
@@ -1716,7 +1584,7 @@ Color SwPostItMgr::GetColorDark(sal_uInt16 aAuthorIndex)
COL_AUTHOR4_NORMAL, COL_AUTHOR5_NORMAL, COL_AUTHOR6_NORMAL,
COL_AUTHOR7_NORMAL, COL_AUTHOR8_NORMAL, COL_AUTHOR9_NORMAL };
- return Color( aArrayNormal[ aAuthorIndex % (sizeof( aArrayNormal )/ sizeof( aArrayNormal[0] ))]);
+ return Color( aArrayNormal[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayNormal))]);
}
else
return Color(COL_WHITE);
@@ -1731,7 +1599,7 @@ Color SwPostItMgr::GetColorLight(sal_uInt16 aAuthorIndex)
COL_AUTHOR4_LIGHT, COL_AUTHOR5_LIGHT, COL_AUTHOR6_LIGHT,
COL_AUTHOR7_LIGHT, COL_AUTHOR8_LIGHT, COL_AUTHOR9_LIGHT };
- return Color( aArrayLight[ aAuthorIndex % (sizeof( aArrayLight )/ sizeof( aArrayLight[0] ))]);
+ return Color( aArrayLight[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayLight))]);
}
else
return Color(COL_WHITE);
@@ -1746,7 +1614,7 @@ Color SwPostItMgr::GetColorAnchor(sal_uInt16 aAuthorIndex)
COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK,
COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK };
- return Color( aArrayAnchor[ aAuthorIndex % (sizeof( aArrayAnchor ) / sizeof( aArrayAnchor[0] ))]);
+ return Color( aArrayAnchor[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayAnchor))]);
}
else
return Color(COL_WHITE);
@@ -1780,7 +1648,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/ )
mnEventId = 0;
if ( mbLayouting )
{
- DBG_ERROR("Reentrance problem in Layout Manager!");
+ OSL_FAIL("Reentrance problem in Layout Manager!");
mbWaitingForCalcRects = false;
return 0;
}
@@ -1796,7 +1664,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/ )
void SwPostItMgr::Rescale()
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
if ( (*i)->pPostIt )
(*i)->pPostIt->Rescale();
}
@@ -1833,21 +1701,21 @@ sal_Int32 SwPostItMgr::GetSidebarScrollerHeight() const
void SwPostItMgr::SetSpellChecking()
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
if ( (*i)->pPostIt )
(*i)->pPostIt->SetSpellChecking();
}
void SwPostItMgr::SetReadOnlyState()
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
if ( (*i)->pPostIt )
(*i)->pPostIt->SetReadonly( mbReadOnly );
}
void SwPostItMgr::CheckMetaText()
{
- for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
if ( (*i)->pPostIt )
(*i)->pPostIt->CheckMetaText();
@@ -1902,7 +1770,6 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st
void SwPostItMgr::AssureStdModeAtShell()
{
- //#i103373# #i103645#
// deselect any drawing or frame and leave editing mode
SdrView* pSdrView = mpWrtShell->GetDrawView();
if ( pSdrView && pSdrView->IsTextEdit() )
@@ -2043,3 +1910,5 @@ void SwPostItMgr::GetAllSidebarWinForFrm( const SwFrm& rFrm,
void SwNoteProps::Commit() {}
void SwNoteProps::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/ShadowOverlayObject.cxx b/sw/source/ui/docvw/ShadowOverlayObject.cxx
index b11fc914b5fd..0c60340e659b 100644
--- a/sw/source/ui/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/ui/docvw/ShadowOverlayObject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: postit.cxx,v $
- * $Revision: 1.8.42.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -266,3 +264,4 @@ void ShadowOverlayObject::SetPosition( const basegfx::B2DPoint& rPoint1,
} } // end of namespace sw::sidebarwindows
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/ShadowOverlayObject.hxx b/sw/source/ui/docvw/ShadowOverlayObject.hxx
index a00aea380fdb..d33f0c69d671 100644
--- a/sw/source/ui/docvw/ShadowOverlayObject.hxx
+++ b/sw/source/ui/docvw/ShadowOverlayObject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -78,3 +75,5 @@ class ShadowOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition
} } // end of namespace sw::sidebarwindows
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index b0cc39372dd7..473c7b872bb4 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -362,7 +360,6 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt )
//!! call different Execute function to get rid of the new thesaurus sub menu
//!! pointer created in the call to Popup.
//!! Otherwise we would have a memory leak (see also #i107205#)
- //((PopupMenu*)pMgr->GetSVMenu())->Execute( this, aPos );
pMgr->Execute( aPos, this );
delete pMgr;
}
@@ -425,3 +422,4 @@ css::uno::Reference< css::accessibility::XAccessible > SidebarTxtControl::Create
} } // end of namespace sw::sidebarwindows
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarTxtControl.hxx b/sw/source/ui/docvw/SidebarTxtControl.hxx
index 08a5de0003c4..e536cee4a2c2 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.hxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -37,7 +34,7 @@
class OutlinerView;
class SwView;
class SwPostItMgr;
-class SpellCallbackInfo;
+struct SpellCallbackInfo;
namespace sw { namespace sidebarwindows {
@@ -85,3 +82,5 @@ class SidebarTxtControl : public Control
} } // end of namespace sw::sidebarwindows
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
index 66b0bc88335c..52ddacabb3df 100644
--- a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -180,7 +178,7 @@ class SidebarTxtControlAccessibleContext : public VCLXAccessibleComponent
SidebarTxtControl& mrSidebarTxtControl;
::accessibility::AccessibleTextHelper* mpAccessibleTextHelper;
- ::vos::OMutex maMutex;
+ ::osl::Mutex maMutex;
void defunc();
};
@@ -211,7 +209,7 @@ void SidebarTxtControlAccessibleContext::defunc()
sal_Int32 SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChildCount()
throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
sal_Int32 nChildCount( 0 );
@@ -226,7 +224,7 @@ sal_Int32 SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChildCount()
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChild( sal_Int32 i )
throw ( css::lang::IndexOutOfBoundsException, css::uno::RuntimeException )
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
css::uno::Reference< css::accessibility::XAccessible > xChild;
@@ -242,7 +240,7 @@ void SAL_CALL SidebarTxtControlAccessibleContext::addEventListener (
const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener)
throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if ( mpAccessibleTextHelper )
{
@@ -254,7 +252,7 @@ void SAL_CALL SidebarTxtControlAccessibleContext::removeEventListener (
const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener)
throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if ( mpAccessibleTextHelper )
{
@@ -315,3 +313,4 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SidebarTxtControlA
} } // end of namespace sw::sidebarwindows
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.hxx b/sw/source/ui/docvw/SidebarTxtControlAcc.hxx
index 57edc50512d5..d711c2dd6bd3 100644
--- a/sw/source/ui/docvw/SidebarTxtControlAcc.hxx
+++ b/sw/source/ui/docvw/SidebarTxtControlAcc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -54,3 +51,5 @@ class SidebarTxtControlAccessible : public VCLXWindow
} } // end of namespace sw::sidebarwindows
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index 2deb8889c419..4b08ab53bcb2 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,7 +93,7 @@ namespace sw { namespace sidebarwindows {
#define POSTIT_SHADOW_BRIGHT Color(180,180,180)
#define POSTIT_SHADOW_DARK Color(83,83,83)
-#define EMPTYSTRING rtl::OUString::createFromAscii("")
+#define EMPTYSTRING rtl::OUString()
/************** SwSidebarWin************************************/
SwSidebarWin::SwSidebarWin( SwEditWin& rEditWin,
@@ -399,7 +400,7 @@ void SwSidebarWin::CheckMetaText()
else if (sMeta.Len() > 22)
{
sMeta.Erase(20);
- sMeta = sMeta + rtl::OUString::createFromAscii("...");
+ sMeta = sMeta + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("..."));
}
if ( mpMetadataAuthor->GetText() != sMeta )
{
@@ -425,7 +426,7 @@ void SwSidebarWin::CheckMetaText()
}
if (GetTime()!=0)
{
- sMeta = sMeta + rtl::OUString::createFromAscii(" ") + rLocalData.getTime( GetTime(),false );
+ sMeta = sMeta + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) + rLocalData.getTime( GetTime(),false );
}
if ( mpMetadataDate->GetText() != sMeta )
{
@@ -492,8 +493,7 @@ void SwSidebarWin::SetPosAndSize()
}
break;
default:
- ASSERT( false,
- "<SwSidebarWin::SetPosAndSize()> - unexpected position of sidebar" );
+ OSL_FAIL( "<SwSidebarWin::SetPosAndSize()> - unexpected position of sidebar" );
break;
}
@@ -555,25 +555,22 @@ void SwSidebarWin::SetPosAndSize()
{
if (IsFollow() && !HasChildPathFocus())
{
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( mpAnchor )
{
mpAnchor->SetAnchorState(AS_END);
}
- // <--
}
else
{
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( mpAnchor )
{
mpAnchor->SetAnchorState(AS_ALL);
}
- // <--
SwSidebarWin* pWin = GetTopReplyNote();
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pWin && pWin->Anchor() )
- // <--
{
pWin->Anchor()->SetAnchorState(AS_END);
}
@@ -757,7 +754,7 @@ void SwSidebarWin::SetColor(Color aColorDark,Color aColorLight, Color aColorAnch
AllSettings aSettings2 = mpVScrollbar->GetSettings();
StyleSettings aStyleSettings2 = aSettings2.GetStyleSettings();
aStyleSettings2.SetButtonTextColor(Color(0,0,0));
- aStyleSettings2.SetCheckedColor(mColorLight); //hintergund
+ aStyleSettings2.SetCheckedColor(mColorLight); // backgound
aStyleSettings2.SetShadowColor(mColorAnchor);
aStyleSettings2.SetFaceColor(mColorDark);
aSettings2.SetStyleSettings(aStyleSettings2);
@@ -996,11 +993,7 @@ IMPL_LINK( SwSidebarWin, WindowEventListener, VclSimpleEvent*, pEvent )
}
else if ( pMouseEvt->IsLeaveWindow())
{
- if (IsPreview())
- {
- //doLazyDelete();
- }
- else
+ if (!IsPreview())
{
mbMouseOver = false;
if ( !HasFocus() )
@@ -1055,18 +1048,14 @@ IMPL_LINK(SwSidebarWin, ScrollHdl, ScrollBar*, pScroll)
return 0;
}
-IMPL_LINK(SwSidebarWin, ModifyHdl, void*, pVoid)
+IMPL_LINK(SwSidebarWin, ModifyHdl, void*, EMPTYARG)
{
- // no warnings, please
- pVoid=0;
mrView.GetDocShell()->SetModified(sal_True);
return 0;
}
-IMPL_LINK(SwSidebarWin, DeleteHdl, void*, pVoid)
+IMPL_LINK(SwSidebarWin, DeleteHdl, void*, EMPTYARG)
{
- // no warnings, please
- pVoid=0;
mnEventId = 0;
Delete();
return 0;
@@ -1135,9 +1124,8 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
{
mpAnchor->SetAnchorState(AS_ALL);
SwSidebarWin* pWin = GetTopReplyNote();
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pWin && pWin->Anchor() )
- // <--
{
pWin->Anchor()->SetAnchorState(AS_END);
}
@@ -1168,10 +1156,9 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
SwSidebarWin* pTopWinActive = mrMgr.HasActiveSidebarWin()
? mrMgr.GetActiveSidebarWin()->GetTopReplyNote()
: 0;
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pTopWinSelf && ( pTopWinSelf != pTopWinActive ) &&
pTopWinSelf->Anchor() )
- // <--
{
if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() )
{
@@ -1256,7 +1243,7 @@ void SwSidebarWin::ChangeSidebarItem( SwSidebarItem& rSidebarItem )
{
SidebarWinAccessible* pAcc =
static_cast<SidebarWinAccessible*>( GetWindowPeer() );
- ASSERT( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
+ OSL_ENSURE( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
"<SwSidebarWin::ChangeSidebarItem(..)> - unexpected type of window peer -> crash possible!" );
pAcc->ChangeSidebarItem( mrSidebarItem );
}
@@ -1283,110 +1270,4 @@ css::uno::Reference< css::accessibility::XAccessible > SwSidebarWin::CreateAcces
} } // eof of namespace sw::sidebarwindows
-/********** SwRedComment**************/
-/*
-SwRedComment::SwRedComment( Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits,SwRedline* pRed)
- : SwSidebarWin(pParent,nBits,aMgr,aBits),
- pRedline(pRed)
-{
-}
-
-void SwRedComment::SetPopup()
-{
- mpButtonPopup = new PopupMenu(SW_RES(MN_REDCOMMENT_BUTTON));
- //mpButtonPopup->SetMenuFlags(MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES);
-}
-
-void SwRedComment::UpdateData()
-{
- if ( Engine()->IsModified() )
- {
- // so we get a new layout of notes (Anchor position is still the same and we would otherwise not get one)
- Mgr()->SetLayout();
- // SetRedline is calling SetModified already
- DocView()->GetWrtShell().SetRedlineComment(Engine()->GetEditEngine().GetText());
- }
- Engine()->ClearModifyFlag();
- Engine()->GetUndoManager().Clear();
-}
-
-void SwRedComment::SetPostItText()
-{
- Engine()->SetModifyHdl( Link() );
- Engine()->EnableUndo( sal_False );
-
- Engine()->Clear();
- View()->SetAttribs(DefaultItem());
- View()->InsertText(pRedline->GetComment(),false);
-
- Engine()->ClearModifyFlag();
- Engine()->GetUndoManager().Clear();
- Engine()->EnableUndo( sal_True );
- Engine()->SetModifyHdl( LINK( this, SwSidebarWin, ModifyHdl ) );
- Invalidate();
-}
-
-void SwRedComment::DeactivatePostIt()
-{
- SwSidebarWin::DeactivatePostIt();
- // current Redline is still selected
- DocView()->GetWrtShellPtr()->ClearMark();
-}
-
-void SwRedComment::ActivatePostIt()
-{
- SwSidebarWin::ActivatePostIt();
-
- // do we want the redline selected?
- // otherwise, SwRedComment::ActivatePostIt() as well as SwRedComment::DeactivatePostIt()
- // can be thrown out completly
- DocView()->GetDocShell()->GetWrtShell()->GotoRedline(
- DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData()),true);
-}
-
-void SwRedComment::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if (mRectMetaButton.IsInside(PixelToLogic(rMEvt.GetPosPixel())) && rMEvt.IsLeft())
- {
- ExecuteCommand( mpButtonPopup->Execute( this,Rectangle(LogicToPixel(mRectMetaButton.BottomLeft()),LogicToPixel(mRectMetaButton.BottomLeft())),POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE) );
- }
-}
-
-void SwRedComment::Delete()
-{
- SwSidebarWin::Delete();
- // we are not neccessarily on our redline, so let's move there
- GotoPos();
- DocView()->GetWrtShell().SetRedlineComment(EMPTYSTRING);
- DocView()->GetWrtShell().ClearMark();
- // so we get a new layout of notes (Anchor position is still the same and we would otherwise not get one)
- Mgr()->SetLayout();
- Mgr()->RemoveItem(pRedline);
-}
-
-void SwRedComment::GotoPos()
-{
- DocView()->GetDocShell()->GetWrtShell()->GotoRedline(
- DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData()));
-}
-
-String SwRedComment::GetAuthor()
-{
- return pRedline->GetAuthorString();
-}
-
-Date SwRedComment::GetDate()
-{
- return pRedline->GetTimeStamp().GetDate();
-}
-
-Time SwRedComment::GetTime()
-{
- return pRedline->GetTimeStamp().GetTime();
-}
-
-bool SwRedComment::IsProtected()
-{
- return SwSidebarWin::IsProtected() || pRedline->Start()->nNode.GetNode().GetTxtNode()->IsInProtectSect();
-}
-*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarWinAcc.cxx b/sw/source/ui/docvw/SidebarWinAcc.cxx
index 214913963dcb..1702a3e6f4c4 100644
--- a/sw/source/ui/docvw/SidebarWinAcc.cxx
+++ b/sw/source/ui/docvw/SidebarWinAcc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* *
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -66,7 +64,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
void ChangeAnchor( const SwFrm* pAnchorFrm )
{
- vos::OGuard aGuard(maMutex);
+ osl::MutexGuard aGuard(maMutex);
mpAnchorFrm = pAnchorFrm;
}
@@ -74,7 +72,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
getAccessibleParent() throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard(maMutex);
+ osl::MutexGuard aGuard(maMutex);
css::uno::Reference< css::accessibility::XAccessible > xAccParent;
@@ -89,7 +87,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard(maMutex);
+ osl::MutexGuard aGuard(maMutex);
sal_Int32 nIndex( -1 );
@@ -107,7 +105,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
ViewShell& mrViewShell;
const SwFrm* mpAnchorFrm;
- ::vos::OMutex maMutex;
+ ::osl::Mutex maMutex;
};
// =============================================================================
@@ -160,3 +158,4 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SidebarWinAccessib
} } // end of namespace sw::sidebarwindows
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/SidebarWinAcc.hxx b/sw/source/ui/docvw/SidebarWinAcc.hxx
index 0abe1acbfaf5..e99b212c247b 100644
--- a/sw/source/ui/docvw/SidebarWinAcc.hxx
+++ b/sw/source/ui/docvw/SidebarWinAcc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -65,3 +62,5 @@ class SidebarWinAccessible : public VCLXWindow
} } // end of namespace sw::sidebarwindows
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/annotation.hrc b/sw/source/ui/docvw/annotation.hrc
index e43a90342409..f844b2829676 100644
--- a/sw/source/ui/docvw/annotation.hrc
+++ b/sw/source/ui/docvw/annotation.hrc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sw/source/ui/docvw/annotation.src b/sw/source/ui/docvw/annotation.src
index 8dcda9c25b8c..a727eae66dfb 100644
--- a/sw/source/ui/docvw/annotation.src
+++ b/sw/source/ui/docvw/annotation.src
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sw/source/ui/docvw/docvw.hrc b/sw/source/ui/docvw/docvw.hrc
index c0f15291795b..9a8987c3f0cb 100644
--- a/sw/source/ui/docvw/docvw.hrc
+++ b/sw/source/ui/docvw/docvw.hrc
@@ -52,7 +52,7 @@
#define MN_READONLY_RELOAD (RC_DOCVW_BEGIN + 22)
#define MN_READONLY_COPY (RC_DOCVW_BEGIN + 23)
-//Bei den folgenden brauchen wir Luft fuer die Gallery-Themen
+//For the following we need space for the gallery-themes
#define MN_READONLY_GRAPHICTOGALLERY (RC_DOCVW_BEGIN + 24)
#define MN_READONLY_BACKGROUNDTOGALLERY (RC_DOCVW_BEGIN + 60)
diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src
index 459b673cb188..b4f57bbcc215 100644
--- a/sw/source/ui/docvw/docvw.src
+++ b/sw/source/ui/docvw/docvw.src
@@ -162,9 +162,6 @@ Menu MN_READONLY_POPUP
{
Identifier = MN_READONLY_COPYGRAPHIC ;
HelpID = HID_MN_READONLY_COPYGRAPHIC ;
- /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */
- /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */
- /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */
Text [ en-US ] = "Copy ~Graphics" ;
};
SEPARATOR
diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index 501394255fde..c5589a57d351 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,6 @@
#include <svx/svdview.hxx>
#include <editeng/outliner.hxx>
-//#ifndef _SVDVMARK_HXX //autogen
-//#include <svx/svdvmark.hxx>
-//#endif
#include <svx/svdobj.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
@@ -47,15 +45,11 @@
#include <frmfmt.hxx>
#include <wrtsh.hxx>
#include <edtwin.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <swdtflvr.hxx>
#include <swmodule.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <wdocsh.hxx>
#include <swundo.hxx>
@@ -106,14 +100,13 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel )
SdrObject *pObj = NULL;
Point aDocPos( PixelToLogic( rPosPixel ) );
if ( !rSh.IsInSelect() && rSh.ChgCurrPam( aDocPos, sal_True, sal_True))
- //Wir sind nicht beim Selektieren und stehen auf einer
- //Selektion
+ //We are not selecting and aren't at a selection
bStart = sal_True;
else if ( !bFrmDrag && rSh.IsSelFrmMode() &&
rSh.IsInsideSelectedObj( aDocPos ) )
{
- //Wir sind nicht am internen Draggen und stehen auf
- //einem Objekt (Rahmen, Zeichenobjekt)
+ //We are not dragging internally and are not at an
+ //object (frame, draw object)
bStart = sal_True;
}
@@ -179,7 +172,7 @@ void SwEditWin::DropCleanup()
{
SwWrtShell &rSh = rView.GetWrtShell();
- // Stati zuruecksetzen
+ // reset statuses
bNoInterrupt = sal_False;
if ( bOldIdleSet )
{
@@ -204,7 +197,7 @@ void SwEditWin::CleanupDropUserMarker()
}
-//Messehack (MA,MBA)
+//exhibition hack (MA,MBA)
void lcl_SelectShellForDrop( SwView &rView )
{
if ( !rView.GetCurShell() )
@@ -217,7 +210,7 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt )
DropCleanup();
sal_Int8 nRet = DND_ACTION_NONE;
- //Ein Drop auf eine offene OutlinerView geht uns nichts an (siehe auch QueryDrop)
+ //A Drop to an open OutlinerView doesn't concern us (also see QueryDrop)
SwWrtShell &rSh = rView.GetWrtShell();
const Point aDocPt( PixelToLogic( rEvt.maPosPixel ));
SdrObject *pObj = 0;
@@ -232,14 +225,13 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt )
if ( aRect.IsInside(aPos) )
{
rSh.StartAllAction();
-//!! sal_Int8 nRet = DND_ACTION_NONE/*pOLV->ExecuteDrop( rEvt )*/;
rSh.EndAllAction();
return nRet;
}
}
- // dvo 2002-05-27, #99027#: There's a special treatment for file lists with a single
+ // There's a special treatment for file lists with a single
// element, that depends on the actual content of the
// Transferable to be accessible. Since the transferable
// may only be accessed after the drop has been accepted
@@ -253,7 +245,6 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt )
GetDataFlavorExVector(),
m_nDropDestination,
rEvt.mnAction,
-//!! rEvt.GetSourceOptions(),
nUserOpt, m_nDropFormat, nEventAction, 0,
&rEvt.maDropEvent.Transferable );
@@ -262,10 +253,9 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt )
nRet = rEvt.mnAction;
if( !SwTransferable::PasteData( aData, rSh, m_nDropAction, m_nDropFormat,
m_nDropDestination, sal_False, rEvt.mbDefault, &aDocPt, nRet))
-//!! nRet = SFX_APP()->ExecuteDrop( rEvt );
nRet = DND_ACTION_NONE;
else if ( SW_MOD()->pDragDrop )
- //Bei internem D&D nicht mehr aufraeumen!
+ //Don't clean up anymore at internal D&D!
SW_MOD()->pDragDrop->SetCleanUp( sal_False );
return nRet;
@@ -282,7 +272,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
SdrObject *pObj = NULL;
const ObjCntType eType = rSh.GetObjCntType( aDocPt, pObj );
- //Drop auf OutlinerView (TextEdit im Drawing) soll diese selbst entscheiden!
+ //Drop to OutlinerView (TextEdit in Drawing) should decide it on its own!
if( pObj )
{
OutlinerView* pOLV = rSh.GetDrawView()->GetTextEditOutlinerView();
@@ -296,10 +286,10 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
}
}
- //Auf was wollen wir denn gerade droppen?
+ //What do we want to drop on now?
sal_uInt16 nDropDestination = 0;
- //Sonst etwas aus der DrawingEngine getroffen?
+ //Did anything else arrive from the DrawingEngine?
if( OBJCNT_NONE != eType )
{
switch ( eType )
@@ -332,7 +322,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
case OBJCNT_URLBUTTON: nDropDestination = EXCHG_DEST_DOC_URLBUTTON; break;
case OBJCNT_GROUPOBJ: nDropDestination = EXCHG_DEST_DOC_GROUPOBJ; break;
- default: ASSERT( !this, "new ObjectType?" );
+ default: OSL_ENSURE( !this, "new ObjectType?" );
}
}
if ( !nDropDestination )
@@ -410,19 +400,18 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
GetDataFlavorExVector(),
m_nDropDestination,
rEvt.mnAction,
-//!! rEvt.GetSourceOptions(),
nUserOpt, m_nDropFormat, nEventAction );
if( EXCHG_INOUT_ACTION_NONE != m_nDropAction )
{
const Point aDocPt( PixelToLogic( aPixPt ) );
- //Bei den default Aktionen wollen wir noch ein bischen mitreden.
+ //With the default action we still want to have a say.
SwModule *pMod = SW_MOD();
if( pMod->pDragDrop )
{
sal_Bool bCleanup = sal_False;
- //Zeichenobjekte in Kopf-/Fusszeilen sind nicht erlaubt
+ //Drawing objects in Headers/Footers are not allowed
SwWrtShell *pSrcSh = pMod->pDragDrop->GetShell();
if( (pSrcSh->GetSelFrmType() == FRMTYPE_DRAWOBJ) &&
@@ -431,7 +420,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
{
bCleanup = sal_True;
}
- // keine positionsgeschuetzten Objecte verschieben!
+ // don't more position protected objects!
else if( DND_ACTION_MOVE == rEvt.mnAction &&
pSrcSh->IsSelObjProtected( FLYPROTECT_POS ) )
{
@@ -439,8 +428,8 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
}
else if( rEvt.mbDefault )
{
- // JP 13.08.98: internes Drag&Drop: bei gleichem Doc ein Move
- // ansonten ein Copy - Task 54974
+ // internal Drag&Drop: within same Doc a Move
+ // otherwise a Copy - Task 54974
nEventAction = pSrcSh->GetDoc() == rSh.GetDoc()
? DND_ACTION_MOVE
: DND_ACTION_COPY;
@@ -454,7 +443,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
}
else
{
- //D&D von ausserhalb des SW soll per default ein Copy sein.
+ //D&D from outside of SW should be a Copy per default.
if( EXCHG_IN_ACTION_DEFAULT == nEventAction &&
DND_ACTION_MOVE == rEvt.mnAction )
nEventAction = DND_ACTION_COPY;
@@ -501,7 +490,6 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
CleanupDropUserMarker();
rSh.UnSetVisCrsr();
-//!! return SFX_APP()->AcceptDrop( rEvt );
return DND_ACTION_NONE;
}
@@ -525,3 +513,4 @@ IMPL_LINK( SwEditWin, DDHandler, Timer *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3e2b9488927b..a7f86a6b6a0e 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <tools/list.hxx>
#include <swtypes.hxx>
#include <hintids.hxx>
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -120,19 +119,16 @@
#include <helpid.h>
#include <cmdid.h>
-#ifndef _DOCVW_HRC
#include <docvw.hrc>
-#endif
#include <uitool.hxx>
-// OD 18.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <charfmt.hxx>
#include <numrule.hxx>
#include <pagedesc.hxx>
-#include <svtools/ruler.hxx> // #i23726#
+#include <svtools/ruler.hxx>
#include "formatclipboard.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <IMark.hxx>
@@ -141,27 +137,23 @@
#include <PostItMgr.hxx>
-//JP 11.10.2001: enable test code for bug fix 91313
-#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1)
-//#define TEST_FOR_BUG91313
-#endif
+#include "../../core/inc/rootfrm.hxx"
using namespace sw::mark;
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Globals
+ Description: Globals
--------------------------------------------------------------------*/
static bool bInputLanguageSwitched = false;
extern sal_Bool bNoInterrupt; // in mainwn.cxx
-//Normalerweise wird im MouseButtonUp eine Selektion aufgehoben wenn die
-//Selektion nicht gerade aufgezogen wird. Leider wird im MouseButtonDown
-//bei doppel-/dreifach-Klick Selektiert, diese Selektion wird in dem Handler
-//komplett abgeschlossen und kann deshalb im Up nicht mehr unterschieden
-//werden. Um dies Aufzuloese wird bHoldSelection im Down gesetzt und im
-//Up ausgewertet.
+// Usually in MouseButtonUp a selection is revoked when the selection is
+// not currently being pulled open. Unfortunately in MouseButtonDown there
+// is being selected at double/triple click. That selection is completely
+// finished in the Handler and thus can't be distinguished in the Up.
+// To resolve this bHoldSelection is set in Down at evaluated in Up.
static sal_Bool bHoldSelection = sal_False;
sal_Bool bFrmDrag = sal_False;
@@ -179,8 +171,7 @@ long SwEditWin::nDDStartPosY = 0;
long SwEditWin::nDDStartPosX = 0;
Color SwEditWin::aTextBackColor(COL_YELLOW);
Color SwEditWin::aTextColor(COL_RED);
-sal_Bool SwEditWin::bTransparentBackColor = sal_False; // Hintergrund nicht transparent
-
+sal_Bool SwEditWin::bTransparentBackColor = sal_False; // background not transparent
extern sal_Bool bExecuteDrag;
@@ -193,17 +184,13 @@ class SwAnchorMarker
SdrHdl* pHdl;
Point aHdlPos;
Point aLastPos;
- // --> OD 2010-09-16 #i114522#
bool bTopRightHandle;
- // <--
public:
SwAnchorMarker( SdrHdl* pH )
: pHdl( pH )
, aHdlPos( pH->GetPos() )
, aLastPos( pH->GetPos() )
- // --> OD 2010-09-16 #i114522#
, bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR )
- // <--
{}
const Point& GetLastPos() const { return aLastPos; }
void SetLastPos( const Point& rNew ) { aLastPos = rNew; }
@@ -213,14 +200,11 @@ public:
void ChgHdl( SdrHdl* pNew )
{
pHdl = pNew;
- // --> OD 2010-09-16 #i114522#
if ( pHdl )
{
bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR);
}
- // <--
}
- // --> OD 2010-09-16 #i114522#
const Point GetPosForHitTest( const OutputDevice& rOut )
{
Point aHitTestPos( GetPos() );
@@ -237,7 +221,6 @@ public:
return aHitTestPos;
}
- // <--
};
struct QuickHelpData
@@ -271,12 +254,11 @@ struct QuickHelpData
void FillStrArr( SwWrtShell& rSh, const String& rWord );
};
-
/*--------------------------------------------------------------------
- Beschreibung: Minimale Bewegung Zittern vermeiden
+ Description: avoid minimal movement shiver
--------------------------------------------------------------------*/
-#define HIT_PIX 2 /* Hit-Toleranz in Pixel */
+#define HIT_PIX 2 /* hit tolerance in pixel */
#define MIN_MOVE 4
inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt)
@@ -286,10 +268,10 @@ inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt)
}
/*--------------------------------------------------------------------
- JP 30.07.98: fuer MouseButtonDown - feststellen, ob ein DrawObject
- und KEIN SwgFrame getroffen wurde! Shift/Ctrl sollen
- nur bei DrawObjecte zum Selektieren fuehren, bei SwgFlys
- ggfs zum ausloesen von Hyperlinks (DownLoad/NewWindow!)
+ for MouseButtonDown - determine whether a DrawObject
+ an NO SwgFrame was hit! Shift/Ctrl should only result
+ in selecting, with DrawObjects; at SwgFlys to trigger
+ hyperlinks if applicable (DownLoad/NewWindow!)
--------------------------------------------------------------------*/
inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt )
{
@@ -309,10 +291,9 @@ inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt )
}
/*--------------------------------------------------------------------
- Beschreibung: Pointer umschalten
+ Description: switch pointer
--------------------------------------------------------------------*/
-
void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
{
SwWrtShell &rSh = rView.GetWrtShell();
@@ -326,7 +307,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
delete pUserMarker;
pUserMarker = 0L;
}
-// rSh.SwCrsrShell::UnSetVisCrsr( rLPt );
eStyle = POINTER_NOTALLOWED;
}
else
@@ -345,7 +325,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
0 !=(pFmt = rSh.GetFmtFromObj( rLPt, &pRect )) &&
PTR_CAST(SwFlyFrmFmt, pFmt))
{
- //Highlight fuer Rahmen anwerfen
+ //turn on highlight for frame
Rectangle aTmp( pRect->SVRect() );
if ( !pUserMarker )
@@ -397,9 +377,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
return;
}
- // Removed ExecHyperlink option.
- //sal_Bool bExecHyperlinks = rSh.GetViewOptions()->IsExecHyperlinks() ^
- // (nModifier == KEY_MOD2 ? sal_True : sal_False);
sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
{
@@ -565,10 +542,9 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
}
/*--------------------------------------------------------------------
- Beschreibung: Timer fuer Selektion vergroessern
+ Description: increase timer for selection
--------------------------------------------------------------------*/
-
IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG )
{
DBG_PROFSTART(edithdl);
@@ -604,14 +580,13 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG )
else
(rSh.*rSh.fnSetCrsr)( &aModPt, sal_False );
- //fix(24138): Es kann sein, dass der "Sprung" ueber eine Tabelle so
- //nicht geschafft wird. Deshalb wir hier eben per Up/Down ueber die
- //Tabelle gesprungen.
+ // It can be that a "jump" over a table cannot be accomplished like
+ // that. So we jump over the table by Up/Down here.
const SwRect& rVisArea = rSh.VisArea();
if( aOldVis == rVisArea && !rSh.IsStartOfDoc() && !rSh.IsEndOfDoc() )
{
- //JP 11.10.2001 Bug 72294 - take the center point of VisArea to
- // decide in which direction the user want.
+ // take the center point of VisArea to
+ // decide in which direction the user want.
if( aModPt.Y() < ( rVisArea.Top() + rVisArea.Height() / 2 ) )
rSh.Up( sal_True, 1 );
else
@@ -625,11 +600,6 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwEditWin::JustifyAreaTimer()
{
const Rectangle &rVisArea = GetView().GetVisArea();
@@ -642,11 +612,7 @@ void SwEditWin::JustifyAreaTimer()
nDiff = Max(
Max( aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - aMovePos.Y() ),
Max( aMovePos.X() - rVisArea.Right(), rVisArea.Left() - aMovePos.X()));
-#ifdef TEST_FOR_BUG91313
- aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff) );
-#else
aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff*2L) );
-#endif
}
void SwEditWin::LeaveArea(const Point &rPos)
@@ -665,10 +631,9 @@ inline void SwEditWin::EnterArea()
}
/*------------------------------------------------------------------------
- Beschreibung: Modus fuer Rahmen einfuegen
+ Description: insert mode for frames
------------------------------------------------------------------------*/
-
void SwEditWin::InsFrm(sal_uInt16 nCols)
{
StdDrawMode( OBJ_NONE, sal_False );
@@ -676,15 +641,10 @@ void SwEditWin::InsFrm(sal_uInt16 nCols)
nInsFrmColCount = nCols;
}
-
-
void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
{
SetSdrDrawMode( eSdrObjectKind );
-/* if (GetDrawFuncPtr())
- GetDrawFuncPtr()->Deactivate();*/
-
if (bObjSelect)
rView.SetDrawFuncPtr(new DrawSelection( &rView.GetWrtShell(), this, &rView ));
else
@@ -695,13 +655,11 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
if (bObjSelect)
rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT );
else
- rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) ); // don't know if this is useful at all; but it keeps functionality as it was...
+ rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) );
bInsFrm = sal_False;
nInsFrmColCount = 1;
}
-
-
void SwEditWin::StopInsFrm()
{
if (rView.GetDrawFuncPtr())
@@ -709,13 +667,11 @@ void SwEditWin::StopInsFrm()
rView.GetDrawFuncPtr()->Deactivate();
rView.SetDrawFuncPtr(NULL);
}
- rView.LeaveDrawCreate(); // Konstruktionsmode verlassen
+ rView.LeaveDrawCreate(); // leave construction mode
bInsFrm = sal_False;
nInsFrmColCount = 1;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const SwPaM& rCrsr ) const
@@ -744,12 +700,109 @@ sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const
return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.Len());
}
+//return INVALID_HINT if language should not be explictly overridden, the correct
+//HintId to use for the eBufferLanguage otherwise
+sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView& rView,
+ const String &rInBuffer)
+{
+ sal_uInt16 nWhich = INVALID_HINT;
+ bool bLang = true;
+ if(eBufferLanguage != LANGUAGE_DONTKNOW)
+ {
+ switch( GetI18NScriptTypeOfLanguage( eBufferLanguage ))
+ {
+ case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
+ case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break;
+ case i18n::ScriptType::LATIN: nWhich = RES_CHRATR_LANGUAGE; break;
+ default: bLang = false;
+ }
+ if(bLang)
+ {
+ SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
+ SwWrtShell& rSh = rView.GetWrtShell();
+ rSh.GetCurAttr(aLangSet);
+ if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, sal_True))
+ {
+ LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
+ if ( eLang == eBufferLanguage )
+ {
+ // current language attribute equal to language reported from system
+ bLang = false;
+ }
+ else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich )
+ {
+ // special case: switching between two "LATIN" languages
+ // In case the current keyboard setting might be suitable
+ // for both languages we can't safely assume that the user
+ // wants to use the language reported from the system,
+ // except if we knew that it was explicitly switched (thus
+ // the check for "bInputLangeSwitched").
+ //
+ // The language reported by the system could be just the
+ // system default language that the user is not even aware
+ // of, because no language selection tool is installed at
+ // all. In this case the OOo language should get preference
+ // as it might have been selected by the user explicitly.
+ //
+ // Usually this case happens if the OOo language is
+ // different to the system language but the system keyboard
+ // is still suitable for the OOo language (e.g. writing
+ // English texts with a German keyboard).
+ //
+ // For non-latin keyboards overwriting the attribute is
+ // still valid. We do this for kyrillic and greek ATM. In
+ // future versions of OOo this should be replaced by a
+ // configuration switch that allows to give the preference
+ // to the OOo setting or the system setting explicitly
+ // and/or a better handling of the script type.
+ i18n::UnicodeScript eType = rInBuffer.Len() ?
+ (i18n::UnicodeScript)GetAppCharClass().getScript( rInBuffer, 0 ) :
+ i18n::UnicodeScript_kScriptCount;
+
+ bool bSystemIsNonLatin = false, bOOoLangIsNonLatin = false;
+ switch ( eType )
+ {
+ case i18n::UnicodeScript_kGreek:
+ case i18n::UnicodeScript_kCyrillic:
+ // in case other UnicodeScripts require special
+ // keyboards they can be added here
+ bSystemIsNonLatin = true;
+ break;
+ default:
+ break;
+ }
+
+ switch ( eLang )
+ {
+ case LANGUAGE_AZERI_CYRILLIC:
+ case LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
+ case LANGUAGE_BULGARIAN:
+ case LANGUAGE_GREEK:
+ case LANGUAGE_RUSSIAN:
+ case LANGUAGE_RUSSIAN_MOLDOVA:
+ case LANGUAGE_SERBIAN_CYRILLIC:
+ case LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
+ case LANGUAGE_UZBEK_CYRILLIC:
+ case LANGUAGE_UKRAINIAN:
+ case LANGUAGE_BELARUSIAN:
+ bOOoLangIsNonLatin = true;
+ break;
+ default:
+ break;
+ }
+
+ bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
+ }
+ }
+ }
+ }
+ return bLang ? nWhich : INVALID_HINT;
+}
/*--------------------------------------------------------------------
- Beschreibung: Der Character Buffer wird in das Dokument eingefuegt
+ Description: character buffer is inserted into the document
--------------------------------------------------------------------*/
-
void SwEditWin::FlushInBuffer()
{
if ( aInBuffer.Len() )
@@ -850,7 +903,7 @@ void SwEditWin::FlushInBuffer()
// as well, we now expand the selection accordingly.
SwPaM &rCrsr = *rSh.GetCrsr();
xub_StrLen nCrsrStartPos = rCrsr.Start()->nContent.GetIndex();
- DBG_ASSERT( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" );
+ OSL_ENSURE( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" );
if (nExpandSelection && nCrsrStartPos >= nExpandSelection)
{
if (!rCrsr.HasMark())
@@ -863,9 +916,9 @@ void SwEditWin::FlushInBuffer()
rView.GetViewFrame()->GetBindings().GetRecorder();
if ( xRecorder.is() )
{
- //Shell ermitteln
+ // determine shell
SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) );
- // Request generieren und recorden
+ // generate request and record
if (pSfxShell)
{
SfxRequest aReq( rView.GetViewFrame(), FN_INSERT_STRING );
@@ -873,84 +926,12 @@ void SwEditWin::FlushInBuffer()
aReq.Done();
}
}
- //#21019# apply CTL and CJK language to the text input
- sal_Bool bLang = true;
- if(eBufferLanguage != LANGUAGE_DONTKNOW)
- {
- sal_uInt16 nWhich = 0;
- switch( GetI18NScriptTypeOfLanguage( eBufferLanguage ))
- {
- case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
- case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break;
- case i18n::ScriptType::LATIN: nWhich = RES_CHRATR_LANGUAGE; break;
- default: bLang = sal_False;
- }
- if(bLang)
- {
- SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
- rSh.GetCurAttr(aLangSet);
- if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, sal_True))
- {
- LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
- if ( eLang == eBufferLanguage )
- // current language attribute equal to language reported from system
- bLang = sal_False;
- else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich /* && (eLang&LANGUAGE_MASK_PRIMARY) == LANGUAGE_ENGLISH */ )
- {
- // special case: switching between two "LATIN" languages
- // In case the current keyboard setting might be suitable for both languages we can't safely assume that the user
- // wants to use the language reported from the system, except if we knew that it was explicitly switched (thus the check for "bInputLangeSwitched").
- // The language reported by the system could be just the system default language that the user is not even aware of,
- // because no language selection tool is installed at all. In this case the OOo language should get preference as
- // it might have been selected by the user explicitly.
- // Usually this case happens if the OOo language is different to the system language but the system keyboard is still suitable
- // for the OOo language (e.g. writing English texts with a German keyboard).
- // For non-latin keyboards overwriting the attribute is still valid. We do this for kyrillic and greek ATM.
- // In future versions of OOo this should be replaced by a configuration switch that allows to give the preference to
- // the OOo setting or the system setting explicitly and/or a better handling of the script type.
- sal_Int16 nScript = GetAppCharClass().getScript( aInBuffer, 0 );
- i18n::UnicodeScript eType = (i18n::UnicodeScript) nScript;
-
- bool bSystemIsNonLatin = false, bOOoLangIsNonLatin = false;
- switch ( eType )
- {
- case i18n::UnicodeScript_kGreek:
- case i18n::UnicodeScript_kCyrillic:
- // in case other UnicodeScripts require special keyboards they can be added here
- bSystemIsNonLatin = true;
- break;
- default:
- break;
- }
-
- switch ( eLang )
- {
- case LANGUAGE_AZERI_CYRILLIC:
- case LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
- case LANGUAGE_BULGARIAN:
- case LANGUAGE_GREEK:
- case LANGUAGE_RUSSIAN:
- case LANGUAGE_RUSSIAN_MOLDOVA:
- case LANGUAGE_SERBIAN_CYRILLIC:
- case LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
- case LANGUAGE_UZBEK_CYRILLIC:
- case LANGUAGE_UKRAINIAN:
- case LANGUAGE_BELARUSIAN:
- bOOoLangIsNonLatin = true;
- break;
- default:
- break;
- }
- bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
- }
- }
- if(bLang)
- {
- SvxLanguageItem aLangItem( eBufferLanguage, nWhich );
- rSh.SetAttr( aLangItem );
- }
- }
+ sal_uInt16 nWhich = lcl_isNonDefaultLanguage(eBufferLanguage, rView, aInBuffer);
+ if (nWhich != INVALID_HINT )
+ {
+ SvxLanguageItem aLangItem( eBufferLanguage, nWhich );
+ rSh.SetAttr( aLangItem );
}
rSh.Insert( aInBuffer );
@@ -974,14 +955,11 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
SwWrtShell &rSh = rView.GetWrtShell();
SwRect aTmp = rSh.GetFlyRect();
if( aTmp.HasArea() &&
- // --> FME 2005-01-13 #i40348#
// IsSelObjProtected() seems to be the correct condition, not
// !HasReadonlySel(), otherwise frame is not moveable if content is
// protected.
!rSh.IsSelObjProtected( FLYPROTECT_POS|FLYPROTECT_SIZE ) )
- // <--
{
- // OD 18.09.2003 #i18732# - add item <RES_FOLLOW_TEXT_FLOW>
SfxItemSet aSet(rSh.GetAttrPool(),
RES_FRM_SIZE, RES_FRM_SIZE,
RES_VERT_ORIENT, RES_ANCHOR,
@@ -1009,13 +987,12 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
SwRect aBoundRect;
Point aRefPoint;
- // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
- // aligned to page for fly frame anchored to paragraph or to character.
+ // adjustment for allowing vertical position
+ // aligned to page for fly frame anchored to paragraph or to character.
{
SwFmtVertOrient aVert( (SwFmtVertOrient&)aSet.Get(RES_VERT_ORIENT) );
const bool bFollowTextFlow =
static_cast<const SwFmtFollowTextFlow&>(aSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue();
- // OD 12.11.2003 #i22341# - additional provide content position
const SwPosition* pToCharCntntPos = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetCntntAnchor();
rSh.CalcBoundRect( aBoundRect, eAnchorId,
text::RelOrientation::FRAME, aVert.GetRelationOrient(),
@@ -1034,12 +1011,12 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
case MOVE_UP_BIG:
case MOVE_UP_SMALL: aTmp.Top( aTmp.Top() - nUp ); break;
case MOVE_RIGHT_SMALL: if( aTmp.Width() < aSnap.Width() + MINFLY ) break;
- nRight = aSnap.Width(); // kein break
+ nRight = aSnap.Width(); // no break
case MOVE_RIGHT_BIG: aTmp.Left( aTmp.Left() + nRight ); break;
case MOVE_DOWN_SMALL: if( aTmp.Height() < aSnap.Height() + MINFLY ) break;
- nDown = aSnap.Height(); // kein break
+ nDown = aSnap.Height(); // no break
case MOVE_DOWN_BIG: aTmp.Top( aTmp.Top() + nDown ); break;
- default: ASSERT( sal_True, "ChangeFly: Unknown direction." );
+ default: OSL_ENSURE(true, "ChangeFly: Unknown direction." );
}
sal_Bool bSet = sal_False;
if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
@@ -1133,16 +1110,13 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
rSh.EndAllAction();
}
}
-/* -----------------------------23.05.2002 11:35------------------------------
- ---------------------------------------------------------------------------*/
void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
{
- // --> OD 2005-01-31 #i40845# - start undo action in order to get only one
+ // start undo action in order to get only one
// undo action for this change.
SwWrtShell &rSh = rView.GetWrtShell();
rSh.StartUndo();
- // <--
long nX = 0;
long nY = 0;
@@ -1206,16 +1180,14 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
// if the object's position is not protected
if(0 == (nProtect&FLYPROTECT_POS))
{
- // --> FME 2005-04-26 #i47138#
// Check if object is anchored as character and move direction
sal_Bool bDummy1, bDummy2;
const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 );
- const bool bHoriMove = !bVertAnchor == !( nDir % 2 );
- const bool bMoveAllowed =
+ bool bHoriMove = !bVertAnchor == !( nDir % 2 );
+ bool bMoveAllowed =
!bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR);
if ( bMoveAllowed )
{
- // <--
pSdrView->MoveAllMarked(Size(nX, nY));
rSh.SetModified();
}
@@ -1271,17 +1243,13 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
rSh.EndAllAction();
}
- // --> OD 2005-01-31 #i40845# - end undo action
rSh.EndUndo();
- // <--
}
/*--------------------------------------------------------------------
- Beschreibung: KeyEvents
+ Description: KeyEvents
--------------------------------------------------------------------*/
-
-
void SwEditWin::KeyInput(const KeyEvent &rKEvt)
{
if( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE &&
@@ -1294,9 +1262,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
SfxObjectShell *pObjSh = (SfxObjectShell*)rView.GetViewFrame()->GetObjectShell();
if ( bLockInput || (pObjSh && pObjSh->GetProgress()) )
- // Wenn die Rechenleiste aktiv ist oder
- // auf dem Document ein Progress laeuft wird keine
- // Bestellungen angenommen.
+ // When the progress bar is active or a progress is
+ // running on a document, no order is being taken
return;
if( pShadCrsr )
@@ -1322,12 +1289,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
pQuickHlpData->Stop( rSh );
}
- // OS:auch die DrawView braucht noch ein readonly-Flag
+ // OS:the DrawView also needs a readonly-Flag as well
if ( !bIsDocReadOnly && rSh.GetDrawView() && rSh.GetDrawView()->KeyInput( rKEvt, this ) )
{
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll( sal_False );
rSh.SetModified();
- return; // Event von der SdrView ausgewertet
+ return; // Event evaluated by SdrView
}
if ( rView.GetDrawFuncPtr() && bInsFrm )
@@ -1341,11 +1308,20 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
sal_Bool bChkInsBlank = pQuickHlpData->bChkInsBlank;
pQuickHlpData->bChkInsBlank = sal_False;
+#if OSL_DEBUG_LEVEL > 1
+ if (rKEvt.GetKeyCode().GetCode() == KEY_F12)
+ {
+ SwRootFrm* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout();
+ pLayout->dumpAsXml( );
+ return;
+ }
+#endif
+
KeyEvent aKeyEvent( rKEvt );
// look for vertical mappings
if( !bIsDocReadOnly && !rSh.IsSelFrmMode() && !rSh.IsObjSelected() )
{
- //JP 21.2.2002: must changed from switch to if, because the Linux
+ // must changed from switch to if, because the Linux
// compiler has problem with the code. Has to remove if the new general
// handler exist.
sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
@@ -1455,7 +1431,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
rView.GetViewFrame()->GetBindings().GetRecorder();
if ( !xRecorder.is() )
{
- pACfg = SvxAutoCorrCfg::Get();
+ pACfg = &SvxAutoCorrCfg::Get();
pACorr = pACfg->GetAutoCorrect();
}
@@ -1469,9 +1445,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
enum SW_KeyState { KS_Start,
KS_CheckKey, KS_InsChar, KS_InsTab,
KS_NoNum, KS_NumOff, KS_NumOrNoNum, KS_NumDown, KS_NumUp,
- // -> #i23725#
KS_NumIndentInc, KS_NumIndentDec,
- // <- #i23725#
KS_OutlineLvOff,
KS_NextCell, KS_PrevCell, KS_OutlineUp, KS_OutlineDown,
@@ -1509,20 +1483,16 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
KS_GotoPrevFieldMark,
KS_Ende };
-
-
SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys
: KS_CheckKey,
eNextKeyState = KS_Ende;
sal_uInt8 nDir = 0;
- // -> #i23725#
if (nKS_NUMDOWN_Count > 0)
nKS_NUMDOWN_Count--;
if (nKS_NUMINDENTINC_Count > 0)
nKS_NUMINDENTINC_Count--;
- // <- #i23725#
while( KS_Ende != eKeyState )
{
@@ -1531,12 +1501,11 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
switch( eKeyState )
{
case KS_CheckKey:
- eKeyState = KS_KeyToView; // default weiter zur View
+ eKeyState = KS_KeyToView; // default forward to View
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly
- // Bereichen
+ // for switching curor behaviour in ReadOnly regions
if( 0x7210 == rKeyCode.GetFullCode() )
rSh.SetReadOnlyAvailable( !rSh.IsReadOnlyAvailable() );
else
@@ -1545,16 +1514,16 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if( !rKeyCode.IsMod2() && '=' == aCh &&
!rSh.IsTableMode() && rSh.GetTableFmt() &&
- rSh.IsSttPara() /*&& rSh.IsEndPara()*/ &&
+ rSh.IsSttPara() &&
!rSh.HasReadonlySel() )
{
- // in der Tabelle am Anfang der Zelle ein '=' ->
- // EditZeile aufrufen (F2-Funktionalitaet)
+ // at the beginning of the table's cell a '=' ->
+ // call EditRow (F2-functionality)
rSh.Push();
if( !rSh.MoveSection( fnSectionCurr, fnSectionStart) &&
!rSh.IsTableBoxTextFormat() )
{
- // steht also am Anfang der Box
+ // is at the beginning of the box
eKeyState = KS_EditFormula;
if( rSh.HasMark() )
rSh.SwapPam();
@@ -1622,12 +1591,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
eFlyState = KS_Fly_Change;
nDir = MOVE_DOWN_SMALL;
goto KEYINPUT_CHECKTABLE;
-// case KEY_UP | KEY_MOD2 | KEY_SHIFT:
-// eKeyState = KS_ColTopBig;
-// goto KEYINPUT_CHECKTABLE;
-// case KEY_DOWN | KEY_MOD2 | KEY_SHIFT:
-// eKeyState = KS_ColTopSmall;
-// goto KEYINPUT_CHECKTABLE;
case KEY_UP | KEY_MOD2 | KEY_MOD1:
eKeyState = KS_CellBottomSmall;
@@ -1678,7 +1641,6 @@ KEYINPUT_CHECKTABLE:
nTblChgSize = pModOpt->GetTblVInsert();
}
goto KEYINPUT_CHECKTABLE_INSDEL;
-// case KEY_RIGHT:
case KEY_RIGHT | KEY_MOD1:
{
eTblChgMode = nsTblChgWidthHeightType::WH_FLAG_INSDEL | nsTblChgWidthHeightType::WH_CELL_RIGHT;
@@ -1721,7 +1683,7 @@ KEYINPUT_CHECKTABLE:
KEYINPUT_CHECKTABLE_INSDEL:
if( rSh.IsTableMode() || !rSh.GetTableFmt() ||
!bTblInsDelMode ||
- sal_False /* Tabelle geschuetzt */
+ sal_False /* table protected */
)
{
const int nSelectionType = rSh.GetSelectionType();
@@ -1745,9 +1707,17 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KEY_DELETE:
- if (rSh.IsInFrontOfLabel() &&
- rSh.NumOrNoNum(sal_False))
- eKeyState = KS_NumOrNoNum;
+ if ( !rSh.HasReadonlySel() )
+ {
+ if (rSh.IsInFrontOfLabel() &&
+ rSh.NumOrNoNum(sal_False))
+ eKeyState = KS_NumOrNoNum;
+ }
+ else
+ {
+ InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
+ eKeyState = KS_Ende;
+ }
break;
case KEY_DELETE | KEY_MOD2:
@@ -1789,7 +1759,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
aTmpQHD.bIsAutoText )
eKeyState = KS_GlossaryExpand;
- //RETURN und leerer Absatz in Numerierung -> Num. beenden
+ //RETURN and empty paragraph in numbering -> end numbering
else if( !aInBuffer.Len() &&
rSh.GetCurNumRule() &&
!rSh.GetCurNumRule()->IsOutlineRule() &&
@@ -1797,7 +1767,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.IsSttPara() && rSh.IsEndPara() )
eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff;
- //RETURN fuer neuen Absatz mit AutoFormatierung
+ //RETURN for new paragraph with AutoFormating
else if( pACfg && pACfg->IsAutoFmtByInput() &&
!(nSelectionType & (nsSelectionType::SEL_GRF |
nsSelectionType::SEL_OLE | nsSelectionType::SEL_FRM |
@@ -1820,28 +1790,24 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KEY_BACKSPACE | KEY_SHIFT:
if( !rSh.HasReadonlySel() )
{
- // #i23725#
sal_Bool bDone = sal_False;
- // --> OD 2006-01-31 - try to add comment for code snip:
+ // try to add comment for code snip:
// Remove the paragraph indent, if the cursor is at the
// beginning of a paragraph, there is no selection
// and no numbering rule found at the current paragraph
- // --> OD 2006-01-31 #b6341339#, #i58776#
// Also try to remove indent, if current paragraph
// has numbering rule, but isn't counted and only
// key <backspace> is hit.
const bool bOnlyBackspaceKey(
KEY_BACKSPACE == rKeyCode.GetFullCode() );
if ( rSh.IsSttPara() &&
- !rSh.HasSelection() && // i40834
+ !rSh.HasSelection() &&
( NULL == rSh.GetCurNumRule() ||
( rSh.IsNoNum() && bOnlyBackspaceKey ) ) )
{
bDone = rSh.TryRemoveIndent();
}
- // <--
- // -> #i23725#
if (bDone)
eKeyState = KS_Ende;
else
@@ -1863,10 +1829,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
bDone = sal_True;
}
}
- // <- #i23725#
- // --> OD 2006-01-31 #b6341339#, #i58776#
- // --> OD 2006-04-21 #i63540#
- // revise fix for issues b6341339 and i58776:
+
// If the cursor is in an empty paragraph, which has
// a numbering, but not the oultine numbering, and
// there is no selection, the numbering has to be
@@ -1908,9 +1871,13 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
eKeyState = KS_NumOrNoNum;
}
- // <--
}
}
+ else
+ {
+ InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
+ eKeyState = KS_Ende;
+ }
break;
case KEY_RIGHT:
@@ -1935,11 +1902,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
{
- // --> OD 2007-10-02 #b660435#
-// if (rSh.IsFirstOfNumRule()) // #i23725#
if ( rSh.IsFirstOfNumRule() &&
numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
- // <--
eKeyState = KS_NumIndentInc;
else
eKeyState = KS_NumDown;
@@ -1966,10 +1930,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
if( pColl &&
- //0 <= pColl->GetOutlineLevel() && #i24560#
- //MAXLEVEL - 1 > pColl->GetOutlineLevel() )//#outline level,zhaojianwei
+
pColl->IsAssignedToListLevelOfOutlineStyle()
- && MAXLEVEL-1 > pColl->GetAssignedOutlineStyleLevel() )//<-end,zhaojianwei
+ && MAXLEVEL-1 > pColl->GetAssignedOutlineStyleLevel() )
eKeyState = KS_OutlineDown;
}
}
@@ -1990,11 +1953,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
{
- // --> OD 2007-10-02 #b660435#
-// if (rSh.IsFirstOfNumRule()) // #i23725#
+
if ( rSh.IsFirstOfNumRule() &&
numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
- // <--
eKeyState = KS_NumIndentDec;
else
eKeyState = KS_NumUp;
@@ -2020,8 +1981,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( rSh.IsSttOfPara() && !rSh.HasReadonlySel() )
{
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
- //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei
- // MAXLEVEL - 1 >= pColl->GetOutlineLevel() )
if( pColl &&
pColl->IsAssignedToListLevelOfOutlineStyle() &&
0 < pColl->GetAssignedOutlineStyleLevel())
@@ -2039,7 +1998,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
if( aTmpQHD.HasCntnt() && !rSh.HasSelection() )
{
- // zum naechsten Tip
+ // to the next Tip
aTmpQHD.Inc( pACorr && pACorr->GetSwFlags().
bAutoCmpltEndless );
eKeyState = KS_NextPrevGlossary;
@@ -2062,7 +2021,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( aTmpQHD.HasCntnt() && !rSh.HasSelection() &&
!rSh.HasReadonlySel() )
{
- // zum vorherigen Tip
+ // to the previous Tip
aTmpQHD.Dec( pACorr && pACorr->GetSwFlags().
bAutoCmpltEndless );
eKeyState = KS_NextPrevGlossary;
@@ -2172,13 +2131,12 @@ KEYINPUT_CHECKTABLE_INSDEL:
bFlushBuffer = sal_True, bNormalChar = sal_False;
else
{
-// OS 22.09.95: Da der Sfx Acceleratoren nur aufruft, wenn sie beim letzten
-// Statusupdate enabled wurden, muss copy ggf. von uns
-// 'gewaltsam' gerufen werden.
+ // Because Sfx accelerators are only called when they were
+ // enabled at the last status update, copy has to called
+ // 'forcefully' by us if necessary.
if( rKeyCode.GetFunction() == KEYFUNC_COPY )
GetView().GetViewFrame()->GetBindings().Execute(SID_COPY);
-
if( !bIsDocReadOnly && bNormalChar )
{
const int nSelectionType = rSh.GetSelectionType();
@@ -2245,15 +2203,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
break;
case KS_InsTab:
- if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web!
+ if( rView.ISA( SwWebView )) // no Tab for WebView
{
- // Bug 56196 - dann sollte der weiter gereicht werden.
+ // then it should be passed along
Window::KeyInput( aKeyEvent );
eKeyState = KS_Ende;
break;
}
aCh = '\t';
- // kein break!
+ // no break!
case KS_InsChar:
if (rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT)
{
@@ -2293,13 +2251,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( bChkInsBlank && bIsNormalChar &&
(aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() ))
{
- // vor dem Zeichen noch ein Blank einfuegen. Dieses
- // kommt zwischen den Expandierten Text und dem neuen
- // "nicht Worttrenner".
+ // insert a blank ahead of the character. this ends up
+ // between the expanded text and the new "non-word-seperator".
aInBuffer.Expand( aInBuffer.Len() + 1, ' ' );
}
-
sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh );
sal_Bool bRunNext = pACorr && pACorr->HasRunNext();
if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) &&
@@ -2311,7 +2267,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
FlushInBuffer();
rSh.AutoCorrect( *pACorr, aCh );
- if( '\"' != aCh && '\'' != aCh ) // nur bei "*_" rufen!
+ if( '\"' != aCh && '\'' != aCh ) // only call when "*_"!
rSh.UpdateAttr();
}
else if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) &&
@@ -2339,7 +2295,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
else
{
InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
- // ??? Window::KeyInput( aKeyEvent );
eKeyState = KS_Ende;
}
break;
@@ -2352,12 +2307,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
ChgToEnEmDash | SetINetAttr |
Autocorrect ) &&
!rSh.HasReadonlySel() )
- /* {
- pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
- ChgFractionSymbol | ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr |
- Autocorrect ) &&
- !rSh.HasReadonlySel() ) */
{
FlushInBuffer();
rSh.AutoCorrect( *pACorr, static_cast< sal_Unicode >('\0') );
@@ -2370,8 +2319,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
sal_uInt16 nSlotId = 0;
FlushInBuffer();
-//??? if( bFlushCharBuffer )
-//??? FlushInBuffer( &rSh );
switch( eKeyState )
{
case KS_SpecialInsert:
@@ -2383,7 +2330,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_NumOff:
- // Shellwechsel - also vorher aufzeichnen
+ // shell change - so record in advance
rSh.DelNumRules();
eKeyState = eNextKeyState;
break;
@@ -2392,17 +2339,14 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KS_NumDown:
rSh.NumUpDown( sal_True );
- nKS_NUMDOWN_Count = 2; // #i23725#
+ nKS_NUMDOWN_Count = 2;
break;
case KS_NumUp:
rSh.NumUpDown( sal_False );
break;
- // -> #i23726#
case KS_NumIndentInc:
- // --> OD 2008-06-16 #i90078#
rSh.ChangeIndentOfAllListLevels(360);
- // <--
nKS_NUMINDENTINC_Count = 2;
break;
@@ -2421,11 +2365,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_NumIndentDec:
- // --> OD 2008-06-16 #i90078#
rSh.ChangeIndentOfAllListLevels(-360);
- // <--
break;
- // <- #i23726#
case KS_OutlineDown:
rSh.OutlineUpDown( 1 );
@@ -2435,7 +2376,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_NextCell:
- //In Tabelle immer 'flushen'
+ // always 'flush' in tables
rSh.GoNextCell();
nSlotId = FN_GOTO_NEXT_CELL;
break;
@@ -2447,8 +2388,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.SplitNode( sal_True );
break;
-// case KS_NumOrNoNum:
-// break;
case KS_NextObject:
case KS_PrevObject:
if(rSh.GotoObj( KS_NextObject == eKeyState, GOTOOBJ_GOTO_ANY))
@@ -2467,7 +2406,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_GlossaryExpand:
{
- // ersetze das Wort oder Kuerzel durch den den Textbaustein
+ // replace the word or abbreviation with the auto text
rSh.StartUndo( UNDO_START );
String sFnd( *aTmpQHD.aArr[ aTmpQHD.nCurArrPos ] );
@@ -2518,9 +2457,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KS_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
case KS_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHMove() ); break;
case KS_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHMove() ); break;
-// case KS_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break;
case KS_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break;
-// case KS_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVMove() ); break;
case KS_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVMove() ); break;
case KS_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
case KS_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
@@ -2583,16 +2520,16 @@ KEYINPUT_CHECKTABLE_INSDEL:
bTblInsDelMode = sal_False;
}
- // falls die gepufferten Zeichen eingefuegt werden sollen
+ // in case the buffered characters are inserted
if( bFlushBuffer && aInBuffer.Len() )
{
- //OS 16.02.96 11.04: bFlushCharBuffer wurde hier nicht zurueckgesetzt
- // warum nicht?
+ // bFlushCharBuffer was not resetted here
+ // why not?
sal_Bool bSave = bFlushCharBuffer;
FlushInBuffer();
bFlushCharBuffer = bSave;
- // evt. Tip-Hilfe anzeigen
+ // maybe show Tip-Help
String sWord;
if( bNormalChar && pACfg && pACorr &&
( pACfg->IsAutoTextTip() ||
@@ -2605,23 +2542,20 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
/*--------------------------------------------------------------------
- Beschreibung: MouseEvents
+ Description: MouseEvents
--------------------------------------------------------------------*/
-
void SwEditWin::RstMBDownFlags()
{
- //Nicht auf allen Systemen kommt vor dem modalen
- //Dialog noch ein MouseButton Up (wie unter WINDOWS).
- //Daher hier die Stati zuruecksetzen und die Maus
- //fuer den Dialog freigeben.
+ // Not on all systems a MouseButtonUp is used ahead
+ // of the modal dialog (like on WINDOWS).
+ // So reset the statuses here and release the mouse
+ // for the dialog.
bMBPressed = bNoInterrupt = sal_False;
EnterArea();
ReleaseMouse();
}
-
-
void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
{
SwWrtShell &rSh = rView.GetWrtShell();
@@ -2632,7 +2566,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// opened by inplace client and we would deactivate the inplace client,
// the contex menu is closed by VCL asynchronously which in the end
// would work on deleted objects or the context menu has no parent anymore)
- // See #126086# and #128122#
SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient();
sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
@@ -2674,8 +2607,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
return;
}
- //Nach GrabFocus sollte eine Shell gepusht sein. Das muss eigentlich
- //klappen aber in der Praxis ...
+ // After GrabFocus a shell should be pushed. That should actually
+ // work but in practice ...
lcl_SelectShellForDrop( rView );
sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly();
@@ -2686,7 +2619,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
pQuickHlpData->bChkInsBlank = sal_False;
if( rSh.FinishOLEObj() )
- return; //InPlace beenden und der Klick zaehlt nicht mehr
+ return; // end InPlace and the click doesn't count anymore
SET_CURR_SHELL( &rSh );
@@ -2696,11 +2629,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if (pSdrView->MouseButtonDown( rMEvt, this ) )
{
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
- return; // Event von der SdrView ausgewertet
+ return; // SdrView's event evaluated
}
}
-
bIsInMove = sal_False;
aStartPos = rMEvt.GetPosPixel();
aRszMvHdlPt.X() = 0, aRszMvHdlPt.Y() = 0;
@@ -2712,7 +2644,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) &&
!rSh.IsObjSelectable( aDocPos ) )
{
- // --> FME 2004-07-30 #i32329# Enhanced table selection
if ( SW_TABSEL_HORI <= nMouseTabCol && SW_TABCOLSEL_VERT >= nMouseTabCol )
{
rSh.EnterStdMode();
@@ -2728,11 +2659,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
return;
}
- // <--
if ( !rSh.IsTableMode() )
{
- //Zuppeln von Tabellenspalten aus dem Dokument heraus.
+ // comes from table columns out of the document.
if(SW_TABCOL_VERT == nMouseTabCol || SW_TABCOL_HORI == nMouseTabCol)
rView.SetTabColFromDoc( sal_True );
else
@@ -2757,7 +2687,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
}
- // #i23726#
else if (bTmp &&
rSh.IsNumLabel(aDocPos))
{
@@ -2767,10 +2696,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SfxBindings& rBind = rView.GetViewFrame()->GetBindings();
rBind.Update();
- // --> OD 2005-02-21 #i42921#
if ( RulerMarginDrag( rMEvt,
rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPos ) ) )
- // <--
{
rView.SetNumRuleNodeFromDoc( NULL );
rView.InvalidateRulerPos();
@@ -2779,35 +2706,33 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
else
{
- // --> FME 2005-11-03 #125036# Make sure the pointer is set to 0,
+ // Make sure the pointer is set to 0,
// otherwise it may point to nowhere after deleting the corresponding
// text node.
rView.SetNumRuleNodeFromDoc( NULL );
- // <--
return;
}
}
- //Man kann sich in einem Selektionszustand befinden, wenn zuletzt
- //mit dem Keyboard selektiert wurde, aber noch kein CURSOR_KEY
- //anschliessend bewegt worden ist. In diesem Fall muss die vorher-
- //gehende Selektion zuerst beendet werden.
- //MA 07. Oct. 95: Und zwar nicht nur bei Linker Maustaste sondern immer.
- //siehe auch Bug: 19263
+ // One can be in a selection state when recently the keyboard was
+ // used to select but no CURSOR_KEY was moved yet after that. In
+ // that case the previous selction has to be finished first.
+ // MA 07. Oct. 95: Not only with left mouse button but always.
+ // also see Bug: 19263
if ( rSh.IsInSelect() )
rSh.EndSelect();
- //Abfrage auf LEFT, da sonst auch bei einem Click mit der rechten Taste
- //beispielsweise die Selektion aufgehoben wird.
+ // query against LEFT because otherwise for example also a right
+ // click releases the selection.
if ( MOUSE_LEFT == rMEvt.GetButtons() )
{
sal_Bool bOnlyText = sal_False;
bMBPressed = bNoInterrupt = sal_True;
- nKS_NUMDOWN_Count = 0; // #i23725#
+ nKS_NUMDOWN_Count = 0;
CaptureMouse();
- //ggf. Cursorpositionen zuruecksetzen
+ // reset curor position if applicable
rSh.ResetCursorStack();
switch ( rMEvt.GetModifier() + rMEvt.GetButtons() )
@@ -2840,7 +2765,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
rSh.Edit();
}
- // Ohne SHIFT, da sonst Toggle bei Selektion nicht funktioniert
+ // Without SHIFT because otherwise Toggle doesn't work at selection
if (rMEvt.GetClicks() == 1)
{
if ( rSh.IsSelFrmMode())
@@ -2855,7 +2780,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
rSh.EnterSelFrmMode( &aDocPos );
if ( !pApplyTempl )
{
- //nur, wenn keine Position zum Sizen getroffen ist.
+ // only if no position to size was hit.
if (!bHitHandle)
{
StartDDTimer();
@@ -2881,11 +2806,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bExecHyperlinks = sal_True;
}
- // --> FME 2004-07-30 #i32329# Enhanced selection
sal_uInt8 nNumberOfClicks = static_cast< sal_uInt8 >(rMEvt.GetClicks() % 4);
if ( 0 == nNumberOfClicks && 0 < rMEvt.GetClicks() )
nNumberOfClicks = 4;
- // <--
sal_Bool bExecDrawTextLink = sal_False;
@@ -2902,7 +2825,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SwEditWin::nDDStartPosY = aDocPos.Y();
SwEditWin::nDDStartPosX = aDocPos.X();
- // URL in DrawText-Objekt getroffen?
+ // hit an URL in DrawText object?
if (bExecHyperlinks && pSdrView)
{
SdrViewEvent aVEvt;
@@ -2912,13 +2835,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bExecDrawTextLink = sal_True;
}
- //Rahmen nur zu selektieren versuchen, wenn
- //der Pointer bereits entsprechend geschaltet wurde
+ // only try to select frame, if pointer already was
+ // switched accordingly
if ( aActHitType != SDRHIT_NONE && !rSh.IsSelFrmMode() &&
!GetView().GetViewFrame()->GetDispatcher()->IsLocked() &&
!bExecDrawTextLink)
{
- // #107513#
// Test if there is a draw object at that position and if it should be selected.
sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos);
@@ -2936,9 +2858,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if( bSelObj )
{
- // falls im Macro der Rahmen deselektiert
- // wurde, muss nur noch der Cursor
- // wieder angezeigt werden.
+ // if the frame was deselected in the macro
+ // the cursor just has to be displayed again
if( FRMTYPE_NONE == rSh.GetSelFrmType() )
rSh.ShowCrsr();
else
@@ -3002,9 +2923,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if( !bSelObj )
{
- // Cursor hier umsetzen, damit er nicht zuerst
- // im Rahmen gezeichnet wird; ShowCrsr() geschieht
- // in LeaveSelFrmMode()
+ // move cursor here so that it is not drawn in the
+ // frame first; ShowCrsr() happens in LeaveSelFrmMode()
bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
rSh.LeaveSelFrmMode();
rView.AttrChangedNotify( &rSh );
@@ -3039,7 +2959,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) &&
0 == rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) )
-/* SJ: 01.03.2005: this is no good, on the one hand GetSelectionType is used as flag field (take a look into the GetSelectionType method)
+/* this is no good, on the one hand GetSelectionType is used as flag field (take a look into the GetSelectionType method)
on the other hand the return value is used in a switch without proper masking (very nice), this must lead to trouble
*/
switch ( rSh.GetSelectionType() &~ ( nsSelectionType::SEL_FONTWORK | nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE ) )
@@ -3051,7 +2971,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SFX_CALLMODE_RECORD|SFX_CALLMODE_SLOT);
return;
- // Doppelklick auf OLE-Objekt --> OLE-InPlace
+ // double click on OLE object --> OLE-InPlace
case nsSelectionType::SEL_OLE:
if (!rSh.IsSelObjProtected(FLYPROTECT_CONTENT))
{
@@ -3074,9 +2994,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
return;
}
- //falls die Cursorposition korrigiert wurde oder
- // ein Fly im ReadOnlyModus selektiert ist,
- //keine Wortselektion.
+ // if the cursor position was corrected or if a Fly
+ // was selected in ReadOnlyMode, no word selection.
if ( !bValidCrsrPos ||
(rSh.IsFrmSelected() && rSh.IsFrmSelected() ))
return;
@@ -3100,8 +3019,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case TYP_POSTITFLD:
case TYP_SCRIPTFLD:
{
- //falls es ein Readonly-Bereich ist, dann muss der Status
- //enabled werden
+ // if it's a Readonly region, status has to be enabled
sal_uInt16 nSlot = TYP_POSTITFLD == nTypeId ? FN_POSTIT : FN_JAVAEDIT;
SfxBoolItem aItem(nSlot, sal_True);
pVFrame->GetBindings().SetState(aItem);
@@ -3117,12 +3035,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
return;
}
- //im Extended Mode hat Doppel- und
- //Dreifachklick keine Auswirkungen.
+ // in extended mode double and triple
+ // click has no effect.
if ( rSh.IsExtMode() || rSh.IsBlockMode() )
return;
- //Wort selektieren, gfs. Additional Mode
+ // select work, AdditionalMode if applicable
if ( KEY_MOD1 == rMEvt.GetModifier() && !rSh.IsAddMode() )
{
rSh.EnterAddMode();
@@ -3138,30 +3056,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case 4:
{
bFrmDrag = sal_False;
- //im Extended Mode hat Doppel- und
- //Dreifachklick keine Auswirkungen.
+ // in extended mode double and triple
+ // click has no effect.
if ( rSh.IsExtMode() )
return;
- //falls die Cursorposition korrigiert wurde oder
- // ein Fly im ReadOnlyModus selektiert ist,
- //keine Wortselektion.
+ // if the cursor position was corrected or if a Fly
+ // was selected in ReadOnlyMode, no word selection.
if ( !bValidCrsrPos || rSh.IsFrmSelected() )
return;
- //Zeile selektieren, gfs. Additional Mode
+ // select line, AdditionalMode if applicable
const bool bMod = KEY_MOD1 == rMEvt.GetModifier() &&
!rSh.IsAddMode();
if ( bMod )
rSh.EnterAddMode();
- // --> FME 2004-07-30 #i32329# Enhanced selection
if ( 3 == nNumberOfClicks )
rSh.SelSentence( &aDocPos );
else
rSh.SelPara( &aDocPos );
- // <--
if ( bMod )
rSh.LeaveAddMode();
@@ -3317,8 +3232,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
if ( !rSh.IsExtMode() )
{
- // keine Selection anfangen, wenn in ein URL-
- // Feld oder eine -Grafik geklickt wird
+ // don't start a selection when an
+ // URL field or a graphic is clicked
sal_Bool bSttSelect = rSh.HasSelection() ||
Pointer(POINTER_REFHAND) != GetPointer();
@@ -3386,15 +3301,15 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
int nTmpSetCrsr = 0;
- { // nur temp. Move-Kontext aufspannen, da sonst die
- // Abfrage auf die Inhaltsform nicht funktioniert!!!
+ { // only temporary generate Move-Kontext because otherwise
+ // the query to the content form doesn't work!!!
MV_KONTEXT( &rSh );
nTmpSetCrsr = (rSh.*rSh.fnSetCrsr)(&aDocPos,bOnlyText);
bValidCrsrPos = !(CRSR_POSCHG & nTmpSetCrsr);
bCallBase = sal_False;
}
- //#i42732# - notify the edit window that from now on we do not use the input language
+ // notify the edit window that from now on we do not use the input language
if ( !(CRSR_POSOLD & nTmpSetCrsr) )
SetUseInputLanguage( sal_False );
@@ -3406,13 +3321,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if ( !bOverURLGrf && !bOnlyText )
{
const int nSelType = rSh.GetSelectionType();
- // --> OD 2009-12-30 #i89920#
// Check in general, if an object is selectable at given position.
// Thus, also text fly frames in background become selectable via Ctrl-Click.
if ( nSelType & nsSelectionType::SEL_OLE ||
nSelType & nsSelectionType::SEL_GRF ||
rSh.IsObjSelectable( aDocPos ) )
- // <--
{
MV_KONTEXT( &rSh );
if( !rSh.IsFrmSelected() )
@@ -3421,11 +3334,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bCallBase = sal_False;
}
}
- // nicht mehr hier zuruecksetzen, damit -- falls durch MouseMove
- // bei gedrueckter Ctrl-Taste eine Mehrfachselektion erfolgen soll,
- // im Drag nicht die vorherige Selektion aufgehoben wird.
-// if(bModePushed)
-// rSh.PopMode(sal_False);
+ // don't reset here any longer so that, in case through MouseMove
+ // with pressed Ctrl key a multiple-selection should happen,
+ // the previous selection is not released in Drag.
break;
}
}
@@ -3435,10 +3346,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
/*--------------------------------------------------------------------
- Beschreibung: MouseMove
+ Description: MouseMove
--------------------------------------------------------------------*/
-
void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
{
MouseEvent rMEvt(_rMEvt);
@@ -3452,8 +3362,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
_rMEvt.GetMode(), _rMEvt.GetButtons() );
}
- // solange eine Action laeuft sollte das MouseMove abgeklemmt sein
- // Ansonsten gibt es den Bug 40102
+ // as long as an action is running the MouseMove should be disconnected
+ // otherwise bug 40102 occurs
SwWrtShell &rSh = rView.GetWrtShell();
if( rSh.ActionPend() )
return ;
@@ -3465,8 +3375,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
SET_CURR_SHELL( &rSh );
- //aPixPt == Point in Pixel, rel. zu ChildWin
- //aDocPt == Point in Twips, Dokumentkoordinaten
+ //aPixPt == Point in Pixel, relative to ChildWin
+ //aDocPt == Point in Twips, document coordinates
const Point aPixPt( rMEvt.GetPosPixel() );
const Point aDocPt( PixelToLogic( aPixPt ) );
@@ -3486,24 +3396,11 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if ( !bIsDocReadOnly && pSdrView && pSdrView->MouseMove(rMEvt,this) )
{
SetPointer( POINTER_TEXT );
- return; // Event von der SdrView ausgewertet
+ return; // evaluate SdrView's event
}
const Point aOldPt( rSh.VisArea().Pos() );
-#ifdef TEST_FOR_BUG91313
- // n Pixel as FUZZY border
- SwRect aVis( rSh.VisArea() );
- Size aFuzzySz( 2, 2 );
- aFuzzySz = PixelToLogic( aFuzzySz );
-
- aVis.Top( aVis.Top() + aFuzzySz.Height() );
- aVis.Bottom( aVis.Bottom() - aFuzzySz.Height() );
- aVis.Left( aVis.Left() + aFuzzySz.Width() );
- aVis.Right( aVis.Right() - aFuzzySz.Width() );
- const sal_Bool bInsWin = aVis.IsInside( aDocPt );
-#else
const sal_Bool bInsWin = rSh.VisArea().IsInside( aDocPt );
-#endif
if( pShadCrsr && !bInsWin )
delete pShadCrsr, pShadCrsr = 0;
@@ -3516,14 +3413,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
return;
}
- // Position ist noetig fuer OS/2, da dort nach einem MB-Down
- // offensichtlich sofort ein MB-Move gerufen wird.
+ // position is necessary for OS/2 because obviously after a MB-Down
+ // a MB-Move is called immediately.
if( bDDTimerStarted )
{
Point aDD( SwEditWin::nDDStartPosX, SwEditWin::nDDStartPosY );
aDD = LogicToPixel( aDD );
Rectangle aRect( aDD.X()-3, aDD.Y()-3, aDD.X()+3, aDD.Y()+3 );
- if ( !aRect.IsInside( aPixPt ) ) // MA 23. May. 95: Tatterschutz.
+ if ( !aRect.IsInside( aPixPt ) )
StopDDTimer( &rSh, aDocPt );
}
@@ -3584,7 +3481,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
nPointer = POINTER_HSIZEBAR;
bChkTblSel = true;
break;
- // --> FME 2004-07-30 #i20126# Enhanced table selection
case SW_TABSEL_HORI :
nPointer = POINTER_TAB_SELECT_SE;
break;
@@ -3603,31 +3499,26 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
case SW_TABCOLSEL_VERT :
nPointer = POINTER_TAB_SELECT_W;
break;
- // <--
}
if ( USHRT_MAX != nPointer &&
- // --> FME 2004-10-20 #i35543#
- // Enhanced table selection is explicitely allowed in table mode
+ // i#35543 - Enhanced table selection is explicitely allowed in table mode
( !bChkTblSel || !rSh.IsTableMode() ) )
- // <--
{
SetPointer( nPointer );
}
return;
}
- // #i23726#
else if (rSh.IsNumLabel(aDocPt, RULER_MOUSE_MARGINWIDTH))
{
- // --> OD 2005-02-21 #i42921# - consider vertical mode
+ // i#42921 - consider vertical mode
SwTxtNode* pNodeAtPos = rSh.GetNumRuleNodeAtPos( aDocPt );
const sal_uInt16 nPointer =
rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPt )
? POINTER_VSIZEBAR
: POINTER_HSIZEBAR;
SetPointer( nPointer );
- // <--
return;
}
@@ -3649,10 +3540,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
// So the pAnchorMarker has to find the right SdrHdl, if it's
// the old one, it will find it with position aOld, if this one
// is destroyed, it will find a new one at position GetHdlPos().
- // --> OD 2010-09-16 #i114522#
-// const Point aOld = pAnchorMarker->GetPos();
+
const Point aOld = pAnchorMarker->GetPosForHitTest( *(rSh.GetOut()) );
- // <--
Point aNew = rSh.FindAnchorPos( aDocPt );
SdrHdl* pHdl;
if( (0!=( pHdl = pSdrView->PickHandle( aOld ) )||
@@ -3665,7 +3554,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
{
pAnchorMarker->SetPos( aNew );
pAnchorMarker->SetLastPos( aDocPt );
- //OLMpSdrView->RefreshAllIAOManagers();
}
}
else
@@ -3705,7 +3593,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if ( bIsInMove || IsMinMove( aStartPos, aPixPt ) )
{
- // Event-Verarbeitung fuers Resizen
+ // event processing for resizing
if( pSdrView->AreObjectsMarked() )
{
const SwFrmFmt* pFlyFmt;
@@ -3713,7 +3601,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
const Point aSttPt( PixelToLogic( aStartPos ) );
- // geht es los?
+ // can we start?
if( HDL_USER == eSdrMoveHdl )
{
SdrHdl* pHdl = pSdrView->PickHandle( aSttPt );
@@ -3727,9 +3615,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( 0 != ( pFlyFmt = rSh.GetFlyFrmFmt() ) &&
0 != ( pMacro = pFlyFmt->GetMacro().GetMacroTable().
Get( nEvent )) &&
-// oder nur z.B. alle 20 Twip bescheid sagen?
-// ( 20 > Abs( aRszMvHdlPt.X() - aDocPt.X() ) ||
-// 20 > Abs( aRszMvHdlPt.Y() - aDocPt.Y() ) )
+// or notify only e.g. every 20 Twip?
aRszMvHdlPt != aDocPt )
{
aRszMvHdlPt = aDocPt;
@@ -3764,7 +3650,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
return ;
}
}
- // Event-Verarbeitung fuers Resizen
+ // event processing for resizing
if( bIsDocReadOnly )
break;
@@ -3815,9 +3701,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
}
else
{
- //JP 24.09.98: Fix fuer die Bugs 55592 / 55931
- //JP 23.04.99: Fix fuer den Bugs 65289
- //JP 06.07.99: Fix fuer den Bugs 67360
if( !rMEvt.IsSynthetic() &&
!(( MOUSE_LEFT + KEY_MOD1 ==
rMEvt.GetModifier() + rMEvt.GetButtons() ) &&
@@ -3836,10 +3719,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
{
if ( pApplyTempl )
{
- UpdatePointer(aDocPt, 0); // evtl. muss hier ein Rahmen markiert werden
+ UpdatePointer(aDocPt, 0); // maybe a frame has to be marked here
break;
}
- //#i6193#, change ui if mouse is over SwPostItField
+ // change ui if mouse is over SwPostItField
// TODO: do the same thing for redlines SW_REDLINE
SwRect aFldRect;
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD);
@@ -3889,14 +3772,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
aSaveCallEvent.Set( EVENT_OBJECT_URLITEM, pFmt );
}
- // sollte wir ueber einem InternetFeld mit einem
- // gebundenen Macro stehen?
+ // should be be over a InternetField with an
+ // embedded macro?
if( aSaveCallEvent != aLastCallEvent )
{
if( aLastCallEvent.HasEvent() )
rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT,
aLastCallEvent, sal_True );
- // 0 besagt, das das Object gar keine Tabelle hat
+ // 0 says that the object doesn't have any table
if( !rSh.CallEvent( SFX_EVENT_MOUSEOVER_OBJECT,
aSaveCallEvent ))
aSaveCallEvent.Clear();
@@ -3904,7 +3787,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
}
else if( aLastCallEvent.HasEvent() )
{
- // Cursor stand auf einem Object
+ // cursor was on an object
rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT,
aLastCallEvent, sal_True );
}
@@ -3948,10 +3831,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
}
/*--------------------------------------------------------------------
- Beschreibung: Button Up
+ Description: Button Up
--------------------------------------------------------------------*/
-
void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
sal_Bool bCallBase = sal_True;
@@ -3965,9 +3847,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
DELETEZ( pRowColumnSelectionStart );
SdrHdlKind eOldSdrMoveHdl = eSdrMoveHdl;
- eSdrMoveHdl = HDL_USER; // fuer die MoveEvents - wieder zuruecksetzen
+ eSdrMoveHdl = HDL_USER; // for MoveEvents - reset again
- // sicherheitshalber zuruecksetzen Bug 27900
+ // preventively reset
rView.SetTabColFromDoc( sal_False );
rView.SetNumRuleNodeFromDoc(NULL);
@@ -3981,16 +3863,15 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if ( pSdrView->MouseButtonUp( rMEvt,this ) )
{
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
- return; // Event von der SdrView ausgewertet
+ return; // SdrView's event evaluated
}
}
- //MouseButtonUp nur bearbeiten, wenn auch das Down an dieses Fenster ging.
+ // only process MouseButtonUp when the Down went to that windows as well.
if ( !bMBPressed )
{
-// OS 25.02.97 Undo fuer die Giesskann ist bereits im CommandHdl
-//JP 29.09.95: so sollte es sein!!! if(pApplyTempl->bUndo)
-// if( pApplyTempl && MOUSE_RIGHT == rMEvt.GetModifier() + rMEvt.GetButtons() )
-// rSh.Do( SwWrtShell::UNDO );
+// Undo for the watering can is already in CommandHdl
+// that's the way it should be!
+
return;
}
@@ -4013,7 +3894,6 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( pAnchorMarker )
{
Point aPnt( pAnchorMarker->GetLastPos() );
- //OLMpSdrView->RefreshAllIAOManagers();
DELETEZ( pAnchorMarker );
if( aPnt.X() || aPnt.Y() )
rSh.FindAnchorPos( aPnt, sal_True );
@@ -4022,7 +3902,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
if ( rView.GetDrawFuncPtr()->MouseButtonUp( rMEvt ) )
{
- if (rView.GetDrawFuncPtr()) // Koennte im MouseButtonUp zerstoert worden sein
+ if (rView.GetDrawFuncPtr()) // could have been destroyed in MouseButtonUp
{
rView.GetDrawFuncPtr()->Deactivate();
@@ -4056,7 +3936,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rView.AttrChangedNotify( &rSh );
}
else if (rMEvt.GetButtons() == MOUSE_RIGHT && rSh.IsDrawCreate())
- rView.GetDrawFuncPtr()->BreakCreate(); // Zeichnen abbrechen
+ rView.GetDrawFuncPtr()->BreakCreate(); // abort drawing
bNoInterrupt = sal_False;
ReleaseMouse();
@@ -4085,9 +3965,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
case MOUSE_LEFT + KEY_SHIFT + KEY_MOD1:
if ( bFrmDrag && rSh.IsSelFrmMode() )
{
- if ( rMEvt.IsMod1() ) //Kopieren und nicht moven.
+ if ( rMEvt.IsMod1() ) // copy and don't move.
{
- //Drag abbrechen, statt dessen internes Copy verwenden
+ // abort drag, use internal Copy instead
Rectangle aRect;
rSh.GetDrawView()->TakeActionRect( aRect );
if (!aRect.IsEmpty())
@@ -4181,8 +4061,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( bHoldSelection )
{
- //JP 27.04.99: Bug 65389 - das EndDrag sollte auf jedenfall
- // gerufen werden.
+ // the EndDrag should be called in any case
bHoldSelection = sal_False;
(rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
}
@@ -4192,8 +4071,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
const sal_Bool bTmpNoInterrupt = bNoInterrupt;
bNoInterrupt = sal_False;
- { // nur temp. Move-Kontext aufspannen, da sonst die
- // Abfrage auf die Inhaltsform nicht funktioniert!!!
+ { // create only temporary move context because otherwise
+ // the query to the content form doesn't work!!!
MV_KONTEXT( &rSh );
const Point aDocPos( PixelToLogic( aStartPos ) );
bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
@@ -4206,9 +4085,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bInSel = rSh.IsInSelect();
(rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
- // Internetfield? --> Link-Callen (DocLaden!!)
-//JP 18.10.96: Bug 32437 -
-// if( !rSh.HasSelection() )
+ // Internetfield? --> call link (load doc!!)
if( !bInSel )
{
sal_uInt16 nFilter = URLLOAD_NOFILTER;
@@ -4255,19 +4132,17 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos )
{
- ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
+ OSL_ENSURE( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
if ( aCntntAtPos.aFnd.pFldmark != NULL)
{
IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
- //SwDocShell* pDocSh = rView.GetDocShell();
- //SwDoc *pDoc=pDocSh->GetDoc();
- if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if (fieldBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{
ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM);
pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked());
pCheckboxFm->Invalidate();
rSh.InvalidateWindows( rView.GetVisArea() );
- } else if (fieldBM->GetFieldname().equalsAscii( ODF_FORMDROPDOWN) ) {
+ } else if (fieldBM->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
rView.ExecFieldPopup( aDocPt, fieldBM );
fieldBM->Invalidate();
rSh.InvalidateWindows( rView.GetVisArea() );
@@ -4276,7 +4151,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
}
}
- else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos )
+ else
{
if ( bExecHyperlinks )
rSh.ClickToINetAttr( *(SwFmtINetFmt*)aCntntAtPos.aFnd.pAttr, nFilter );
@@ -4297,7 +4172,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if (pSdrView && aVEvt.eEvent == SDREVENT_EXECUTEURL)
{
- // URL-Feld getroffen
+ // hit URL field
const SvxURLField *pField = aVEvt.pURLField;
if (pField)
{
@@ -4309,7 +4184,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
else
{
- // Grafik getroffen
+ // hit graphic
ReleaseMouse();
if( rSh.ClickToINetGrf( aDocPt, nFilter ))
bCallShadowCrsr = sal_False;
@@ -4341,7 +4216,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
- // gfs. im Down gepushten Mode wieder zuruecksetzen
+ // reset pushed mode in Down again if applicable
if ( bPopMode && bModePushed )
{
rSh.PopMode();
@@ -4417,7 +4292,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
else if(rMEvt.GetClicks() == 1)
{
- // keine Selektion -> also Giesskanne abschalten
+ // no selection -> so turn off watering can
aTemplateTimer.Start();
}
}
@@ -4466,7 +4341,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
break;
}
case SFX_STYLE_FAMILY_PAGE:
- // Kein Undo bei Seitenvorlagen
+ // no Undo with page templates
rSh.ChgCurPageDesc( *pApplyTempl->aColl.pPageDesc );
if ( pApplyTempl->aColl.pPageDesc )
aStyleName = pApplyTempl->aColl.pPageDesc->GetName();
@@ -4475,11 +4350,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
case SFX_STYLE_FAMILY_PSEUDO:
if( !rSh.HasReadonlySel() )
{
- // --> OD 2008-03-17 #refactorlists#
rSh.SetCurNumRule( *pApplyTempl->aColl.pNumRule,
false,
pApplyTempl->aColl.pNumRule->GetDefaultListId() );
- // <--
bCallBase = sal_False;
pApplyTempl->bUndo = sal_True;
if( pApplyTempl->aColl.pNumRule )
@@ -4505,8 +4378,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
ReleaseMouse();
- // Hier kommen nur verarbeitete MouseEvents an; nur bei diesen duerfen
- // die Modi zurueckgesetzt werden.
+ // Only processed MouseEvents arrive here; only at these the moduses can
+ // be resetted.
bMBPressed = sal_False;
//sicherheitshalber aufrufen, da jetzt das Selektieren bestimmt zu Ende ist.
@@ -4518,12 +4391,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
Window::MouseButtonUp(rMEvt);
}
-
/*--------------------------------------------------------------------
- Beschreibung: Vorlage anwenden
+ Description: apply template
--------------------------------------------------------------------*/
-
void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
{
static sal_Bool bIdle = sal_False;
@@ -4564,7 +4435,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
rSh.Edit();
}
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{
SID_STYLE_WATERCAN,
SID_ATTR_CHAR_COLOR_EXT,
@@ -4575,10 +4446,9 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
}
/*--------------------------------------------------------------------
- Beschreibung: ctor
+ Description: ctor
--------------------------------------------------------------------*/
-
SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)),
DropTargetHelper( this ),
@@ -4604,8 +4474,8 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
bLockInput(sal_False),
bObjectSelect( sal_False ),
- nKS_NUMDOWN_Count(0), // #i23725#
- nKS_NUMINDENTINC_Count(0) // #i23725#
+ nKS_NUMDOWN_Count(0),
+ nKS_NUMINDENTINC_Count(0)
{
SetHelpId(HID_EDIT_WIN);
EnableChildTransparentMode();
@@ -4613,7 +4483,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
bLinkRemoved = bMBPressed = bInsDraw = bInsFrm =
bIsInDrag = bOldIdle = bOldIdleSet = bChainMode = bWasShdwCrsr = sal_False;
- //#i42732# initially use the input language
+ // initially use the input language
bUseInputLanguage = sal_True;
SetMapMode(MapMode(MAP_TWIP));
@@ -4628,13 +4498,13 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
aKeyInputFlushTimer.SetTimeout( 200 );
aKeyInputFlushTimer.SetTimeoutHdl(LINK(this, SwEditWin, KeyInputFlushHandler));
- // TemplatePointer fuer Farben soll nach Einfachclick
- // ohne Selektion zurueckgesetzt werden
+ // TemplatePointer for colors should be resetted without
+ // selection after single click
aTemplateTimer.SetTimeout(400);
aTemplateTimer.SetTimeoutHdl(LINK(this, SwEditWin, TemplateTimerHdl));
- //JP 16.12.98: temporaere Loesung!!! Sollte bei jeder Cursorbewegung
- // den Font von der akt. einfuege Position setzen!
+ // temporary solution!!! Should set the font of the current
+ // insert position at every curor movement!
if( !rMyView.GetDocShell()->IsReadOnly() )
{
Font aFont;
@@ -4643,8 +4513,6 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
}
}
-
-
SwEditWin::~SwEditWin()
{
aKeyInputTimer.Stop();
@@ -4664,12 +4532,10 @@ SwEditWin::~SwEditWin()
delete pAnchorMarker;
}
-
/******************************************************************************
- * Beschreibung: DrawTextEditMode einschalten
+ * Description: turn on DrawTextEditMode
******************************************************************************/
-
void SwEditWin::EnterDrawTextMode( const Point& aDocPos )
{
if ( rView.EnterDrawTextMode(aDocPos) == sal_True )
@@ -4686,17 +4552,14 @@ void SwEditWin::EnterDrawTextMode( const Point& aDocPos )
}
/******************************************************************************
- * Beschreibung: DrawMode einschalten
+ * Description: turn on DrawMode
******************************************************************************/
-
-
sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
{
SwWrtShell &rSh = rView.GetWrtShell();
SdrView *pSdrView = rSh.GetDrawView();
-// if ( GetDrawFuncPtr() && (aActHitType == SDRHIT_NONE || rSh.IsDrawCreate()) )
if ( rView.GetDrawFuncPtr() )
{
if (rSh.IsDrawCreate())
@@ -4712,7 +4575,7 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
sal_Bool bUnLockView = !rSh.IsViewLocked();
rSh.LockView( sal_True );
- rSh.EndTextEdit(); // Danebengeklickt, Ende mit Edit
+ rSh.EndTextEdit(); // clicked aside, end Edit
rSh.SelectObj( aDocPos );
if ( !rSh.IsObjSelected() && !rSh.IsFrmSelected() )
rSh.LeaveSelFrmMode();
@@ -4730,23 +4593,11 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
return sal_False;
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
-
-
sal_Bool SwEditWin::IsDrawSelMode()
{
-// return (IsFrmAction() == sal_False && GetSdrDrawMode() == OBJ_NONE);
return IsObjectSelect();
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
-
void SwEditWin::GetFocus()
{
if ( rView.GetPostItMgr()->HasActiveSidebarWin() )
@@ -4761,12 +4612,6 @@ void SwEditWin::GetFocus()
}
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
-
-
void SwEditWin::LoseFocus()
{
rView.GetWrtShell().InvalidateAccessibleFocus();
@@ -4776,19 +4621,13 @@ void SwEditWin::LoseFocus()
rView.LostFocus();
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
-
-
void SwEditWin::Command( const CommandEvent& rCEvt )
{
SwWrtShell &rSh = rView.GetWrtShell();
if ( !rView.GetViewFrame() )
{
- //Wenn der ViewFrame in Kuerze stirbt kein Popup mehr!
+ // If ViewFrame dies shortly, no popup anymore!
Window::Command(rCEvt);
return;
}
@@ -4797,7 +4636,6 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
// menu from an inplace client has been closed. Now we have the chance
// to deactivate the inplace client without any problem regarding parent
// windows and code on the stack.
- // For more information, see #126086# and #128122#
SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient();
sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ))
@@ -4851,8 +4689,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
aEvent.ExecutePosition.X = aPixPos.X();
aEvent.ExecutePosition.Y = aPixPos.Y();
Menu* pMenu = 0;
- ::rtl::OUString sMenuName =
- ::rtl::OUString::createFromAscii( "private:resource/ReadonlyContextMenu");
+ ::rtl::OUString sMenuName(RTL_CONSTASCII_USTRINGPARAM("private:resource/ReadonlyContextMenu"));
if( GetView().TryContextMenuInterception( *pROPopup, sMenuName, pMenu, aEvent ) )
{
if ( pMenu )
@@ -4886,7 +4723,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
case COMMAND_VOICE:
{
- //ggf. an Outliner weiterleiten
+ // forward to Outliner if applicable
if ( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() )
{
bCallBase = sal_False;
@@ -4898,7 +4735,6 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
if ( VOICECOMMANDTYPE_CONTROL == pCData->GetType() )
break;
-
sal_uInt16 nSlotId = 0;
SfxPoolItem *pItem = 0;
@@ -4951,9 +4787,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- ASSERT( !this, "unknown speech command." );
+ OSL_ENSURE( !this, "unknown speech command." );
#endif
}
if ( nSlotId )
@@ -5017,12 +4853,12 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
if ( sRecord.Len() )
{
- // #102812# convert quotes in IME text
+ // convert quotes in IME text
// works on the last input character, this is escpecially in Korean text often done
// quotes that are inside of the string are not replaced!
const sal_Unicode aCh = sRecord.GetChar(sRecord.Len() - 1);
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
if(pACorr &&
(( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
@@ -5033,9 +4869,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
if ( xRecorder.is() )
{
- //Shell ermitteln
+ // determine Shell
SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) );
- // Request generieren und recorden
+ // generate request and record
if (pSfxShell)
{
SfxRequest aReq( rView.GetViewFrame(), FN_INSERT_STRING );
@@ -5080,14 +4916,14 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
rView.GetViewFrame()->GetBindings().GetRecorder();
if(!xRecorder.is())
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACfg && pACorr &&
- ( pACfg->IsAutoTextTip() ||
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr &&
+ ( rACfg.IsAutoTextTip() ||
pACorr->GetSwFlags().bAutoCompleteWords ) &&
rSh.GetPrevAutoCorrWord( *pACorr, sWord ) )
{
- ShowAutoTextCorrectQuickHelp(sWord, pACfg, pACorr, sal_True);
+ ShowAutoTextCorrectQuickHelp(sWord, &rACfg, pACorr, sal_True);
}
}
}
@@ -5145,7 +4981,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HANGUL_HANJA_CONVERSION);
break;
case COMMAND_INPUTLANGUAGECHANGE :
- //#i42732# update state of fontname if input language changes
+ // i#42732 - update state of fontname if input language changes
bInputLanguageSwitched = true;
SetUseInputLanguage( sal_True );
break;
@@ -5219,35 +5055,30 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
}
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- ASSERT( !this, "unknown command." );
+ OSL_ENSURE( !this, "unknown command." );
#endif
}
if (bCallBase)
Window::Command(rCEvt);
}
-/* -----------------25.08.2003 10:12-----------------
- #i18686#: select the object/cursor at the mouse
- position of the context menu request
- --------------------------------------------------*/
+/* i#18686 select the object/cursor at the mouse
+ position of the context menu request */
sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
{
sal_Bool bRet = sal_False;
const Point aDocPos( PixelToLogic( rMousePos ) );
- // --> OD 2005-02-17 #i42258#
const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aDocPos ) );
- // <--
//create a synthetic mouse event out of the coordinates
MouseEvent aMEvt(rMousePos);
SdrView *pSdrView = rSh.GetDrawView();
if ( pSdrView )
{
- // --> OD 2005-02-17 #i42258# - no close of insert_draw and reset of
+ // no close of insert_draw and reset of
// draw mode, if context menu position is inside a selected object.
if ( !bIsInsideSelectedObj && rView.GetDrawFuncPtr() )
- // <--
{
rView.GetDrawFuncPtr()->Deactivate();
@@ -5319,7 +5150,6 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
if( !rSh.IsSelFrmMode() &&
!GetView().GetViewFrame()->GetDispatcher()->IsLocked() )
{
- // #107513#
// Test if there is a draw object at that position and if it should be selected.
sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos);
@@ -5337,9 +5167,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
if( bSelObj )
{
bRet = sal_True;
- // falls im Macro der Rahmen deselektiert
- // wurde, muss nur noch der Cursor
- // wieder angezeigt werden.
+ // in case the frame was deselected in the macro
+ // just the cursor has to be displayed again.
if( FRMTYPE_NONE == rSh.GetSelFrmType() )
rSh.ShowCrsr();
else
@@ -5386,9 +5215,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
if( !bSelObj )
{
- // Cursor hier umsetzen, damit er nicht zuerst
- // im Rahmen gezeichnet wird; ShowCrsr() geschieht
- // in LeaveSelFrmMode()
+ // move cursor here so that it is not drawn in the
+ // frame at first; ShowCrsr() happens in LeaveSelFrmMode()
bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
rSh.LeaveSelFrmMode();
rView.LeaveDrawCreate();
@@ -5432,8 +5260,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
if ( !bOverSelect )
{
- { // nur temp. Move-Kontext aufspannen, da sonst die
- // Abfrage auf die Inhaltsform nicht funktioniert!!!
+ { // create only temporary move context because otherwise
+ // the query against the content form doesn't work!!!
MV_KONTEXT( &rSh );
(rSh.*rSh.fnSetCrsr)(&aDocPos, sal_False);
bRet = sal_True;
@@ -5457,7 +5285,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType )
{
- //Shell ermitteln
+ // determine Shell
SfxShell* pShell;
SfxDispatcher* pDispatcher = rView.GetViewFrame()->GetDispatcher();
for(sal_uInt16 i = 0; sal_True; ++i )
@@ -5469,8 +5297,6 @@ SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType )
return pShell;
}
-
-
void SwEditWin::ClearTip()
{
}
@@ -5481,7 +5307,6 @@ IMPL_LINK( SwEditWin, KeyInputFlushHandler, Timer *, EMPTYARG )
return 0;
}
-
IMPL_LINK( SwEditWin, KeyInputTimerHandler, Timer *, EMPTYARG )
{
bTblInsDelMode = sal_False;
@@ -5497,28 +5322,20 @@ void SwEditWin::_FinitStaticData()
{
delete pQuickHlpData;
}
-/* -----------------23.01.2003 12:15-----------------
- * #i3370# remove quick help to prevent saving
- * of autocorrection suggestions
- * --------------------------------------------------*/
+/* i#3370 - remove quick help to prevent saving
+ * of autocorrection suggestions */
void SwEditWin::StopQuickHelp()
{
if( HasFocus() && pQuickHlpData && pQuickHlpData->bClear )
pQuickHlpData->Stop( rView.GetWrtShell() );
}
-/*-----------------23.02.97 18:39-------------------
-
---------------------------------------------------*/
-
-
IMPL_LINK(SwEditWin, TemplateTimerHdl, Timer*, EMPTYARG)
{
SetApplyTemplate(SwApplyTemplate());
return 0;
}
-
void SwEditWin::SetChainMode( sal_Bool bOn )
{
if ( !bChainMode )
@@ -5534,7 +5351,7 @@ void SwEditWin::SetChainMode( sal_Bool bOn )
if ( !bChainMode )
rView.GetViewFrame()->HideStatusText();
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{
FN_FRAME_CHAIN, FN_FRAME_UNCHAIN, 0
};
@@ -5543,10 +5360,9 @@ void SwEditWin::SetChainMode( sal_Bool bOn )
uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::CreateAccessible()
{
- vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
- // happend already!!!
+ SolarMutexGuard aGuard; // this should have happend already!!!
SwWrtShell *pSh = rView.GetWrtShellPtr();
- ASSERT( pSh, "no writer shell, no accessible object" );
+ OSL_ENSURE( pSh, "no writer shell, no accessible object" );
uno::Reference<
::com::sun::star::accessibility::XAccessible > xAcc;
if( pSh )
@@ -5559,10 +5375,9 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::Create
void QuickHelpData::Move( QuickHelpData& rCpy )
{
- // Pointer verschieben
+ // move pointer
aArr.Insert( &rCpy.aArr );
rCpy.aArr.Remove( (sal_uInt16)0, rCpy.aArr.Count() );
-// nTipId = rCpy.nTipId;
bClear = rCpy.bClear;
nLen = rCpy.nLen;
nCurArrPos = rCpy.nCurArrPos;
@@ -5592,7 +5407,6 @@ void QuickHelpData::ClearCntnt()
delete[] pAttrs, pAttrs = 0;
}
-
void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
{
if( pCETID ) delete pCETID, pCETID = 0;
@@ -5626,7 +5440,18 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
EXTTEXTINPUT_ATTR_HIGHLIGHT;
pCETID = new CommandExtTextInputData( sStr, pAttrs, nL,
0, 0, 0, sal_False );
- rSh.CreateExtTextInput(rWin.GetInputLanguage());
+
+ //fdo#33092. If the current input language is the default
+ //language that text would appear in if typed, then don't
+ //force a language on for the ExtTextInput.
+ LanguageType eInputLanguage = rWin.GetInputLanguage();
+ if (lcl_isNonDefaultLanguage(eInputLanguage,
+ rSh.GetView(), sStr) == INVALID_HINT)
+ {
+ eInputLanguage = LANGUAGE_DONTKNOW;
+ }
+
+ rSh.CreateExtTextInput(eInputLanguage);
rSh.SetExtTextInputData( *pCETID );
}
}
@@ -5640,8 +5465,6 @@ void QuickHelpData::Stop( SwWrtShell& rSh )
ClearCntnt();
}
-
-
void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord )
{
salhelper::SingletonRef<SwCalendarWrapper>* pCalendar = s_getCalendarWrapper();
@@ -5657,9 +5480,7 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord )
String sStr( aNames[ nPos ].FullName );
if( rWord.Len() + 1 < sStr.Len() &&
-//!!! UNICODE: fehlendes interface
-// pIntl->CompareEqual( rWord, sStr.Copy( 0, rWord.Len() ),
-// INTN_COMPARE_IGNORECASE ) )
+//!!! UNICODE: missing interface
COMPARE_EQUAL == rWord.CompareIgnoreCaseToAscii(
sStr, rWord.Len() ))
{
@@ -5681,22 +5502,40 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord )
while( nStt < nEnd )
{
const String& rS = rACLst[ nStt ];
- //JP 16.06.99: Bug 66927 - only if the count of chars
- // from the suggest greater as the
- // actual word
+ // only if the count of chars
+ // from the suggest greater as the
+ // actual word
if( rS.Len() > rWord.Len() )
{
- String* pNew = new String( rS );
- if( !aArr.Insert( pNew ) )
+ CharClass &rCC = GetAppCharClass();
+ String aMatch;
+ int upper = 0, lower = 0, letters = 0;
+ for( xub_StrLen i = 0; i < rWord.Len(); i++ ) {
+ sal_Int32 nCharType = rCC.getCharacterType( rWord, i );
+ if( !CharClass::isLetterType( nCharType ) )
+ continue;
+ letters++;
+ if( i18n::KCharacterType::LOWER & nCharType )
+ lower++;
+ if( i18n::KCharacterType::UPPER & nCharType )
+ upper++;
+ }
+ if (lower == letters)
+ aMatch = rCC.lower( rS );
+ else if (upper == letters)
+ aMatch = rCC.upper( rS );
+ else // mixed case - use what we have
+ aMatch = rS;
+
+ String *pNew = new String( aMatch );
+ if (!aArr.Insert( pNew ))
delete pNew;
}
++nStt;
}
}
}
-/* -----------------06.11.2002 12:01-----------------
- *
- * --------------------------------------------------*/
+
void SwEditWin::ShowAutoTextCorrectQuickHelp(
const String& rWord, SvxAutoCorrCfg* pACfg, SvxAutoCorrect* pACorr,
sal_Bool bFromIME )
@@ -5728,10 +5567,6 @@ void SwEditWin::ShowAutoTextCorrectQuickHelp(
pQuickHlpData->Start( rSh, rWord.Len() );
}
-/* -----------------29.03.2006 11:01-----------------
- *
- * --------------------------------------------------*/
-
void SwEditWin::SetUseInputLanguage( sal_Bool bNew )
{
if ( bNew || bUseInputLanguage )
@@ -5743,9 +5578,6 @@ void SwEditWin::SetUseInputLanguage( sal_Bool bNew )
bUseInputLanguage = bNew;
}
-/*-- 13.11.2008 10:18:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
XubString SwEditWin::GetSurroundingText() const
{
String sReturn;
@@ -5771,9 +5603,7 @@ XubString SwEditWin::GetSurroundingText() const
return sReturn;
}
-/*-- 13.11.2008 10:18:17---------------------------------------------------
- -----------------------------------------------------------------------*/
Selection SwEditWin::GetSurroundingTextSelection() const
{
SwWrtShell& rSh = rView.GetWrtShell();
@@ -5801,3 +5631,5 @@ Selection SwEditWin::GetSurroundingTextSelection() const
return Selection( nPos - nStartPos, nPos - nStartPos );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index fc3ed663ad6d..afad6894d20f 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <hintids.hxx>
#include <doc.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -75,13 +76,12 @@
#include <PostItMgr.hxx>
#include <fmtfld.hxx>
-// --> OD 2009-08-18 #i104300#
+// #i104300#
#include <IDocumentMarkAccess.hxx>
#include <ndtxt.hxx>
-// <--
/*--------------------------------------------------------------------
- Beschreibung: KeyEvents
+ Description: KeyEvents
--------------------------------------------------------------------*/
static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, sal_Bool bBalloon )
{
@@ -135,7 +135,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( bWeiter && bQuickBalloon)
{
SwRect aFldRect;
- sal_uInt16 nStyle = 0; // style of quick help
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD |
SwContentAtPos::SW_INETATTR |
SwContentAtPos::SW_FTN |
@@ -143,7 +142,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
SwContentAtPos::SW_TOXMARK |
SwContentAtPos::SW_REFMARK |
SwContentAtPos::SW_SMARTTAG |
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwContentAtPos::SW_TABLEBOXVALUE |
( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
#endif
@@ -151,13 +150,14 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
{
+ sal_uInt16 nStyle = 0; // style of quick help
switch( aCntntAtPos.eCntntAtPos )
{
case SwContentAtPos::SW_TABLEBOXFML:
sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula();
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
case SwContentAtPos::SW_TABLEBOXVALUE:
{
sTxt = UniString(
@@ -191,7 +191,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
sSuffix.EqualsAscii( pMarkToOLE ))
sTxt = sTxt.Copy( 0, nFound - 1);
}
- // --> OD 2009-08-18 #i104300#
+ // #i104300#
// special handling if target is a cross-reference bookmark
{
String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() );
@@ -222,8 +222,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
}
}
}
- // <--
- // --> OD 2007-07-26 #i80029#
+ // #i80029#
sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
{
@@ -236,7 +235,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
sTxt.Insert( ViewShell::GetShellRes()->aHyperlinkClick, 0 );
}
}
- // <--
break;
}
case SwContentAtPos::SW_SMARTTAG:
@@ -311,27 +309,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case RES_POSTITFLD:
{
- /*
- SwPostItMgr* pMgr = rView.GetPostItMgr();
- if (pMgr->ShowNotes())
- {
- SwFmtFld* pSwFmtFld = 0;
- if (pMgr->ShowPreview(pFld,pSwFmtFld))
- {
- SwPostIt* pPostIt = new SwPostIt(static_cast<Window*>(this),0,pSwFmtFld,pMgr,PB_Preview);
- pPostIt->InitControls();
- pPostIt->SetReadonly(true);
- pMgr->SetColors(pPostIt,static_cast<SwPostItField*>(pSwFmtFld->GetFld()));
- pPostIt->SetVirtualPosSize(rEvt.GetMousePosPixel(),Size(180,70));
- pPostIt->ShowNote();
- SetPointerPosPixel(pPostIt->GetPosPixel() + Point(20,20));
- }
- return;
- }
- */
break;
}
- case RES_INPUTFLD: // BubbleHelp, da der Hinweis ggf ziemlich lang sein kann
+ case RES_INPUTFLD: // BubbleHelp, because the suggestion could be quite long
bBalloon = sal_True;
/* no break */
case RES_JUMPEDITFLD:
@@ -356,9 +336,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case RES_GETREFFLD:
{
- // --> OD 2008-01-09 #i85090#
+ // #i85090#
const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) );
- ASSERT( pRefFld,
+ OSL_ENSURE( pRefFld,
"<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
if ( pRefFld )
{
@@ -379,7 +359,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
sTxt = ((SwGetRefField*)pFld)->GetSetRefName();
}
}
- // <--
}
break;
}
@@ -400,7 +379,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
Help::ShowBalloon( this, rEvt.GetMousePosPixel(), sTxt );
else
{
- // dann zeige die Hilfe mal an:
+ // the show the help
Rectangle aRect( aFldRect.SVRect() );
Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() )));
aRect.Left() = aPt.X();
@@ -428,7 +407,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case SW_TABROW_VERT:
nTabRes = STR_TABLE_ROW_ADJUST;
break;
- // --> FME 2004-07-30 #i32329# Enhanced table selection
+ // #i32329# Enhanced table selection
case SW_TABSEL_HORI:
case SW_TABSEL_HORI_RTL:
case SW_TABSEL_VERT:
@@ -443,7 +422,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case SW_TABCOLSEL_VERT:
nTabRes = STR_TABLE_SELECT_COL;
break;
- // <--
}
if(nTabRes)
{
@@ -456,14 +434,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
}
}
-/*
-aktuelle Zeichenvorlage anzeigen?
- if( bWeiter && rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON ))
- {
- SwCharFmt* pChrFmt = rSh.GetCurCharFmt();
-
- }
-*/
if( bWeiter && pSdrView && bQuickBalloon)
{
SdrViewEvent aVEvt;
@@ -473,7 +443,7 @@ aktuelle Zeichenvorlage anzeigen?
if ((pField = aVEvt.pURLField) != 0)
{
- // URL-Feld getroffen
+ // hit an URL field
if (pField)
{
pObj = aVEvt.pObj;
@@ -484,7 +454,7 @@ aktuelle Zeichenvorlage anzeigen?
}
if (bWeiter && eHit == SDRHIT_TEXTEDIT)
{
- // URL-Feld in zum Editieren ge?ffneten DrawText-Objekt suchen
+ // look for URL field in DrawText object that is opened for editing
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
const SvxFieldItem* pFieldItem;
@@ -540,16 +510,6 @@ void SwEditWin::PrePaint()
void SwEditWin::Paint(const Rectangle& rRect)
{
-#if defined(MYDEBUG)
- // StartUp-Statistik
- if ( pTickList )
- {
- SYSTICK( "Start SwEditWin::Paint" );
- READ_FIRST_TICKS()
- FLUSH_TICKS()
- }
-#endif
-
SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
if(!pWrtShell)
return;
@@ -557,28 +517,19 @@ void SwEditWin::Paint(const Rectangle& rRect)
if( pShadCrsr )
{
Rectangle aRect( pShadCrsr->GetRect());
- // liegt vollstaendig drin?
+ // fully resides inside?
if( rRect.IsInside( aRect ) )
// dann aufheben
delete pShadCrsr, pShadCrsr = 0;
else if( rRect.IsOver( aRect ))
{
- // liegt irgendwie drueber, dann ist alles ausserhalb geclippt
- // und wir muessen den "inneren Teil" am Ende vom Paint
- // wieder sichtbar machen. Sonst kommt es zu Paintfehlern!
+ // resides somewhat above, then everything is clipped outside
+ // and we have to make the "inner part" at the end of the
+ // Paint visible again. Otherwise Paint errors occur!
bPaintShadowCrsr = sal_True;
}
}
-/*
- //TODO/LATER: what's the replacement for this? Do we need it?
- SwDocShell* pDocShell = GetView().GetDocShell();
-
- SvInPlaceEnvironment *pIpEnv = pDocShell ?
- pDocShell->GetIPEnv() : 0;
- if ( pIpEnv && pIpEnv->GetRectsChangedLockCount() )
- //Wir stehen in Groessenverhandlungen (MM), Paint verzoegern
- Invalidate( rRect );
- else */
+
if ( GetView().GetVisArea().GetWidth() <= 0 ||
GetView().GetVisArea().GetHeight() <= 0 )
Invalidate( rRect );
@@ -590,3 +541,4 @@ void SwEditWin::Paint(const Rectangle& rRect)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx
index 1d0699e5cd81..34b4103d7537 100644
--- a/sw/source/ui/docvw/edtwin3.cxx
+++ b/sw/source/ui/docvw/edtwin3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@
/*--------------------------------------------------------------------
- Beschreibung: Core-Notify
+ Description: Core-Notify
--------------------------------------------------------------------*/
@@ -64,7 +65,7 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect,
}
/*--------------------------------------------------------------------
- Beschreibung: Docmdi - verschiebbar
+ Description: Docmdi - movable
--------------------------------------------------------------------*/
@@ -78,7 +79,7 @@ sal_Bool IsScrollMDI( ViewShell* pVwSh, const SwRect &rRect )
}
/*--------------------------------------------------------------------
- Beschreibung: Notify fuer Groessen-Aenderung
+ Description: Notify for size change
--------------------------------------------------------------------*/
@@ -96,7 +97,7 @@ void SizeNotify(ViewShell* pVwSh, const Size &rSize)
}
/*--------------------------------------------------------------------
- Beschreibung: Notify fuer Seitenzahl-Update
+ Description: Notify for page number update
--------------------------------------------------------------------*/
@@ -111,10 +112,8 @@ void PageNumNotify( ViewShell* pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
}
/******************************************************************************
- * Methode : void FrameNotify( DocMDIBase *pWin, FlyMode eMode )
- * Beschreibung:
- * Erstellt : OK 08.02.94 13:49
- * Aenderung :
+ * Method : void FrameNotify( DocMDIBase *pWin, FlyMode eMode )
+ * Description:
******************************************************************************/
@@ -126,7 +125,7 @@ void FrameNotify( ViewShell* pVwSh, FlyMode eMode )
}
/*--------------------------------------------------------------------
- Beschreibung: Notify fuer Seitenzahl-Update
+ Description: Notify for page number update
--------------------------------------------------------------------*/
sal_Bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVerticalMode)
{
@@ -137,7 +136,7 @@ sal_Bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVertical
}
// #i23726#
-// --> OD 2005-02-18 #i42921# - add 3rd parameter <bVerticalMode> in order
+// #i42921# - add 3rd parameter <bVerticalMode> in order
// to consider vertical layout
sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt,
const bool bVerticalMode )
@@ -145,7 +144,6 @@ sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt,
SvxRuler& rRuler = bVerticalMode ? rView.GetVLineal() : rView.GetHLineal();
return !rRuler.StartDocDrag( rMEvt, RULER_TYPE_INDENT);
}
-// <--
LAYOUT_NS Dialog* GetSearchDialog()
{
@@ -178,8 +176,8 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
Window::DataChanged( rDCEvt );
SwWrtShell* pSh = GetView().GetWrtShellPtr();
- //#99906# DataChanged() is sometimes called prior to creating
- // the SwWrtShell
+ // DataChanged() is sometimes called prior to creating
+ // the SwWrtShell
if(!pSh)
return;
sal_Bool bViewWasLocked = pSh->IsViewLocked(), bUnlockPaint = sal_False;
@@ -187,16 +185,16 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
switch( rDCEvt.GetType() )
{
case DATACHANGED_SETTINGS:
- // ScrollBars neu anordnen bzw. Resize ausloesen, da sich
- // ScrollBar-Groesse geaendert haben kann. Dazu muss dann im
- // Resize-Handler aber auch die Groesse der ScrollBars aus
- // den Settings abgefragt werden.
+ // rearrange ScrollBars, respectively trigger resize, because
+ // the ScrollBar size can have change. For that, in the reset
+ // handler, the size of the ScrollBars also has to be queried
+ // from the settings.
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
{
pSh->LockPaint();
bUnlockPaint = sal_True;
ViewShell::DeleteReplacementBitmaps();
- GetView().InvalidateBorder(); //Scrollbarbreiten
+ GetView().InvalidateBorder(); //Scrollbar work
}
break;
@@ -206,7 +204,7 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
case DATACHANGED_FONTSUBSTITUTION:
pSh->LockPaint();
bUnlockPaint = sal_True;
- GetView().GetDocShell()->UpdateFontList(); //z.B. Druckerwechsel
+ GetView().GetDocShell()->UpdateFontList(); //e.g. printer change
break;
}
pSh->LockView( bViewWasLocked );
@@ -214,3 +212,4 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
pSh->UnlockPaint();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx
new file mode 100644
index 000000000000..8010a9d1d1f5
--- /dev/null
+++ b/sw/source/ui/docvw/extedit.cxx
@@ -0,0 +1,150 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Surendran Mahendran <surenspost@gmail.com>]
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "precompiled_sw.hxx"
+#include <extedit.hxx>
+#include <view.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
+#include <wrtsh.hxx>
+#include <osl/file.hxx>
+#include <osl/thread.hxx>
+#include <osl/process.h>
+#include <osl/time.h>
+#include <svtools/filter.hxx>
+#include <svtools/filechangedchecker.hxx>
+#include <svx/xoutbmp.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/cvtgrf.hxx>
+#include <basesh.hxx>
+#include "romenu.hxx"
+#include "com/sun/star/system/XSystemShellExecute.hpp"
+#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
+#include <comphelper/processfactory.hxx>
+
+#include <boost/bind.hpp>
+
+using namespace ::com::sun::star;
+
+void HandleCloseEvent(const String& rURL, SwWrtShell *rSh)
+{
+ //create a new Graphic
+ Graphic newGraphic;
+
+ //import the temp file image stream into the newGraphic
+ SvStream* pStream = utl::UcbStreamHelper::CreateStream(rURL, STREAM_READ);
+ if(pStream)
+ {
+ GraphicConverter::Import(*pStream, newGraphic);
+
+ // Now update the Graphic in the shell by re-reading from the newGraphic
+ // TODO: Make this action Undoable !
+ rSh->ReRead(aEmptyStr, aEmptyStr, (const Graphic*) &newGraphic);
+
+ delete(pStream);
+ }
+}
+
+IMPL_LINK (ExternalProcessClass_Impl, StartListeningEvent, void*, pEvent)
+{
+ //Start an event listener implemented via VCL timeout
+ Data *pData = ( Data* )pEvent;
+ String aURL( pData->fileName );
+
+ new FileChangedChecker(
+ pData->fileName,
+ ::boost::bind(&HandleCloseEvent,aURL,pData->rSh));
+
+ return 0;
+}
+
+void pWorker(void *pThreadData)
+{
+ Data *pData = (Data*)(pThreadData);
+ rtl_uString *aFileName = new rtl_uString();
+ rtl_uString_newFromAscii (
+ &aFileName, rtl::OUStringToOString(
+ pData->fileName, RTL_TEXTENCODING_UTF8).getStr());
+
+ // Make an asynchronous call to listen to the event of temporary image file
+ // getting changed
+ Application::PostUserEvent(
+ LINK(NULL, ExternalProcessClass_Impl, StartListeningEvent), pThreadData);
+
+ uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
+ ::comphelper::getProcessServiceFactory()->createInstance(
+ DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW );
+ xSystemShellExecute->execute( pData->fileName, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
+}
+
+void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh)
+{
+ //Get the graphic from the GraphicObject
+ const Graphic pGraphic = pGraphicObject->GetGraphic();
+
+ //get the Preferred File Extension for this graphic
+ String fExt;
+ GetPreferedExtension(fExt, pGraphic);
+
+ //Create the temp File
+ rtl::OUString tempFileBase, tempFileName;
+ oslFileHandle pHandle;
+ osl::FileBase::createTempFile(0, &pHandle, &tempFileBase);
+
+ // Move it to a file name with image extension properly set
+ tempFileName = tempFileBase + rtl::OUString(String('.')) +
+ rtl::OUString(fExt);
+ osl::File::move(tempFileBase, tempFileName);
+
+ //Write Graphic to the Temp File
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt));
+ String aFilter(rGF.GetExportFormatShortName(nFilter));
+ String sPath(tempFileName.getStr());
+
+ // Write the Graphic to the file now
+ XOutBitmap::WriteGraphic(pGraphic, sPath, aFilter,
+ XOUTBMP_USE_NATIVE_IF_POSSIBLE|XOUTBMP_DONT_EXPAND_FILENAME);
+
+ // There is a possiblity that sPath extnesion might have been changed if the
+ // provided extension is not writable
+ tempFileName = rtl::OUString(sPath);
+
+ //Create a thread
+ rtl_uString *fileName = new rtl_uString();
+ rtl_uString_newFromAscii(
+ &fileName, rtl::OUStringToOString(tempFileName,
+ RTL_TEXTENCODING_UTF8).getStr());
+
+ // Create the data that is needed by the thread later
+ Data *pThreadData = new Data();
+ pThreadData->pGraphicObject = pGraphicObject;
+ pThreadData->fileName = fileName;
+ pThreadData->rSh = rSh ;
+
+ osl_createThread(pWorker, pThreadData);
+
+}
diff --git a/sw/source/ui/docvw/frmsidebarwincontainer.cxx b/sw/source/ui/docvw/frmsidebarwincontainer.cxx
index b5e406dcf69b..29a4d4012b59 100644
--- a/sw/source/ui/docvw/frmsidebarwincontainer.cxx
+++ b/sw/source/ui/docvw/frmsidebarwincontainer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -214,3 +212,5 @@ void SwFrmSidebarWinContainer::getAll( const SwFrm& rFrm,
}
} } // eof of namespace sw::sidebarwindows::
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/frmsidebarwincontainer.hxx b/sw/source/ui/docvw/frmsidebarwincontainer.hxx
index 1583f36a0bb6..4df59c86d180 100644
--- a/sw/source/ui/docvw/frmsidebarwincontainer.hxx
+++ b/sw/source/ui/docvw/frmsidebarwincontainer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -71,3 +69,4 @@ class SwFrmSidebarWinContainer
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index a50d89f7bb30..00f533eface5 100755
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,7 +65,6 @@
#include <cmdid.h>
#include <helpid.h>
#include <docvw.hrc>
-#include <docvw.hrc>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -76,20 +76,29 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::sfx2;
-SwReadOnlyPopup::~SwReadOnlyPopup()
+void GetPreferedExtension( String &rExt, const Graphic &rGrf )
{
- String *pDel = (String*)aThemeList.First();
- while ( pDel )
+ // then propose the "best" filter using the native-info, if applicable
+ const sal_Char* pExt = "png";
+ switch( const_cast<Graphic&>(rGrf).GetLink().GetType() )
{
- delete pDel;
- pDel = (String*)aThemeList.Next();
+ case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break;
+ case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break;
+ case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break;
+ case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break;
+ case GFX_LINK_TYPE_NATIVE_PCT: pExt = "pct"; break;
+ case GFX_LINK_TYPE_NATIVE_JPG: pExt = "jpg"; break;
+ default:; //prevent warning
}
+ rExt.AssignAscii( pExt );
+}
+
+SwReadOnlyPopup::~SwReadOnlyPopup()
+{
delete pImageMap;
delete pTargetURL;
}
-
-
void SwReadOnlyPopup::Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rDis )
{
SfxPoolItem *_pItem = 0;
@@ -162,22 +171,22 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
}
}
- sal_Bool bEnableGraphicToGallery;
- if ( sal_True == (bEnableGraphicToGallery = bLink) )
+ bool bEnableGraphicToGallery = bLink;
+ if ( bEnableGraphicToGallery )
{
- GalleryExplorer::FillThemeList( aThemeList );
- if ( aThemeList.Count() )
+ if (GalleryExplorer::FillThemeList( aThemeList ))
{
PopupMenu *pMenu = GetPopupMenu(MN_READONLY_GRAPHICTOGALLERY);
pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk );
pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk );
- for ( sal_uInt16 i=0; i < aThemeList.Count(); ++i )
- pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3,
- *(String*)aThemeList.GetObject( i ) );
+
+ for ( sal_uInt16 i=0; i < aThemeList.size(); ++i )
+ pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] );
}
else
- bEnableGraphicToGallery = sal_False;
+ bEnableGraphicToGallery = false;
}
+
EnableItem( MN_READONLY_GRAPHICTOGALLERY, bEnableGraphicToGallery );
SfxViewFrame * pVFrame = rV.GetViewFrame();
@@ -192,17 +201,18 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
bEnableBack = sal_True;
if ( pItem->GetGraphicLink() )
{
- if ( !aThemeList.Count() )
+ if ( aThemeList.empty() )
GalleryExplorer::FillThemeList( aThemeList );
- if ( aThemeList.Count() )
+
+ if ( !aThemeList.empty() )
{
PopupMenu *pMenu = GetPopupMenu(MN_READONLY_BACKGROUNDTOGALLERY);
pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk );
pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk );
bEnableBackGallery = sal_True;
- for ( sal_uInt16 i=0; i < aThemeList.Count(); ++i )
- pMenu->InsertItem( MN_READONLY_BACKGROUNDTOGALLERY+i + 3,
- *(String*)aThemeList.GetObject( i ) );
+
+ for ( sal_uInt16 i=0; i < aThemeList.size(); ++i )
+ pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] );
}
}
}
@@ -265,7 +275,7 @@ void SwReadOnlyPopup::Execute( Window* pWin, const Point &rPixPos )
Execute(pWin, nId);
}
-/*-- 17.03.2004 13:06:18---------------------------------------------------
+/*-------------------------------------------------------------------------
execute the resulting ID only - necessary to support XContextMenuInterception
-----------------------------------------------------------------------*/
void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId )
@@ -292,10 +302,8 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId )
sTmp = SaveGraphic( nSaveId );
if ( sTmp.Len() )
- {
- String sThemeName( *(String*)aThemeList.GetObject( nId ));
- GalleryExplorer::InsertURL( sThemeName, sTmp );
- }
+ GalleryExplorer::InsertURL( aThemeList[nId], sTmp );
+
return;
}
@@ -377,29 +385,11 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId )
pClipCntnr->CopyToClipboard( pWin );
}
}
-static void lcl_GetPreferedExtension( String &rExt, const Graphic &rGrf )
-{
- // dann ggfs. ueber die native-Info der Grafik den "besten"
- // Filter vorschlagen
- const sal_Char* pExt = "png";
- switch( const_cast<Graphic&>(rGrf).GetLink().GetType() )
- {
- case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break;
- case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break;
- case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break;
- case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break;
- case GFX_LINK_TYPE_NATIVE_PCT: pExt = "pct"; break;
- case GFX_LINK_TYPE_NATIVE_JPG: pExt = "jpg"; break;
- default:; //prevent warning
- }
- rExt.AssignAscii( pExt );
-}
-
String SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId )
{
- //Namen der Grafik herausfischen.
+ // fish out the graphic's name
String aName;
if ( MN_READONLY_SAVEBACKGROUND == nId )
{
@@ -427,11 +417,10 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
-// aExpDlg.SetHelpId(HID_FILEDLG_ROMENU);
INetURLObject aPath;
aPath.SetSmartURL( sGrfPath );
- //Namen der Grafik herausfischen.
+ // fish out the graphic's name
String aName = rGrfName;
aDlgHelper.SetTitle( SW_RESSTR(STR_EXPORT_GRAFIK_TITLE));
@@ -440,12 +429,12 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
aURL.SetSmartURL( aName );
aDlgHelper.SetFileName( aURL.GetName() );
- GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
const sal_uInt16 nCount = rGF.GetExportFormatCount();
String aExt( aURL.GetExtension() );
if( !aExt.Len() )
- lcl_GetPreferedExtension( aExt, rGraphic );
+ GetPreferedExtension( aExt, rGraphic );
aExt.ToLowerAscii();
sal_uInt16 nDfltFilter = USHRT_MAX;
@@ -460,8 +449,8 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
}
if ( USHRT_MAX == nDfltFilter )
{
- //"falsche" Extension?
- lcl_GetPreferedExtension( aExt, rGraphic );
+ // "wrong" extension?
+ GetPreferedExtension( aExt, rGraphic );
for ( sal_uInt16 i = 0; i < nCount; ++i )
if ( aExt == rGF.GetExportFormatShortName( i ).ToLowerAscii() )
{
@@ -477,14 +466,14 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
if( aDlgHelper.Execute() == ERRCODE_NONE )
{
String sPath( xFP->getFiles().getConstArray()[0] );
- //verwendeten Pfad merken - bitte nicht wieder wegoptimieren!
+ // remember used path - please don't optimize away!
aPath.SetSmartURL( sPath);
sGrfPath = aPath.GetPath();
if( rGrfName.Len() &&
nDfltFilter == rGF.GetExportFormatNumber( xFltMgr->getCurrentFilter()))
{
- //Versuchen die Originalgrafik zu speichern.
+ // try to save the original graphic
SfxMedium aIn( rGrfName, STREAM_READ | STREAM_NOCREATE,
sal_True );
if( aIn.GetInStream() && !aIn.GetInStream()->GetError() )
@@ -521,3 +510,4 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/romenu.hxx b/sw/source/ui/docvw/romenu.hxx
index db532a709264..25440ee8be79 100644
--- a/sw/source/ui/docvw/romenu.hxx
+++ b/sw/source/ui/docvw/romenu.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,14 +28,9 @@
#ifndef _ROMENU_HXX
#define _ROMENU_HXX
-
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
-#include <tools/list.hxx>
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
+#include <svl/stritem.hxx>
class SwView;
class SfxDispatcher;
@@ -52,7 +48,7 @@ class SwReadOnlyPopup : public PopupMenu
sTargetFrameName,
sDescription,
sGrfName;
- List aThemeList;
+ std::vector<String> aThemeList;
sal_Bool bGrfToGalleryAsLnk;
ImageMap* pImageMap;
INetImage* pTargetURL;
@@ -70,6 +66,8 @@ public:
void Execute( Window* pWin, sal_uInt16 nId );
};
+void GetPreferedExtension( String &rExt, const Graphic &rGrf );
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 34c9711bd01b..d84c4d2d26f0 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,18 +31,12 @@
#include <hintids.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <svtools/textview.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
-#ifndef _SCRBAR_HXX //autogen
#include <vcl/scrbar.hxx>
-#endif
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
#include <svtools/htmltokn.h>
@@ -53,15 +48,9 @@
#include <svtools/ctrltool.hxx>
#include <tools/time.hxx>
#include <swmodule.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _SRCVIEW_HXX
#include <srcview.hxx>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <deque>
@@ -79,7 +68,6 @@ struct SwTextPortion
typedef std::deque<SwTextPortion> SwTextPortions;
-
static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
{
const sal_Unicode cOpenBracket = '<';
@@ -94,10 +82,10 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
const sal_uInt16 nStrLen = rSource.Len();
- sal_uInt16 nInsert = 0; // Number of inserted Portions
- sal_uInt16 nActPos = 0; // Position, at the '<' was found
- sal_uInt16 nOffset = 0; // Offset of nActPos for '<'
- sal_uInt16 nPortStart = USHRT_MAX; // For the TextPortion
+ sal_uInt16 nInsert = 0; // number of inserted portions
+ sal_uInt16 nActPos = 0; // position, where '<' was found
+ sal_uInt16 nOffset = 0; // Offset of nActPos to '<'
+ sal_uInt16 nPortStart = USHRT_MAX; // for the TextPortion
sal_uInt16 nPortEnd = 0; //
SwTextPortion aText;
while(nActPos < nStrLen)
@@ -105,11 +93,11 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
svtools::ColorConfigEntry eFoundType = svtools::HTMLUNKNOWN;
if(rSource.GetChar(nActPos) == cOpenBracket && nActPos < nStrLen - 2 )
{
- // 'leere' Portion einfuegen
+ // insert 'empty' portion
if(nPortEnd < nActPos - 1 )
{
aText.nLine = 0;
- // am Anfang nicht verschieben
+ // don't move at the beginning
aText.nStart = nPortEnd;
if(nInsert)
aText.nStart += 1;
@@ -122,7 +110,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2));
if(cExclamation == cFollowFirst)
{
- // "<!" SGML oder Kommentar
+ // "<!" SGML or comment
if(cMinus == cFollowNext &&
nActPos < nStrLen - 3 && cMinus == rSource.GetChar((xub_StrLen)(nActPos + 3)))
{
@@ -135,14 +123,14 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
}
else if(cSlash == cFollowFirst)
{
- // "</" Slash ignorieren
+ // "</" ignore slash
nPortStart = nActPos;
nActPos++;
nOffset++;
}
if(svtools::HTMLUNKNOWN == eFoundType)
{
- //jetzt koennte hier ein keyword folgen
+ // now here a keyword could follow
sal_uInt16 nSrchPos = nActPos;
while(++nSrchPos < nStrLen - 1)
{
@@ -159,29 +147,29 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
}
if(nSrchPos > nActPos + 1)
{
- //irgend ein String wurde gefunden
+ // some string was found
String sToken = rSource.Copy(nActPos + 1, nSrchPos - nActPos - 1 );
sToken.ToUpperAscii();
int nToken = ::GetHTMLToken(sToken);
if(nToken)
{
- //Token gefunden
+ // Token was found
eFoundType = svtools::HTMLKEYWORD;
nPortEnd = nSrchPos;
nPortStart = nActPos;
}
else
{
- //was war das denn?
+ // what was that?
#if OSL_DEBUG_LEVEL > 1
- DBG_ERROR("Token nicht erkannt!");
- DBG_ERROR(ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer());
+ OSL_FAIL("Token not recognised!");
+ OSL_FAIL(ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer());
#endif
}
}
}
- // jetzt muss noch '>' gesucht werden
+ // now we still have to look for '>'
if(svtools::HTMLUNKNOWN != eFoundType)
{
sal_Bool bFound = sal_False;
@@ -194,7 +182,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
}
if(!bFound && (eFoundType == svtools::HTMLCOMMENT))
{
- // Kommentar ohne Ende in dieser Zeile
+ // comment without ending in this line
bFound = sal_True;
nPortEnd = nStrLen - 1;
}
@@ -226,11 +214,6 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) :
Window( pParent, WB_BORDER|WB_CLIPCHILDREN ),
@@ -253,9 +236,7 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) :
CreateTextEngine();
pSourceViewConfig->AddListener(this);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
SwSrcEditWindow::~SwSrcEditWindow()
{
pSourceViewConfig->RemoveListener(this);
@@ -275,10 +256,6 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) :
delete pOutWin;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -286,10 +263,10 @@ void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt )
switch ( rDCEvt.GetType() )
{
case DATACHANGED_SETTINGS:
- // ScrollBars neu anordnen bzw. Resize ausloesen, da sich
- // ScrollBar-Groesse geaendert haben kann. Dazu muss dann im
- // Resize-Handler aber auch die Groesse der ScrollBars aus
- // den Settings abgefragt werden.
+ // newly rearrange ScrollBars or trigger Resize, because
+ // ScrollBar size could have changed. For this, in the
+ // Resize handler the size of ScrollBars has to be queried
+ // from the settings as well.
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
Resize();
break;
@@ -298,7 +275,7 @@ void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt )
void SwSrcEditWindow::Resize()
{
- // ScrollBars, etc. passiert in Adjust...
+ // ScrollBars, etc. happens in Adjust...
if ( pTextView )
{
long nVisY = pTextView->GetStartDocPos().Y();
@@ -330,7 +307,7 @@ void SwSrcEditWindow::Resize()
pOutWin->SetOutputSizePixel(aOutSz);
InitScrollBars();
- // Zeile im ersten Resize setzen
+ // set line in first Resize
if(USHRT_MAX != nStartLine)
{
if(nStartLine < pTextEngine->GetParagraphCount())
@@ -348,10 +325,6 @@ void SwSrcEditWindow::Resize()
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void TextViewOutWin::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -359,7 +332,7 @@ void TextViewOutWin::DataChanged( const DataChangedEvent& rDCEvt )
switch( rDCEvt.GetType() )
{
case DATACHANGED_SETTINGS:
- // den Settings abgefragt werden.
+ // query settings
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
{
const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
@@ -378,11 +351,6 @@ void TextViewOutWin::MouseMove( const MouseEvent &rEvt )
pTextView->MouseMove( rEvt );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt )
{
if ( pTextView )
@@ -395,11 +363,6 @@ void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void TextViewOutWin::MouseButtonDown( const MouseEvent &rEvt )
{
GrabFocus();
@@ -407,11 +370,6 @@ void TextViewOutWin::MouseButtonDown( const MouseEvent &rEvt )
pTextView->MouseButtonDown( rEvt );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void TextViewOutWin::Command( const CommandEvent& rCEvt )
{
switch(rCEvt.GetCommand())
@@ -440,12 +398,6 @@ void TextViewOutWin::Command( const CommandEvent& rCEvt )
}
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
{
sal_Bool bDone = sal_False;
@@ -484,21 +436,11 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void TextViewOutWin::Paint( const Rectangle& rRect )
{
pTextView->Paint( rRect );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcEditWindow::CreateTextEngine()
{
const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
@@ -507,14 +449,14 @@ void SwSrcEditWindow::CreateTextEngine()
pOutWin->SetPointer(Pointer(POINTER_TEXT));
pOutWin->Show();
- //Scrollbars anlegen
+ // create Scrollbars
pHScrollbar = new ScrollBar(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG);
- pHScrollbar->EnableRTL( false ); // #107300# --- RTL --- no mirroring for scrollbars
+ pHScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
pHScrollbar->Show();
pVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
- pVScrollbar->EnableRTL( false ); // #107300# --- RTL --- no mirroring for scrollbars
+ pVScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
pHScrollbar->EnableDrag();
pVScrollbar->Show();
@@ -548,31 +490,16 @@ void SwSrcEditWindow::CreateTextEngine()
SfxBindings& rBind = GetSrcView()->GetViewFrame()->GetBindings();
rBind.Invalidate( SID_TABLE_CELL );
-// rBind.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcEditWindow::SetScrollBarRanges()
{
- // Extra-Methode, nicht InitScrollBars, da auch fuer TextEngine-Events.
+ // Extra method, not InitScrollBars, because also for TextEngine events.
pHScrollbar->SetRange( Range( 0, nCurTextWidth-1 ) );
pVScrollbar->SetRange( Range(0, pTextEngine->GetTextHeight()-1) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcEditWindow::InitScrollBars()
{
SetScrollBarRanges();
@@ -589,11 +516,6 @@ void SwSrcEditWindow::InitScrollBars()
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)
{
if(pScroll == pVScrollbar)
@@ -614,20 +536,15 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)
return 0;
}
-/*-----------------15.01.97 09.22-------------------
-
---------------------------------------------------*/
-
IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
{
Time aSyntaxCheckStart;
- DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
- // pTextEngine->SetUpdateMode( sal_False );
+ OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
bHighlighting = sal_True;
sal_uInt16 nLine;
sal_uInt16 nCount = 0;
- // zuerst wird der Bereich um dem Cursor bearbeitet
+ // at first the region around the cursor is processed
TextSelection aSel = pTextView->GetSelection();
sal_uInt16 nCur = (sal_uInt16)aSel.GetStart().GetPara();
if(nCur > 40)
@@ -653,7 +570,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
}
}
- // wenn dann noch etwas frei ist, wird von Beginn an weitergearbeitet
+ // when there is still anything left by then, go on from the beginning
void* p = aSyntaxLineTable.First();
while ( p && nCount < MAX_SYNTAX_HIGHLIGHT)
{
@@ -669,21 +586,11 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
break;
}
}
- // os: #43050# hier wird ein TextView-Problem umpopelt:
- // waehrend des Highlightings funktionierte das Scrolling nicht
- /* MT: Shouldn't be a oproblem any more, using IdeFormatter in Insert/RemoveAttrib now.
-
- TextView* pTmp = pTextEngine->GetActiveView();
- pTextEngine->SetActiveView(0);
- // pTextEngine->SetUpdateMode( sal_True );
- pTextEngine->SetActiveView(pTmp);
- pTextView->ShowCursor(sal_False, sal_False);
- */
if(aSyntaxLineTable.Count() && !pTimer->IsActive())
pTimer->Start();
- // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung
- // => gute Gelegenheit, Textbreite zu ermitteln!
+ // SyntaxTimerHdl is called when text changed
+ // => good opportunity to determine text width!
long nPrevTextWidth = nCurTextWidth;
nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz
if ( nCurTextWidth != nPrevTextWidth )
@@ -692,14 +599,11 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
return 0;
}
-/*-----------------15.01.97 10.01-------------------
-
---------------------------------------------------*/
void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
{
- // Durch das DelayedSyntaxHighlight kann es passieren,
- // dass die Zeile nicht mehr existiert!
+ // Because of DelayedSyntaxHighlight it could happen,
+ // that the line doesn't exist anymore!
if ( nPara < pTextEngine->GetParagraphCount() )
{
sal_Bool bTempModified = IsModified();
@@ -707,14 +611,11 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
String aSource( pTextEngine->GetText( nPara ) );
pTextEngine->SetUpdateMode( sal_False );
ImpDoHighlight( aSource, nPara );
- // os: #43050# hier wird ein TextView-Problem umpopelt:
- // waehrend des Highlightings funktionierte das Scrolling nicht
TextView* pTmp = pTextEngine->GetActiveView();
pTmp->SetAutoScroll(sal_False);
pTextEngine->SetActiveView(0);
pTextEngine->SetUpdateMode( sal_True );
pTextEngine->SetActiveView(pTmp);
- // Bug 72887 show the cursor
pTmp->SetAutoScroll(sal_True);
pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ );
@@ -723,10 +624,6 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
}
}
-/*-----------------15.01.97 09.49-------------------
-
---------------------------------------------------*/
-
void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara )
{
if ( !bHighlighting && bDoSyntaxHighlight )
@@ -736,10 +633,6 @@ void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara )
}
}
-/*-----------------15.01.97 11.32-------------------
-
---------------------------------------------------*/
-
void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff )
{
SwTextPortions aPortionList;
@@ -750,7 +643,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff
return;
SwTextPortion& rLast = aPortionList[nCount-1];
- if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben
+ if ( rLast.nStart > rLast.nEnd ) // Only until Bug from MD is resolved
{
nCount--;
aPortionList.pop_back();
@@ -758,32 +651,31 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff
return;
}
- // Evtl. Optimieren:
- // Wenn haufig gleiche Farbe, dazwischen Blank ohne Farbe,
- // ggf. zusammenfassen, oder zumindest das Blank,
- // damit weniger Attribute
+ // maybe optimize:
+ // If frequently the same color, blank without color in between,
+ // maybe summarize or at least the blank; for less attributes
sal_Bool bOptimizeHighlight = sal_True; // war in der BasicIDE static
if ( bOptimizeHighlight )
{
- // Es muessen nur die Blanks und Tabs mit attributiert werden.
- // Wenn zwei gleiche Attribute hintereinander eingestellt werden,
- // optimiert das die TextEngine.
+ // Only blanks and tabs have to be attributed along.
+ // When two identical attributes are placed consecutively,
+ // it optimises the TextEngine.
sal_uInt16 nLastEnd = 0;
-#ifdef DBG_UTIL
- sal_uInt16 nLine = aPortionList[0].nLine;
-#endif
for ( size_t i = 0; i < nCount; i++ )
{
SwTextPortion& r = aPortionList[i];
- DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" );
- if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben
+#if OSL_DEBUG_LEVEL > 1
+ sal_uInt16 nLine = aPortionList[0].nLine;
+ OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" );
+#endif
+ if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
continue;
if ( r.nStart > nLastEnd )
{
- // Kann ich mich drauf verlassen, dass alle ausser
- // Blank und Tab gehighlightet wird ?!
+ // Can I rely on the fact that all except blank and tab
+ // are being highlighted?!
r.nStart = nLastEnd;
}
nLastEnd = r.nEnd+1;
@@ -795,7 +687,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff
for ( size_t i = 0; i < aPortionList.size(); i++ )
{
SwTextPortion& r = aPortionList[i];
- if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben
+ if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
continue;
if(r.eType != svtools::HTMLSGML &&
r.eType != svtools::HTMLCOMMENT &&
@@ -808,10 +700,6 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff
}
}
-/*-----------------30.06.97 09:12-------------------
-
---------------------------------------------------*/
-
void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if ( rHint.ISA( TextHint ) )
@@ -843,10 +731,6 @@ void SwSrcEditWindow::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdC
SetFont();
}
-/*-----------------30.06.97 13:22-------------------
-
---------------------------------------------------*/
-
void SwSrcEditWindow::Invalidate(sal_uInt16 )
{
pOutWin->Invalidate();
@@ -883,15 +767,6 @@ void SwSrcEditWindow::GetFocus()
pOutWin->GrabFocus();
}
-/*void SwSrcEditWindow::LoseFocus()
-{
- Window::LoseFocus();
-// pOutWin->LoseFocus();
-// rView.LostFocus();
-} */
-/* -----------------------------29.08.2002 13:21------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[])
{
switch(eEnc)
@@ -1048,8 +923,6 @@ sal_Bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLangu
case RTL_TEXTENCODING_TIS_620 :
aLanguages[0] = LANGUAGE_THAI;
break;
-// case RTL_TEXTENCODING_SYMBOL :
-// case RTL_TEXTENCODING_DONTKNOW: :
default: aLanguages[0] = Application::GetSettings().GetUILanguage();
}
return aLanguages[0] != LANGUAGE_SYSTEM;
@@ -1088,12 +961,11 @@ void SwSrcEditWindow::SetFont()
GetTextEngine()->SetFont( aFont );
pOutWin->SetFont(aFont);
}
-/* -----------------------------29.08.2002 13:47------------------------------
- ---------------------------------------------------------------------------*/
void SwSrcEditWindow::SetTextEncoding(rtl_TextEncoding eEncoding)
{
eSourceEncoding = eEncoding;
SetFont();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envelp.src b/sw/source/ui/envelp/envelp.src
index 0381ad81d249..20cbcebff32a 100644
--- a/sw/source/ui/envelp/envelp.src
+++ b/sw/source/ui/envelp/envelp.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "envelp.hrc"
#include "globals.hrc"
// Strings ******************************************************************
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 328b7391ef46..ba4d574a343c 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,59 +33,100 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
-
#include <hintids.hxx>
-#include <tools/pstm.hxx>
-
-#define _SVSTDARR_LONGSSORT
-#define _SVSTDARR_LONGS
-#include <svl/svstdarr.hxx>
#include <editeng/paperinf.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
#include <editeng/tstpitem.hxx>
-#endif
#include <editeng/lrspitem.hxx>
#include <editeng/brshitem.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <frmatr.hxx>
#include <swtypes.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _BASESH_HXX
#include <basesh.hxx>
-#endif
#include <drpcps.hxx>
#include <envfmt.hxx>
#include <fmtcol.hxx>
-#ifndef _PARDLG_HXX
#include "swuipardlg.hxx"
-#endif
#include <pattern.hxx>
#include <poolfmt.hxx>
#include <uiborder.hxx>
#include <uitool.hxx>
-#ifndef _ENVFMT_HRC
#include <envfmt.hrc>
-#endif
+
+#include <vector>
+#include <algorithm>
#include "swabstdlg.hxx"
#include "chrdlg.hrc"
+namespace {
+ /// Converts a ranges array to a list containing one entry for each
+ /// element covered by the ranges.
+ /// @param aRanges An array containing zero or more range specifications and
+ /// terminated by one or more zero entries. A range
+ /// specification is two consecutive entries that specify
+ /// the start and end points of the range.
+ /// @returns A vector containing one element for each item covered by the
+ /// ranges. This is not gauranteed to be sorted and may contain
+ /// duplicates if the original ranges contained overlaps.
+ static std::vector<sal_uInt16> lcl_convertRangesToList(const sal_uInt16 aRanges[]) {
+ std::vector<sal_uInt16> aVec;
+ int i = 0;
+ while (aRanges[i])
+ {
+ for (sal_uInt16 n = aRanges[i]; n <= aRanges[i+1]; ++n)
+ {
+ aVec.push_back(n);
+ }
+ i += 2;
+ }
+ return aVec;
+ }
+
+ /// Converts a list of elements to a ranges array.
+ /// @param rElements Vector of the initial elements, this need not be sorted,
+ /// and may contain duplicate items. The vector is sorted
+ /// on exit from this function but may still contain duplicates.
+ /// @returns An array containing zero or more range specifications and
+ /// terminated by one or more zero entries. A range specification
+ /// is two consecutive entries that specify the start and end
+ /// points of the range. This list will be sorted and will not
+ /// contain any overlapping ranges.
+ static sal_uInt16* lcl_convertListToRanges(std::vector<sal_uInt16> &rElements) {
+ std::sort(rElements.begin(), rElements.end());
+ std::vector<sal_uInt16> aRanges;
+ size_t i;
+ for (i = 0; i < rElements.size(); ++i)
+ {
+ //Push the start of the this range.
+ aRanges.push_back(rElements[i]);
+ //Seek to the end of this range.
+ while (i + 1 < rElements.size() && rElements[i+1] - rElements[i] <= 1)
+ {
+ ++i;
+ }
+ //Push the end of this range (may be the same as the start).
+ aRanges.push_back( rElements[i] );
+ }
+
+ // Convert the vector to an array with terminating zero
+ sal_uInt16 *pNewRanges = new sal_uInt16[aRanges.size() + 1];
+ for (i = 0; i < aRanges.size(); ++i)
+ {
+ pNewRanges[i] = aRanges[i];
+ }
+ pNewRanges[i] = 0;
+ return pNewRanges;
+ }
+
+}
+
namespace swui
{
SwAbstractDialogFactory * GetFactory();
@@ -94,9 +136,6 @@ static PopupMenu *pMenu;
static long lUserW = 5669; // 10 cm
static long lUserH = 5669; // 10 cm
-// --------------------------------------------------------------------------
-
-
SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_ENV_FMT), rSet),
@@ -130,7 +169,7 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
FreeResource();
SetExchangeSupport();
- // Metriken
+ // Metrics
FieldUnit aMetric = ::GetDfltMetric(sal_False);
SetMetric(aAddrLeftField, aMetric);
SetMetric(aAddrTopField, aMetric);
@@ -139,12 +178,12 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
SetMetric(aSizeWidthField, aMetric);
SetMetric(aSizeHeightField, aMetric);
- // Menues einhaengen
+ // Hook in Menues
::pMenu = new PopupMenu(SW_RES(MNU_EDIT));
aAddrEditButton.SetPopupMenu(::pMenu);
aSendEditButton.SetPopupMenu(::pMenu);
- // Handler installieren
+ // Install handlers
Link aLk = LINK(this, SwEnvFmtPage, ModifyHdl);
aAddrLeftField .SetUpHdl( aLk );
aAddrTopField .SetUpHdl( aLk );
@@ -202,19 +241,13 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
}
-// --------------------------------------------------------------------------
-
-
-__EXPORT SwEnvFmtPage::~SwEnvFmtPage()
+SwEnvFmtPage::~SwEnvFmtPage()
{
aAddrEditButton.SetPopupMenu(0);
aSendEditButton.SetPopupMenu(0);
delete ::pMenu;
}
-// --------------------------------------------------------------------------
-
-
IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
{
long lWVal = static_cast< long >(GetFldVal(aSizeWidthField ));
@@ -231,7 +264,7 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
if (aIDs[i] == (sal_uInt16)ePaper)
aSizeFormatBox.SelectEntryPos(i);
- // Benutzergroesse merken
+ // remember user size
if (aIDs[aSizeFormatBox.GetSelectEntryPos()] == (sal_uInt16)PAPER_USER)
{
lUserW = lWidth ;
@@ -250,20 +283,17 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
}
IMPL_LINK_INLINE_END( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
-// --------------------------------------------------------------------------
-
-
IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
{
SwWrtShell* pSh = GetParent()->pSh;
- ASSERT(pSh, "Shell fehlt");
+ OSL_ENSURE(pSh, "Shell missing");
- // Collection-Ptr ermitteln
+ // determine collection-ptr
sal_Bool bSender = pButton != &aAddrEditButton;
SwTxtFmtColl* pColl = pSh->GetTxtCollFromPool( static_cast< sal_uInt16 >(
bSender ? RES_POOLCOLL_SENDADRESS : RES_POOLCOLL_JAKETADRESS));
- ASSERT(pColl, "Text-Collection fehlt");
+ OSL_ENSURE(pColl, "Text collection missing");
switch (pButton->GetCurItemId())
{
@@ -271,11 +301,11 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
{
SfxItemSet *pCollSet = GetCollItemSet(pColl, bSender);
- // Damit die Hintergrundfarbe nicht uebergebuegelt wird:
+ // In order for the background color not to get ironed over:
SfxAllItemSet aTmpSet(*pCollSet);
- // Das CHRATR_BACKGROUND-Attribut wird fuer den Dialog in
- // ein RES_BACKGROUND verwandelt und wieder zurueck ...
+ // The CHRATR_BACKGROUND attribute gets transformed into a
+ // RES_BACKGROUND for the dialog and back again ...
const SfxPoolItem *pTmpBrush;
if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_CHRATR_BACKGROUND,
@@ -289,10 +319,10 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
aTmpSet.ClearItem( RES_BACKGROUND );
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( GetParent(), pSh->GetView(), aTmpSet, DLG_CHAR ,&pColl->GetName() );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (pDlg->Execute() == RET_OK)
{
SfxItemSet aOutputSet( *pDlg->GetOutputItemSet() );
@@ -315,10 +345,10 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
{
SfxItemSet *pCollSet = GetCollItemSet(pColl, bSender);
- // Damit die Tabulatoren nicht uebergebuegelt werden:
+ // In order for the tabulators not to get ironed over:
SfxAllItemSet aTmpSet(*pCollSet);
- // Tabulatoren, DefaultTabs ins ItemSet Stecken
+ // Insert tabs, default tabs into ItemSet
const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
pSh->GetView().GetCurShell()->GetPool().GetDefaultItem(RES_PARATR_TABSTOP);
@@ -326,27 +356,28 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist );
aTmpSet.Put( aDefDistItem );
- // Aktueller Tab
+ // Current tab
SfxUInt16Item aTabPos( SID_ATTR_TABSTOP_POS, 0 );
aTmpSet.Put( aTabPos );
- // linker Rand als Offset
+ // left border as offset
const long nOff = ((SvxLRSpaceItem&)aTmpSet.Get( RES_LR_SPACE )).
GetTxtLeft();
SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
aTmpSet.Put( aOff );
- // BoxInfo setzen
+ // set BoxInfo
::PrepareBoxInfo( aTmpSet, *pSh );
SwParaDlg *pDlg = new SwParaDlg(GetParent(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &pColl->GetName());
if ( pDlg->Execute() == RET_OK )
{
- // Defaults evtl umsetzen
+ // maybe relocate defaults
const SfxPoolItem* pItem = 0;
SfxItemSet* pOutputSet = (SfxItemSet*)pDlg->GetOutputItemSet();
sal_uInt16 nNewDist;
+
if( SFX_ITEM_SET == pOutputSet->GetItemState( SID_ATTR_TABSTOP_DEFAULTS,
sal_False, &pItem ) &&
nDefDist != (nNewDist = ((SfxUInt16Item*)pItem)->GetValue()) )
@@ -358,7 +389,6 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
}
if( pOutputSet->Count() )
{
- //pColl->SetAttr( *pOutputSet );
pCollSet->Put(*pOutputSet);
}
}
@@ -370,7 +400,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
}
/*------------------------------------------------------------------------
- Beschreibung: Ein temporaeres Itemset, das bei Abbruch verworfen wird
+ Description: A temporary Itemset that gets discarded at abort
------------------------------------------------------------------------*/
SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender)
@@ -379,10 +409,10 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender)
if (!pAddrSet)
{
- // Range ermitteln (Ranges beider Itemsets mergen)
+ // determine range (merge both Itemsets' ranges)
const sal_uInt16 *pRanges = pColl->GetAttrSet().GetRanges();
- static sal_uInt16 __READONLY_DATA aRanges[] =
+ static sal_uInt16 const aRanges[] =
{
RES_PARATR_BEGIN, RES_PARATR_ADJUST,
RES_PARATR_TABSTOP, RES_PARATR_END-1,
@@ -395,58 +425,14 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender)
0, 0
};
- // BruteForce-Merge, weil MergeRange in SvTools buggy ist:
- sal_uInt16 i = 0;
- SvLongsSort aMergedRanges( 0, 10 );
-
- while (pRanges[i])
- {
- for (sal_uInt16 nPos = pRanges[i]; nPos <= pRanges[i+1]; nPos++)
- aMergedRanges.Insert(nPos);
- i += 2;
- }
-
- i = 0;
-
- while (aRanges[i])
- {
- for (sal_uInt16 nPos = aRanges[i]; nPos <= aRanges[i+1]; nPos++)
- aMergedRanges.Insert(nPos);
- i += 2;
- }
-
- // Ranges kompaktieren
- SvLongs aCompactedRanges( 0, 10 );
-
- aCompactedRanges.Insert(aMergedRanges[0], aCompactedRanges.Count());
-
- for (i = 0; i < aMergedRanges.Count(); i++)
- {
- while (i + 1 < aMergedRanges.Count() &&
- aMergedRanges[i+1] - aMergedRanges[i] == 1)
- {
- i++;
- }
- long nEnd = aMergedRanges[i];
- aCompactedRanges.Insert(nEnd, aCompactedRanges.Count());
-
- if (i + 1 < aMergedRanges.Count())
- {
- long nStart = aMergedRanges[i+1];
- aCompactedRanges.Insert(nStart, aCompactedRanges.Count());
- }
- }
-
- // Neue Ranges erzeugen
- sal_uInt16 *pNewRanges = new sal_uInt16[aCompactedRanges.Count() + 1];
- for (i = 0; i < aCompactedRanges.Count(); i++)
- pNewRanges[i] = (sal_uInt16)aCompactedRanges[i];
-
- pNewRanges[i] = 0;
+ // BruteForce merge because MergeRange in SvTools is buggy:
+ std::vector<sal_uInt16> pVec = ::lcl_convertRangesToList(pRanges);
+ std::vector<sal_uInt16> aVec = ::lcl_convertRangesToList(aRanges);
+ pVec.insert(pVec.end(), aVec.begin(), aVec.end());
+ sal_uInt16 *pNewRanges = ::lcl_convertListToRanges(pVec);
pAddrSet = new SfxItemSet(GetParent()->pSh->GetView().GetCurShell()->GetPool(),
pNewRanges);
-
pAddrSet->Put(pColl->GetAttrSet());
delete[] pNewRanges;
}
@@ -454,9 +440,6 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender)
return pAddrSet;
}
-// --------------------------------------------------------------------------
-
-
IMPL_LINK( SwEnvFmtPage, FormatHdl, ListBox *, EMPTYARG )
{
long lWidth;
@@ -499,9 +482,6 @@ IMPL_LINK( SwEnvFmtPage, FormatHdl, ListBox *, EMPTYARG )
return 0;
}
-// --------------------------------------------------------------------------
-
-
void SwEnvFmtPage::SetMinMax()
{
long lWVal = static_cast< long >(GetFldVal(aSizeWidthField ));
@@ -510,7 +490,7 @@ void SwEnvFmtPage::SetMinMax()
long lWidth = Max(lWVal, lHVal),
lHeight = Min(lWVal, lHVal);
- // Min und Max
+ // Min and Max
aAddrLeftField.SetMin((long) 100 * (GetFldVal(aSendLeftField) + 566), FUNIT_TWIP);
aAddrLeftField.SetMax((long) 100 * (lWidth - 2 * 566), FUNIT_TWIP);
aAddrTopField .SetMin((long) 100 * (GetFldVal(aSendTopField ) + 2 * 566), FUNIT_TWIP);
@@ -520,7 +500,7 @@ void SwEnvFmtPage::SetMinMax()
aSendTopField .SetMin((long) 100 * (566), FUNIT_TWIP);
aSendTopField .SetMax((long) 100 * (GetFldVal(aAddrTopField ) - 2 * 566), FUNIT_TWIP);
- // First und Last
+ // First and last
aAddrLeftField.SetFirst(aAddrLeftField.GetMin());
aAddrLeftField.SetLast (aAddrLeftField.GetMax());
aAddrTopField .SetFirst(aAddrTopField .GetMin());
@@ -530,7 +510,7 @@ void SwEnvFmtPage::SetMinMax()
aSendTopField .SetFirst(aSendTopField .GetMin());
aSendTopField .SetLast (aSendTopField .GetMax());
- // Fields neu formatieren
+ // Reformat fields
aAddrLeftField .Reformat();
aAddrTopField .Reformat();
aSendLeftField .Reformat();
@@ -539,37 +519,25 @@ void SwEnvFmtPage::SetMinMax()
aSizeHeightField.Reformat();
}
-// --------------------------------------------------------------------------
-
-
-SfxTabPage* __EXPORT SwEnvFmtPage::Create(Window* pParent, const SfxItemSet& rSet)
+SfxTabPage* SwEnvFmtPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwEnvFmtPage(pParent, rSet);
}
-// ----------------------------------------------------------------------------
-
-
-void __EXPORT SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet)
+void SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet)
{
SfxItemSet aSet(rSet);
aSet.Put(GetParent()->aEnvItem);
Reset(aSet);
}
-// ----------------------------------------------------------------------------
-
-
-int __EXPORT SwEnvFmtPage::DeactivatePage(SfxItemSet* _pSet)
+int SwEnvFmtPage::DeactivatePage(SfxItemSet* _pSet)
{
if( _pSet )
FillItemSet(*_pSet);
return SfxTabPage::LEAVE_PAGE;
}
-// --------------------------------------------------------------------------
-
-
void SwEnvFmtPage::FillItem(SwEnvItem& rItem)
{
rItem.lAddrFromLeft = static_cast< sal_Int32 >(GetFldVal(aAddrLeftField));
@@ -594,20 +562,14 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem)
}
}
-// --------------------------------------------------------------------------
-
-
-sal_Bool __EXPORT SwEnvFmtPage::FillItemSet(SfxItemSet& rSet)
+sal_Bool SwEnvFmtPage::FillItemSet(SfxItemSet& rSet)
{
FillItem(GetParent()->aEnvItem);
rSet.Put(GetParent()->aEnvItem);
return sal_True;
}
-// --------------------------------------------------------------------------
-
-
-void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet)
+void SwEnvFmtPage::Reset(const SfxItemSet& rSet)
{
const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP);
@@ -618,7 +580,7 @@ void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet)
if (aIDs[i] == (sal_uInt16)ePaper)
aSizeFormatBox.SelectEntryPos(i);
- // Die MetricFields
+ // Metric fields
SetFldVal(aAddrLeftField, rItem.lAddrFromLeft);
SetFldVal(aAddrTopField , rItem.lAddrFromTop );
SetFldVal(aSendLeftField, rItem.lSendFromLeft);
@@ -633,3 +595,4 @@ void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envfmt.hrc b/sw/source/ui/envelp/envfmt.hrc
index fb15678cacee..f7b997902893 100644
--- a/sw/source/ui/envelp/envfmt.hrc
+++ b/sw/source/ui/envelp/envfmt.hrc
@@ -28,11 +28,9 @@
#ifndef _ENVFMT_HRC
#define _ENVFMT_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define FL_ADDRESSEE 11
#define TXT_ADDR_POS 12
@@ -66,16 +64,16 @@
#define MID_CHAR 1
#define MID_PARA 2
-// Globale Resourcen ********************************************************
+// global resources ********************************************************
#define MNU_EDIT (RC_ENVFMT_BEGIN )
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
#define ENVFMT_ACT_END MNU_EDIT
#if ENVFMT_ACT_END > RC_ENVFMT_END
-#error Resource-Ueberlauf in #file, #line
+#error resource overflow in #file, #line
#endif
#endif
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index 90c35adc50ff..097eb46cfb47 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,15 +34,9 @@
#include <svl/svstdarr.hxx>
#endif
#include <svtools/stdctrl.hxx>
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _MENUBTN_HXX //autogen
#include <vcl/menubtn.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include "envlop.hxx"
@@ -110,3 +105,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envfmt.src b/sw/source/ui/envelp/envfmt.src
index 5ad5a4b9d6a4..02ea2ea4487c 100644
--- a/sw/source/ui/envelp/envfmt.src
+++ b/sw/source/ui/envelp/envfmt.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "envfmt.hrc"
#include "helpid.h"
// TP_ENV_FMT ---------------------------------------------------------------
diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx
index 1a2ee6c27f22..d83deaa3eab2 100644
--- a/sw/source/ui/envelp/envimg.cxx
+++ b/sw/source/ui/envelp/envimg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,16 +39,11 @@
#include <unotools/useroptions.hxx>
#include <tools/shl.hxx>
#include <swmodule.hxx>
-#include <errhdl.hxx>
#include <swtypes.hxx>
#include <envimg.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _ENVELP_HRC
#include <envelp.hrc>
-#endif
#include <unomid.h>
@@ -58,13 +54,13 @@
#endif
using namespace utl;
-using namespace rtl;
using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
+
TYPEINIT1_AUTOFACTORY( SwEnvItem, SfxPoolItem );
-// --------------------------------------------------------------------------
SW_DLLPUBLIC String MakeSender()
{
SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions();
@@ -107,7 +103,7 @@ SW_DLLPUBLIC String MakeSender()
}
return sRet;
}
-// --------------------------------------------------------------------------
+
SwEnvItem::SwEnvItem() :
SfxPoolItem(FN_ENVELOP)
{
@@ -127,7 +123,7 @@ SwEnvItem::SwEnvItem() :
lAddrFromLeft = Max(lWidth, lHeight) / 2;
lAddrFromTop = Min(lWidth, lHeight) / 2;
}
-// --------------------------------------------------------------------------
+
SwEnvItem::SwEnvItem(const SwEnvItem& rItem) :
SfxPoolItem(FN_ENVELOP),
aAddrText (rItem.aAddrText),
@@ -146,7 +142,6 @@ SwEnvItem::SwEnvItem(const SwEnvItem& rItem) :
{
}
-// --------------------------------------------------------------------------
SwEnvItem& SwEnvItem::operator =(const SwEnvItem& rItem)
{
aAddrText = rItem.aAddrText;
@@ -164,7 +159,7 @@ SwEnvItem& SwEnvItem::operator =(const SwEnvItem& rItem)
lShiftDown = rItem.lShiftDown;
return *this;
}
-// --------------------------------------------------------------------------
+
int SwEnvItem::operator ==(const SfxPoolItem& rItem) const
{
const SwEnvItem& rEnv = (const SwEnvItem&) rItem;
@@ -184,13 +179,11 @@ int SwEnvItem::operator ==(const SfxPoolItem& rItem) const
lShiftDown == rEnv.lShiftDown;
}
-// --------------------------------------------------------------------------
SfxPoolItem* SwEnvItem::Clone(SfxItemPool*) const
{
return new SwEnvItem(*this);
}
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
+
SwEnvCfgItem::SwEnvCfgItem() :
ConfigItem(C2U("Office.Writer/Envelope"))
{
@@ -198,7 +191,7 @@ SwEnvCfgItem::SwEnvCfgItem() :
Sequence<Any> aValues = GetProperties(aNames);
EnableNotification(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -253,15 +246,11 @@ SwEnvCfgItem::SwEnvCfgItem() :
}
}
}
-/* -----------------------------26.09.00 14:04--------------------------------
- ---------------------------------------------------------------------------*/
SwEnvCfgItem::~SwEnvCfgItem()
{
}
-/* -----------------------------26.09.00 14:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwEnvCfgItem::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -293,9 +282,6 @@ void SwEnvCfgItem::Commit()
void SwEnvCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/* -----------------------------26.09.00 14:04--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<rtl::OUString> SwEnvCfgItem::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -317,14 +303,16 @@ Sequence<rtl::OUString> SwEnvCfgItem::GetPropertyNames()
const int nCount = 13;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
+
for(int i = 0; i < nCount; i++)
pNames[i] = OUString::createFromAscii(aPropNames[i]);
+
return aNames;
}
-sal_Bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
+bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ sal_Bool bRet = true;
switch(nMemberId & ~CONVERT_TWIPS)
{
case MID_ENV_ADDR_TEXT : rVal <<= aAddrText; break;
@@ -341,17 +329,15 @@ sal_Bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
case MID_ENV_SHIFT_RIGHT : rVal <<= lShiftRight; break;
case MID_ENV_SHIFT_DOWN : rVal <<= lShiftDown; break;
default:
- DBG_ERROR("Wrong memberId");
- bRet = sal_False;
+ OSL_FAIL("Wrong memberId");
+ bRet = false;
}
return bRet;
}
-/* -----------------------------26.04.01 12:26--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
+bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
switch(nMemberId & ~CONVERT_TWIPS)
{
case MID_ENV_ADDR_TEXT : bRet = (rVal >>= aAddrText); break;
@@ -375,7 +361,9 @@ sal_Bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
case MID_ENV_SHIFT_RIGHT : bRet = (rVal >>= lShiftRight); break;
case MID_ENV_SHIFT_DOWN : bRet = (rVal >>= lShiftDown); break;
default:
- DBG_ERROR("Wrong memberId");
+ OSL_FAIL("Wrong memberId");
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envlop.hrc b/sw/source/ui/envelp/envlop.hrc
index 43f51d3a48df..04b2a1396826 100644
--- a/sw/source/ui/envelp/envlop.hrc
+++ b/sw/source/ui/envelp/envlop.hrc
@@ -28,11 +28,9 @@
#ifndef _ENVLOP_HRC
#define _ENVLOP_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define TXT_ADDR 1
#define EDT_ADDR 2
@@ -48,11 +46,11 @@
#define WIN_PREVIEW 12
#define ST_INSERT 13
#define ST_CHANGE 14
-// Globale Resourcen ********************************************************
+// global resources ********************************************************
#define STR_DOC_TITLE (RC_ENVLOP_BEGIN)
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
#define ENVLOP_ACT_END STR_DOC_TITLE
diff --git a/sw/source/ui/envelp/envlop.src b/sw/source/ui/envelp/envlop.src
index 2b9a5a084cc8..32bc1856441b 100644
--- a/sw/source/ui/envelp/envlop.src
+++ b/sw/source/ui/envelp/envlop.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "envlop.hrc"
#include "helpid.h"
// DLG_ENV ------------------------------------------------------------------
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index baa0013392ab..a0e4525f8df3 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,8 +32,6 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
#include "dbmgr.hxx"
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
@@ -40,7 +39,6 @@
#include <viewopt.hxx>
#include "wrtsh.hxx"
-#include "errhdl.hxx"
#include "cmdid.h"
#include "helpid.h"
#include "envfmt.hxx"
@@ -65,8 +63,6 @@ using namespace ::rtl;
//impl in envimg.cxx
extern SW_DLLPUBLIC String MakeSender();
-// --------------------------------------------------------------------------
-
SwEnvPreview::SwEnvPreview(SfxTabPage* pParent, const ResId& rResID) :
Window(pParent, rResID)
@@ -75,15 +71,10 @@ SwEnvPreview::SwEnvPreview(SfxTabPage* pParent, const ResId& rResID) :
SetMapMode(MapMode(MAP_PIXEL));
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvPreview::~SwEnvPreview()
{
}
-// ----------------------------------------------------------------------------
void SwEnvPreview::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -91,8 +82,6 @@ void SwEnvPreview::DataChanged( const DataChangedEvent& rDCEvt )
SetBackground( GetSettings().GetStyleSettings().GetDialogColor() );
}
-// ----------------------------------------------------------------------------
-
void SwEnvPreview::Paint(const Rectangle &)
{
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
@@ -116,7 +105,7 @@ void SwEnvPreview::Paint(const Rectangle &)
SetLineColor( aFront );
- // Umschlag
+ // Envelope
long nW = (sal_uInt16) (f * nPageW),
nH = (sal_uInt16) (f * nPageH),
nX = (GetOutputSizePixel().Width () - nW) / 2,
@@ -124,7 +113,7 @@ void SwEnvPreview::Paint(const Rectangle &)
SetFillColor( aBack );
DrawRect(Rectangle(Point(nX, nY), Size(nW, nH)));
- // Absender
+ // Sender
if (rItem.bSend)
{
long nSendX = nX + (sal_uInt16) (f * rItem.lSendFromLeft),
@@ -136,7 +125,7 @@ void SwEnvPreview::Paint(const Rectangle &)
DrawRect(Rectangle(Point(nSendX, nSendY), Size(nSendW, nSendH)));
}
- // Empfaenger
+ // Addressee
long nAddrX = nX + (sal_uInt16) (f * rItem.lAddrFromLeft),
nAddrY = nY + (sal_uInt16) (f * rItem.lAddrFromTop ),
nAddrW = (sal_uInt16) (f * (nPageW - rItem.lAddrFromLeft - 566)),
@@ -144,7 +133,7 @@ void SwEnvPreview::Paint(const Rectangle &)
SetFillColor( aMedium );
DrawRect(Rectangle(Point(nAddrX, nAddrY), Size(nAddrW, nAddrH)));
- // Briefmarke
+ // Stamp
long nStmpW = (sal_uInt16) (f * 1417 /* 2,5 cm */),
nStmpH = (sal_uInt16) (f * 1701 /* 3,0 cm */),
nStmpX = nX + nW - (sal_uInt16) (f * 566) - nStmpW,
@@ -154,10 +143,6 @@ void SwEnvPreview::Paint(const Rectangle &)
DrawRect(Rectangle(Point(nStmpX, nStmpY), Size(nStmpW, nStmpH)));
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet,
SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert) :
@@ -174,7 +159,7 @@ SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet,
GetOKButton().SetText(String(SW_RES(STR_BTN_NEWDOC)));
GetOKButton().SetHelpId(HID_ENVELOP_PRINT);
- GetOKButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird
+ GetOKButton().SetHelpText(aEmptyStr); // in order for generated help text to get used
if (GetUserButton())
{
GetUserButton()->SetText(bInsert ? sInsert : sChange);
@@ -186,20 +171,12 @@ SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet,
AddTabPage(TP_ENV_PRT, SwEnvPrtPage::Create, 0);
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvDlg::~SwEnvDlg()
{
delete pAddresseeSet;
delete pSenderSet;
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
if (nId == TP_ENV_PRT)
@@ -208,8 +185,6 @@ void SwEnvDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
}
}
-// --------------------------------------------------------------------------
-
short SwEnvDlg::Ok()
{
short nRet = SfxTabDialog::Ok();
@@ -231,10 +206,6 @@ short SwEnvDlg::Ok()
return nRet;
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_ENV_ENV), rSet),
@@ -257,7 +228,7 @@ SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) :
SetExchangeSupport();
pSh = GetParent()->pSh;
- // Handler installieren
+ // Install handlers
aDatabaseLB .SetSelectHdl(LINK(this, SwEnvPage, DatabaseHdl ));
aTableLB .SetSelectHdl(LINK(this, SwEnvPage, DatabaseHdl ));
aInsertBT .SetClickHdl (LINK(this, SwEnvPage, FieldHdl ));
@@ -271,18 +242,10 @@ SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) :
InitDatabaseBox();
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvPage::~SwEnvPage()
{
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox )
{
SwWait aWait( *pSh->GetView().GetDocShell(), sal_True );
@@ -295,26 +258,20 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox )
}
else
sActDBName.SetToken(1, DB_DELIM, aTableLB.GetSelectEntry());
- pSh->GetNewDBMgr()->GetColumnNames(
- &aDBFieldLB, aDatabaseLB.GetSelectEntry(), aTableLB.GetSelectEntry());
+ pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, aDatabaseLB.GetSelectEntry(),
+ aTableLB.GetSelectEntry());
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPage, FieldHdl, Button *, EMPTYARG )
{
String aStr ( '<' );
aStr += aDatabaseLB.GetSelectEntry();
aStr += '.';
-// aStr += DB_DELIM;
aStr += aTableLB.GetSelectEntry();
aStr += '.';
aStr += aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1';
aStr += '.';
-// aStr += DB_DELIM;
aStr += aDBFieldLB.GetSelectEntry();
aStr += '>';
aAddrEdit.ReplaceSelected(aStr);
@@ -324,10 +281,6 @@ IMPL_LINK( SwEnvPage, FieldHdl, Button *, EMPTYARG )
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPage, SenderHdl, Button *, EMPTYARG )
{
const sal_Bool bEnable = aSenderBox.IsChecked();
@@ -343,10 +296,6 @@ IMPL_LINK( SwEnvPage, SenderHdl, Button *, EMPTYARG )
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvPage::InitDatabaseBox()
{
if (pSh->GetNewDBMgr())
@@ -354,6 +303,7 @@ void SwEnvPage::InitDatabaseBox()
aDatabaseLB.Clear();
Sequence<OUString> aDataNames = SwNewDBMgr::GetExistingDatabaseNames();
const OUString* pDataNames = aDataNames.getConstArray();
+
for (long i = 0; i < aDataNames.getLength(); i++)
aDatabaseLB.InsertEntry(pDataNames[i]);
@@ -371,19 +321,11 @@ void SwEnvPage::InitDatabaseBox()
}
}
-// --------------------------------------------------------------------------
-
-
-
SfxTabPage* SwEnvPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwEnvPage(pParent, rSet);
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
{
SfxItemSet aSet(rSet);
@@ -391,10 +333,6 @@ void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
Reset(aSet);
}
-// --------------------------------------------------------------------------
-
-
-
int SwEnvPage::DeactivatePage(SfxItemSet* _pSet)
{
FillItem(GetParent()->aEnvItem);
@@ -403,10 +341,6 @@ int SwEnvPage::DeactivatePage(SfxItemSet* _pSet)
return SfxTabPage::LEAVE_PAGE;
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvPage::FillItem(SwEnvItem& rItem)
{
rItem.aAddrText = aAddrEdit .GetText();
@@ -414,10 +348,6 @@ void SwEnvPage::FillItem(SwEnvItem& rItem)
rItem.aSendText = aSenderEdit.GetText();
}
-// --------------------------------------------------------------------------
-
-
-
sal_Bool SwEnvPage::FillItemSet(SfxItemSet& rSet)
{
FillItem(GetParent()->aEnvItem);
@@ -425,10 +355,6 @@ sal_Bool SwEnvPage::FillItemSet(SfxItemSet& rSet)
return sal_True;
}
-// ----------------------------------------------------------------------------
-
-
-
void SwEnvPage::Reset(const SfxItemSet& rSet)
{
SwEnvItem aItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP);
@@ -439,3 +365,4 @@ void SwEnvPage::Reset(const SfxItemSet& rSet)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index f12eaa95240d..72b80d531a7d 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,10 +45,6 @@
#include "envprt.hrc"
-
-
-
-
SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_ENV_PRT), rSet),
@@ -68,12 +65,12 @@ SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) :
FreeResource();
SetExchangeSupport();
- // Metriken
+ // Metrics
FieldUnit eUnit = ::GetDfltMetric(sal_False);
SetMetric(aRightField, eUnit);
SetMetric(aDownField , eUnit);
- // Handler installieren
+ // Install handlers
aTopButton .SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl));
aBottomButton.SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl));
@@ -85,58 +82,43 @@ SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) :
// ToolBox
Size aSz = aAlignBox.CalcWindowSizePixel();
aAlignBox.SetSizePixel(aSz);
-// aAlignBox.SetPosPixel(Point(aNoNameFL.GetPosPixel().X() + (aNoNameFL.GetSizePixel().Width() - aSz.Width()) / 2, aAlignBox.GetPosPixel().Y()));
aAlignBox.SetClickHdl(LINK(this, SwEnvPrtPage, AlignHdl));
-
}
-// --------------------------------------------------------------------------
-
-
-
SwEnvPrtPage::~SwEnvPrtPage()
{
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPrtPage, ClickHdl, Button *, EMPTYARG )
{
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
if (aBottomButton.IsChecked())
{
- // Briefumschlaege von unten
- aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(bHC ? BMP_HOR_LEFT_LOWER_H : BMP_HOR_LEFT_LOWER)));
- aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(bHC ? BMP_HOR_CNTR_LOWER_H : BMP_HOR_CNTR_LOWER)));
- aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(bHC ? BMP_HOR_RGHT_LOWER_H : BMP_HOR_RGHT_LOWER)));
- aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(bHC ? BMP_VER_LEFT_LOWER_H : BMP_VER_LEFT_LOWER)));
- aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(bHC ? BMP_VER_CNTR_LOWER_H : BMP_VER_CNTR_LOWER)));
- aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(bHC ? BMP_VER_RGHT_LOWER_H : BMP_VER_RGHT_LOWER)));
+ // Envelope from botton
+ aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_LOWER)));
+ aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_LOWER)));
+ aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_LOWER)));
+ aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_LOWER)));
+ aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_LOWER)));
+ aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_LOWER)));
}
else
{
- // Briefumschlaege von oben
- aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(bHC ? BMP_HOR_LEFT_UPPER_H : BMP_HOR_LEFT_UPPER)));
- aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(bHC ? BMP_HOR_CNTR_UPPER_H : BMP_HOR_CNTR_UPPER)));
- aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(bHC ? BMP_HOR_RGHT_UPPER_H : BMP_HOR_RGHT_UPPER)));
- aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(bHC ? BMP_VER_LEFT_UPPER_H : BMP_VER_LEFT_UPPER)));
- aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(bHC ? BMP_VER_CNTR_UPPER_H : BMP_VER_CNTR_UPPER)));
- aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(bHC ? BMP_VER_RGHT_UPPER_H : BMP_VER_RGHT_UPPER)));
+ // Envelope from top
+ aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_UPPER)));
+ aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_UPPER)));
+ aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_UPPER)));
+ aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_UPPER)));
+ aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_UPPER)));
+ aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_UPPER)));
}
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
{
if (pBtn == &aPrtSetup)
{
- // Druck-Setup aufrufen
+ // Call printer setup
if (pPrt)
{
PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
@@ -150,10 +132,6 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwEnvPrtPage, AlignHdl, ToolBox *, EMPTYARG )
{
if (aAlignBox.GetCurItemId())
@@ -164,36 +142,24 @@ IMPL_LINK( SwEnvPrtPage, AlignHdl, ToolBox *, EMPTYARG )
}
else
{
- // GetCurItemId() == 0 ist moeglich!
+ // GetCurItemId() == 0 is possible!
const SwEnvItem& rItem = (const SwEnvItem&) GetItemSet().Get(FN_ENVELOP);
aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT, sal_True);
}
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
SfxTabPage* SwEnvPrtPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwEnvPrtPage(pParent, rSet);
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvPrtPage::ActivatePage(const SfxItemSet&)
{
if (pPrt)
aPrinterInfo.SetText(pPrt->GetName());
}
-// --------------------------------------------------------------------------
-
-
-
int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet)
{
if( _pSet )
@@ -201,10 +167,6 @@ int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet)
return SfxTabPage::LEAVE_PAGE;
}
-// --------------------------------------------------------------------------
-
-
-
void SwEnvPrtPage::FillItem(SwEnvItem& rItem)
{
sal_uInt16 nID = 0;
@@ -218,10 +180,6 @@ void SwEnvPrtPage::FillItem(SwEnvItem& rItem)
rItem.lShiftDown = static_cast< sal_Int32 >(GetFldVal(aDownField ));
}
-// --------------------------------------------------------------------------
-
-
-
sal_Bool SwEnvPrtPage::FillItemSet(SfxItemSet& rSet)
{
FillItem(GetParent()->aEnvItem);
@@ -229,16 +187,9 @@ sal_Bool SwEnvPrtPage::FillItemSet(SfxItemSet& rSet)
return sal_True;
}
-// ----------------------------------------------------------------------------
-
-
-
void SwEnvPrtPage::Reset(const SfxItemSet& rSet)
{
-// SfxItemSet aSet(rSet);
-// aSet.Put(GetParent()->aEnvItem);
-
- // Item auslesen
+ // Read item
const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP);
aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT);
@@ -257,3 +208,4 @@ void SwEnvPrtPage::Reset(const SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envprt.hrc b/sw/source/ui/envelp/envprt.hrc
index 902416e80764..b4a98b0545ba 100644
--- a/sw/source/ui/envelp/envprt.hrc
+++ b/sw/source/ui/envelp/envprt.hrc
@@ -28,11 +28,9 @@
#ifndef _ENVPRT_HRC
#define _ENVPRT_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define BOX_ALIGN 1
#define BTN_TOP 7
@@ -46,7 +44,7 @@
#define BTN_PRTSETUP 15
#define FL_PRINTER 16
-// Globale Resourcen ********************************************************
+// global resources ********************************************************
#define BMP_HOR_LEFT_LOWER (RC_ENVPRT_BEGIN )
#define BMP_HOR_LEFT_UPPER (RC_ENVPRT_BEGIN + 1)
@@ -69,26 +67,11 @@
#define ITM_VER_CNTR (RC_ENVPRT_BEGIN + 16)
#define ITM_VER_RGHT (RC_ENVPRT_BEGIN + 17)
-#define BMP_HOR_LEFT_LOWER_H (RC_ENVPRT_HC_BEGIN )
-#define BMP_HOR_LEFT_UPPER_H (RC_ENVPRT_HC_BEGIN + 1)
-#define BMP_HOR_CNTR_LOWER_H (RC_ENVPRT_HC_BEGIN + 2)
-#define BMP_HOR_CNTR_UPPER_H (RC_ENVPRT_HC_BEGIN + 3)
-#define BMP_HOR_RGHT_LOWER_H (RC_ENVPRT_HC_BEGIN + 4)
-#define BMP_HOR_RGHT_UPPER_H (RC_ENVPRT_HC_BEGIN + 5)
-
-#define BMP_VER_LEFT_LOWER_H (RC_ENVPRT_HC_BEGIN + 6)
-#define BMP_VER_LEFT_UPPER_H (RC_ENVPRT_HC_BEGIN + 7)
-#define BMP_VER_CNTR_LOWER_H (RC_ENVPRT_HC_BEGIN + 8)
-#define BMP_VER_CNTR_UPPER_H (RC_ENVPRT_HC_BEGIN + 9)
-#define BMP_VER_RGHT_LOWER_H (RC_ENVPRT_HC_BEGIN + 10)
-#define BMP_VER_RGHT_UPPER_H (RC_ENVPRT_HC_BEGIN + 11)
-
-
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
-#define ENVPRT_ACT_END BMP_VER_RGHT_UPPER_H
+#define ENVPRT_ACT_END ITM_VER_RGHT
-#if ENVPRT_ACT_END > RC_ENVPRT_HC_END
+#if ENVPRT_ACT_END > ITM_VER_RGHT
#error Resource-Ueberlauf in #file, #line
#endif
diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx
index afc7127c2702..c5a8903dc66e 100644
--- a/sw/source/ui/envelp/envprt.hxx
+++ b/sw/source/ui/envelp/envprt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
@@ -91,3 +90,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/envprt.src b/sw/source/ui/envelp/envprt.src
index a12db0d166f9..706040970163 100644
--- a/sw/source/ui/envelp/envprt.src
+++ b/sw/source/ui/envelp/envprt.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma *****************************************************************
- // #include ****************************************************************
#include "envprt.hrc"
#include "helpid.h"
// TP_ENV_PRT ---------------------------------------------------------------
@@ -217,81 +216,3 @@ Bitmap BMP_VER_RGHT_UPPER
{
File = "envvr_u.bmp" ;
};
-// HighContrast Bitmaps
-Bitmap BMP_HOR_LEFT_LOWER_H
-{
- File = "envhl_l_h.bmp" ;
-};
-Bitmap BMP_HOR_LEFT_UPPER_H
-{
- File = "envhl_u_h.bmp" ;
-};
-Bitmap BMP_HOR_CNTR_LOWER_H
-{
- File = "envhc_l_h.bmp" ;
-};
-Bitmap BMP_HOR_CNTR_UPPER_H
-{
- File = "envhc_u_h.bmp" ;
-};
-Bitmap BMP_HOR_RGHT_LOWER_H
-{
- File = "envhr_l_h.bmp" ;
-};
-Bitmap BMP_HOR_RGHT_UPPER_H
-{
- File = "envhr_u_h.bmp" ;
-};
-Bitmap BMP_VER_LEFT_LOWER_H
-{
- File = "envvl_l_h.bmp" ;
-};
-Bitmap BMP_VER_LEFT_UPPER_H
-{
- File = "envvl_u_h.bmp" ;
-};
-Bitmap BMP_VER_CNTR_LOWER_H
-{
- File = "envvc_l_h.bmp" ;
-};
-Bitmap BMP_VER_CNTR_UPPER_H
-{
- File = "envvc_u_h.bmp" ;
-};
-Bitmap BMP_VER_RGHT_LOWER_H
-{
- File = "envvr_l_h.bmp" ;
-};
-Bitmap BMP_VER_RGHT_UPPER_H
-{
- File = "envvr_u_h.bmp" ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sw/source/ui/envelp/label.hrc b/sw/source/ui/envelp/label.hrc
index 3817ff92def4..4b563068cb66 100644
--- a/sw/source/ui/envelp/label.hrc
+++ b/sw/source/ui/envelp/label.hrc
@@ -28,11 +28,9 @@
#ifndef _LABEL_HRC
#define _LABEL_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define TXT_WRITING 1
#define BOX_ADDR 2
@@ -112,11 +110,11 @@
//#define FT_MOBILE 72
#define FT_FAX 73
-// Globale Resourcen ********************************************************
+// global resources ********************************************************
#define STR_DOC_TITLE (RC_LABEL_BEGIN)
#define STR_CUSTOM (RC_LABEL_BEGIN + 1)
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
#define LABEL_ACT_END STR_CUSTOM
diff --git a/sw/source/ui/envelp/label.src b/sw/source/ui/envelp/label.src
index bd5be722ce46..7d554d282e8f 100644
--- a/sw/source/ui/envelp/label.src
+++ b/sw/source/ui/envelp/label.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "label.hrc"
#include "globals.hrc"
#include "helpid.h"
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 4ee1d3295ddc..86ddf85552d8 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,22 +43,12 @@
#include <labfmt.hxx>
#include <labprt.hxx>
#include <unotools.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include "uitool.hxx"
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _LABEL_HRC
#include <label.hrc>
-#endif
//impl in envimg.cxx
extern SW_DLLPUBLIC String MakeSender();
@@ -90,19 +81,14 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const
rItem.nRows = nRows;
}
-// --------------------------------------------------------------------------
void SwLabDlg::_ReplaceGroup( const String &rMake )
{
- //Die alten Eintraege vernichten.
+ // Remove old entries
pRecs->Remove( 1, pRecs->Count() - 1 );
aLabelsCfg.FillLabels(rtl::OUString(rMake), *pRecs);
aLstGroup = rMake;
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
if (nId == TP_LAB_LAB)
@@ -119,10 +105,6 @@ void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
pPrtPage = (SwLabPrtPage*)&rPage;
}
-// --------------------------------------------------------------------------
-
-
-
SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
SwNewDBMgr* pDBMgr, sal_Bool bLabel) :
SfxTabDialog( pParent, SW_RES(DLG_LAB), &rSet, sal_False ),
@@ -144,7 +126,7 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
GetOKButton().SetText(String(SW_RES(STR_BTN_NEW_DOC)));
GetOKButton().SetHelpId(HID_LABEL_INSERT);
- GetOKButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird
+ GetOKButton().SetHelpText(aEmptyStr); // in order for generated help text to get used
AddTabPage(TP_LAB_LAB, m_bLabel ? sFormat : sMedium ,SwLabPage ::Create, 0, sal_False, 0);
AddTabPage(TP_VISITING_CARDS, SwVisitingCardPage::Create, 0);
@@ -164,7 +146,7 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
{
SetText(sBusinessCardDlg);
}
- // Benutzer-Etikette aus writer.cfg lesen
+ // Read user label from writer.cfg
SwLabItem aItem((const SwLabItem&)rSet.Get( FN_LABEL ));
SwLabRec* pRec = new SwLabRec;
const String aTmp( SW_RES( STR_CUSTOM ) );
@@ -198,17 +180,15 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
if ( aMakes.Count() )
_ReplaceGroup( *aMakes[nLstGroup] );
+
if (pExampleSet)
pExampleSet->Put(aItem);
}
-// --------------------------------------------------------------------------
-
SwLabDlg::~SwLabDlg()
{
delete pRecs;
}
-// --------------------------------------------------------------------------
void SwLabDlg::GetLabItem(SwLabItem &rItem)
{
@@ -216,23 +196,21 @@ void SwLabDlg::GetLabItem(SwLabItem &rItem)
const SwLabItem& rOldItem = (const SwLabItem&)GetInputSetImpl()->Get(FN_LABEL);
if (rActItem != rOldItem)
- { // Wurde schon mal mit (hoffentlich) korrektem Inhalt "geputtet"
+ {
+ // Was already "put" with (hopefully) correct content
rItem = rActItem;
}
else
{
rItem = rOldItem;
- // Im rItem stehen (vom Namen mal abgesehen) immer nur die
- // benutzerdefinierbaren Einstellungen. Daher richtige Werte
- // direkt aus dem Record besorgen:
+ // In rItem there are only settings defined by users.
+ // Therefore get the real settings directly from Record
SwLabRec* pRec = GetRecord(rItem.aType, rItem.bCont);
pRec->FillItem( rItem );
}
}
-// --------------------------------------------------------------------------
-
SwLabRec* SwLabDlg::GetRecord(const String &rRecName, sal_Bool bCont)
{
SwLabRec* pRec = NULL;
@@ -250,14 +228,12 @@ SwLabRec* SwLabDlg::GetRecord(const String &rRecName, sal_Bool bCont)
break;
}
}
- if (!bFound) // Benutzerdefiniert
+ if (!bFound) // User defined
pRec = Recs()[0];
return(pRec);
}
-// --------------------------------------------------------------------------
-
Printer *SwLabDlg::GetPrt()
{
if (pPrtPage)
@@ -266,7 +242,6 @@ Printer *SwLabDlg::GetPrt()
return (NULL);
}
-// --------------------------------------------------------------------------
SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_LAB_LAB), rSet),
pNewDBMgr(NULL),
@@ -299,7 +274,7 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
SetExchangeSupport();
- // Handler installieren
+ // Install handlers
aAddrBox .SetClickHdl (LINK(this, SwLabPage, AddrHdl ));
aDatabaseLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl ));
aTableLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl ));
@@ -318,24 +293,19 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
{
String &rStr = *GetParent()->Makes()[i];
aMakeBox.InsertEntry( rStr );
+
if ( rStr == String(aItem.aLstMake) )
nLstGroup = i;
}
-// Reset(rSet);
+
aMakeBox.SelectEntryPos( nLstGroup );
aMakeBox.GetSelectHdl().Call( &aMakeBox );
}
-// --------------------------------------------------------------------------
-
-
-
SwLabPage::~SwLabPage()
{
}
-/* -----------------29.09.99 09:08-------------------
- --------------------------------------------------*/
void lcl_ChgYPos(Window& rWin, long nDiff)
{
Point aTempPos(rWin.GetPosPixel());
@@ -367,7 +337,6 @@ void SwLabPage::SetToBusinessCard()
Point aFLPos(aWritingFL.GetPosPixel());
long nDiffPos = aFormatFL.GetPosPixel().Y() - aFLPos.Y();
Size aFLSz(aFormatFL.GetSizePixel());
-// aFLSz.Height() += nDiffPos;
aFormatFL.SetPosSizePixel(aFLPos, aFLSz);
// move all controls up
@@ -387,23 +356,18 @@ void SwLabPage::SetToBusinessCard()
aTypeBox.SetPosPixel(aLBPos);
};
-// --------------------------------------------------------------------------
-
-
IMPL_LINK( SwLabPage, AddrHdl, Button *, EMPTYARG )
{
String aWriting;
+
if ( aAddrBox.IsChecked() )
aWriting = MakeSender();
+
aWritingEdit.SetText( aWriting.ConvertLineEnd() );
aWritingEdit.GrabFocus();
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox )
{
sActDBName = aDatabaseLB.GetSelectEntry();
@@ -412,12 +376,11 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox )
if (pListBox == &aDatabaseLB)
GetNewDBMgr()->GetTableNames(&aTableLB, sActDBName);
+
GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName, aTableLB.GetSelectEntry());
return 0;
}
-
-
IMPL_LINK( SwLabPage, FieldHdl, Button *, EMPTYARG )
{
String aStr ( '<' );
@@ -436,10 +399,6 @@ IMPL_LINK( SwLabPage, FieldHdl, Button *, EMPTYARG )
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK_INLINE_START( SwLabPage, PageHdl, Button *, EMPTYARG )
{
aMakeBox.GetSelectHdl().Call( &aMakeBox );
@@ -447,10 +406,6 @@ IMPL_LINK_INLINE_START( SwLabPage, PageHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwLabPage, PageHdl, Button *, EMPTYARG )
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
{
WaitObject aWait( GetParent() );
@@ -505,10 +460,6 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK_INLINE_START( SwLabPage, TypeHdl, ListBox *, EMPTYARG )
{
DisplayFormat();
@@ -517,10 +468,6 @@ IMPL_LINK_INLINE_START( SwLabPage, TypeHdl, ListBox *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwLabPage, TypeHdl, ListBox *, EMPTYARG )
-// --------------------------------------------------------------------------
-
-
-
void SwLabPage::DisplayFormat()
{
MetricField aField(this, WinBits(0));
@@ -552,8 +499,6 @@ void SwLabPage::DisplayFormat()
aFormatInfo.SetText(aText);
}
-// --------------------------------------------------------------------------
-
SwLabRec* SwLabPage::GetSelectedEntryPos()
{
String sSelEntry(aTypeBox.GetSelectEntry());
@@ -561,10 +506,6 @@ SwLabRec* SwLabPage::GetSelectedEntryPos()
return GetParent()->GetRecord(sSelEntry, aContButton.IsChecked());
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabPage::InitDatabaseBox()
{
if( GetNewDBMgr() )
@@ -587,18 +528,16 @@ void SwLabPage::InitDatabaseBox()
}
}
-// --------------------------------------------------------------------------
SfxTabPage* SwLabPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwLabPage(pParent, rSet);
}
-// --------------------------------------------------------------------------
void SwLabPage::ActivatePage(const SfxItemSet& rSet)
{
Reset( rSet );
}
-// --------------------------------------------------------------------------
+
int SwLabPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
@@ -607,10 +546,6 @@ int SwLabPage::DeactivatePage(SfxItemSet* _pSet)
return sal_True;
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabPage::FillItem(SwLabItem& rItem)
{
rItem.bAddr = aAddrBox.IsChecked();
@@ -627,10 +562,6 @@ void SwLabPage::FillItem(SwLabItem& rItem)
rItem.aLstType = aTypeBox.GetSelectEntry();
}
-// --------------------------------------------------------------------------
-
-
-
sal_Bool SwLabPage::FillItemSet(SfxItemSet& rSet)
{
FillItem( aItem );
@@ -639,8 +570,6 @@ sal_Bool SwLabPage::FillItemSet(SfxItemSet& rSet)
return sal_True;
}
-// --------------------------------------------------------------------------
-
void SwLabPage::Reset(const SfxItemSet& rSet)
{
aItem = (const SwLabItem&) rSet.Get(FN_LABEL);
@@ -685,10 +614,6 @@ void SwLabPage::Reset(const SfxItemSet& rSet)
aSheetButton.Check();
}
-/*-- 08.07.99 14:00:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-//-----------------------------------------------------------------------------
void SwVisitingCardPage::ClearUserData()
{
SvLBoxEntry* pEntry = aAutoTextLB.First();
@@ -699,8 +624,6 @@ void SwVisitingCardPage::ClearUserData()
}
}
-//-----------------------------------------------------------------------------
-
void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt,
const rtl::OUString* pNames, const rtl::OUString* pValues )
{
@@ -711,8 +634,6 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt,
}
}
-//-----------------------------------------------------------------------------
-
SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_VISITING_CARDS), rSet),
aContentFL(this, SW_RES( FL_CONTENT )),
@@ -740,9 +661,7 @@ SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet)
aAutoTextGroupLB.Show();
InitFrameControl();
}
-/*-- 08.07.99 14:00:03---------------------------------------------------
- -----------------------------------------------------------------------*/
SwVisitingCardPage::~SwVisitingCardPage()
{
for(sal_uInt16 i = 0; i < aAutoTextGroupLB.GetEntryCount(); i++)
@@ -752,38 +671,31 @@ SwVisitingCardPage::~SwVisitingCardPage()
ClearUserData();
delete pExampleFrame;
}
-/*-- 08.07.99 14:00:03---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwVisitingCardPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwVisitingCardPage(pParent, rSet);
}
-/*-- 08.07.99 14:00:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet)
{
Reset( rSet );
UpdateFields();
}
-/*-- 08.07.99 14:00:04---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwVisitingCardPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
FillItemSet(*_pSet);
return LEAVE_PAGE;
}
-/*-- 08.07.99 14:00:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet)
{
String* pGroup = (String*)aAutoTextGroupLB.GetEntryData(
aAutoTextGroupLB.GetSelectEntryPos());
- DBG_ASSERT(pGroup, "no group selected?");
+ OSL_ENSURE(pGroup, "no group selected?");
+
if(pGroup)
aLabItem.sGlossaryGroup = *pGroup;
@@ -793,9 +705,7 @@ sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet)
rSet.Put(aLabItem);
return sal_True;
}
-/*-- 08.07.99 14:00:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName)
{
SvLBoxEntry* pEntry = rAutoTextLB.First();
@@ -810,7 +720,7 @@ void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName)
pEntry = rAutoTextLB.Next(pEntry);
}
}
-//-----------------------------------------------------------------------------
+
sal_Bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName)
{
SvLBoxEntry* pEntry = rAutoTextLB.First();
@@ -826,7 +736,6 @@ sal_Bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName)
return sal_False;
}
-//-----------------------------------------------------------------------------
void SwVisitingCardPage::Reset(const SfxItemSet& rSet)
{
aLabItem = (const SwLabItem&) rSet.Get(FN_LABEL);
@@ -872,9 +781,6 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet)
}
}
-/* -----------------29.09.99 08:55-------------------
-
- --------------------------------------------------*/
SwPrivateDataPage::SwPrivateDataPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_PRIVATE_DATA), rSet),
aDataFL (this, SW_RES( FL_DATA )),
@@ -913,38 +819,27 @@ SwPrivateDataPage::SwPrivateDataPage(Window* pParent, const SfxItemSet& rSet) :
SetExchangeSupport();
}
-/*-- 29.09.99 08:55:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwPrivateDataPage::~SwPrivateDataPage()
{
}
-/*-- 29.09.99 08:55:57---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwPrivateDataPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwPrivateDataPage(pParent, rSet);
}
-/*-- 29.09.99 08:55:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet)
{
Reset(rSet);
}
-/*-- 29.09.99 08:55:58---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwPrivateDataPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
FillItemSet(*_pSet);
return LEAVE_PAGE;
}
-/*-- 29.09.99 08:55:58---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwPrivateDataPage::FillItemSet(SfxItemSet& rSet)
{
@@ -971,9 +866,7 @@ sal_Bool SwPrivateDataPage::FillItemSet(SfxItemSet& rSet)
rSet.Put(aItem);
return sal_True;
}
-/*-- 29.09.99 08:55:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwPrivateDataPage::Reset(const SfxItemSet& rSet)
{
const SwLabItem& aItem = (const SwLabItem&) rSet.Get(FN_LABEL);
@@ -996,9 +889,7 @@ void SwPrivateDataPage::Reset(const SfxItemSet& rSet)
aHomePageED .SetText(aItem.aPrivWWW);
aMailED .SetText(aItem.aPrivMail);
}
-/* -----------------29.09.99 08:56-------------------
- --------------------------------------------------*/
SwBusinessDataPage::SwBusinessDataPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_BUSINESS_DATA), rSet),
aDataFL (this, SW_RES( FL_DATA )),
@@ -1031,38 +922,28 @@ SwBusinessDataPage::SwBusinessDataPage(Window* pParent, const SfxItemSet& rSet)
SetExchangeSupport();
}
-/*-- 29.09.99 08:56:06---------------------------------------------------
- -----------------------------------------------------------------------*/
SwBusinessDataPage::~SwBusinessDataPage()
{
}
-/*-- 29.09.99 08:56:06---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwBusinessDataPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwBusinessDataPage(pParent, rSet);
}
-/*-- 29.09.99 08:56:06---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet)
{
Reset(rSet);
}
-/*-- 29.09.99 08:56:06---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwBusinessDataPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
FillItemSet(*_pSet);
return LEAVE_PAGE;
}
-/*-- 29.09.99 08:56:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwBusinessDataPage::FillItemSet(SfxItemSet& rSet)
{
SwLabItem aItem = (const SwLabItem&) GetTabDialog()->GetExampleSet()->Get(FN_LABEL);
@@ -1085,9 +966,7 @@ sal_Bool SwBusinessDataPage::FillItemSet(SfxItemSet& rSet)
rSet.Put(aItem);
return sal_True;
}
-/*-- 29.09.99 08:56:07---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwBusinessDataPage::Reset(const SfxItemSet& rSet)
{
const SwLabItem& aItem = (const SwLabItem&) rSet.Get(FN_LABEL);
@@ -1109,3 +988,4 @@ void SwBusinessDataPage::Reset(const SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx
index d9981dced2e9..4eb09d6008a5 100644
--- a/sw/source/ui/envelp/labelcfg.cxx
+++ b/sw/source/ui/envelp/labelcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,27 +38,21 @@
#include <unomid.h>
using namespace utl;
-using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-/* -----------------------------15.01.01 11:17--------------------------------
+using ::rtl::OUString;
- ---------------------------------------------------------------------------*/
SwLabelConfig::SwLabelConfig() :
ConfigItem(C2U("Office.Labels/Manufacturer"))
{
aNodeNames = GetNodeNames(OUString());
}
-/* -----------------------------06.09.00 16:50--------------------------------
- ---------------------------------------------------------------------------*/
SwLabelConfig::~SwLabelConfig()
{
}
-/* -----------------------------06.09.00 16:43--------------------------------
- ---------------------------------------------------------------------------*/
void SwLabelConfig::Commit()
{
// the config item is not writable yet
@@ -65,9 +60,6 @@ void SwLabelConfig::Commit()
void SwLabelConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
-/* -----------------------------15.01.01 11:42--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<OUString> lcl_CreatePropertyNames(const OUString& rPrefix)
{
Sequence<OUString> aProperties(2);
@@ -79,7 +71,7 @@ Sequence<OUString> lcl_CreatePropertyNames(const OUString& rPrefix)
pProperties[ 1] += C2U("Measure");
return aProperties;
}
-//-----------------------------------------------------------------------------
+
SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufacturer)
{
SwLabRec* pNewRec = new SwLabRec;
@@ -95,8 +87,8 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur
case 0: pValues[nProp] >>= sTmp; pNewRec->aType = sTmp; break;
case 1:
{
-//all values are contained as colon-separated 1/100 mm values except for the
-//continuous flag ('C'/'S')
+ //all values are contained as colon-separated 1/100 mm values
+ //except for the continuous flag ('C'/'S')
pValues[nProp] >>= sTmp;
String sMeasure(sTmp);
sal_uInt16 nTokenCount = sMeasure.GetTokenCount(';');
@@ -124,7 +116,7 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur
}
return pNewRec;
}
-//-----------------------------------------------------------------------------
+
Sequence<PropertyValue> lcl_CreateProperties(
Sequence<OUString>& rPropNames, const SwLabRec& rRec)
{
@@ -158,7 +150,7 @@ Sequence<PropertyValue> lcl_CreateProperties(
}
return aRet;
}
-//-----------------------------------------------------------------------------
+
void SwLabelConfig::FillLabels(const OUString& rManufacturer, SwLabRecs& rLabArr)
{
OUString sManufacturer(wrapConfigurationElementName(rManufacturer));
@@ -176,9 +168,7 @@ void SwLabelConfig::FillLabels(const OUString& rManufacturer, SwLabRecs& rLab
rLabArr.C40_INSERT( SwLabRec, pNewRec, rLabArr.Count() );
}
}
-/* -----------------------------23.01.01 11:36--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwLabelConfig::HasLabel(const rtl::OUString& rManufacturer, const rtl::OUString& rType)
{
const OUString* pNode = aNodeNames.getConstArray();
@@ -215,9 +205,7 @@ sal_Bool SwLabelConfig::HasLabel(const rtl::OUString& rManufacturer, const rt
}
return sal_False;
}
-/* -----------------------------23.01.01 11:36--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool lcl_Exists(const OUString& rNode, const Sequence<OUString>& rLabels)
{
const OUString* pLabels = rLabels.getConstArray();
@@ -226,7 +214,7 @@ sal_Bool lcl_Exists(const OUString& rNode, const Sequence<OUString>& rLabels)
return sal_True;
return sal_False;
}
-//-----------------------------------------------------------------------------
+
void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer,
const rtl::OUString& rType, const SwLabRec& rRec)
{
@@ -241,7 +229,7 @@ void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer,
{
if(!AddNode(OUString(), rManufacturer))
{
- DBG_ERROR("New configuration node could not be created");
+ OSL_FAIL("New configuration node could not be created");
return ;
}
else
@@ -300,3 +288,4 @@ void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx
index 7af41110fff8..5e8bef108bb9 100644
--- a/sw/source/ui/envelp/labelexp.cxx
+++ b/sw/source/ui/envelp/labelexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,9 +57,6 @@ using ::rtl::OUString;
#endif
#define SW_PROP_NAME_STR(nId) SwGetPropName((nId)).pName
-/* -----------------08.07.99 15:15-------------------
-
- --------------------------------------------------*/
void SwVisitingCardPage::InitFrameControl()
{
Link aLink(LINK(this, SwVisitingCardPage, FrameControlInitializedHdl));
@@ -75,7 +73,7 @@ void SwVisitingCardPage::InitFrameControl()
uno::Sequence<OUString> aNames = _xAutoText->getElementNames();
const OUString* pGroups = aNames.getConstArray();
- OUString uTitleName( C2U(SW_PROP_NAME_STR(UNO_NAME_TITLE)) );
+ OUString uTitleName( rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_TITLE)) );
for(sal_uInt16 i = 0; i < aNames.getLength(); i++)
{
@@ -126,9 +124,7 @@ void SwVisitingCardPage::InitFrameControl()
}
}
}
-/* -----------------01.10.99 13:19-------------------
- --------------------------------------------------*/
IMPL_LINK( SwVisitingCardPage, FrameControlInitializedHdl, void*, EMPTYARG )
{
SvLBoxEntry* pSel = aAutoTextLB.FirstSelected();
@@ -161,9 +157,7 @@ IMPL_LINK( SwVisitingCardPage, FrameControlInitializedHdl, void*, EMPTYARG )
}
return 0;
}
-/* -----------------22.07.99 11:06-------------------
- --------------------------------------------------*/
IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox )
{
if(_xAutoText.is())
@@ -190,9 +184,6 @@ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox )
return 0;
}
-/* -----------------01.10.99 11:59-------------------
-
- --------------------------------------------------*/
void SwVisitingCardPage::UpdateFields()
{
uno::Reference< frame::XModel > xModel;
@@ -201,9 +192,7 @@ void SwVisitingCardPage::UpdateFields()
SwLabDlg::UpdateFieldInformation(xModel, aLabItem);
}
}
-/* -----------------01.10.99 15:16-------------------
- --------------------------------------------------*/
void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel, const SwLabItem& rItem)
{
uno::Reference< text::XTextFieldsSupplier > xFlds(xModel, uno::UNO_QUERY);
@@ -252,7 +241,7 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel,
{
String sFldName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.FieldMaster.User." )));
- OUString uCntName( C2U( SW_PROP_NAME_STR(UNO_NAME_CONTENT )));
+ OUString uCntName( rtl::OUString::createFromAscii( SW_PROP_NAME_STR(UNO_NAME_CONTENT )));
for( const _SwLabItemMap* p = aArr; p->pName; ++p )
{
String sCurFldName( sFldName );
@@ -279,3 +268,4 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel,
xRefresh->refresh();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index a4ed05353058..4567ae74c747 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,15 +49,13 @@
#include <unomid.h>
using namespace utl;
-using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-// #define ------------------------------------------------------------------
+using ::rtl::OUString;
#define ROUND(x) ((sal_uInt16) ((x) + .5))
-// --------------------------------------------------------------------------
SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) :
Window((Window*) pParent, rResID),
@@ -99,18 +98,17 @@ SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) :
lXHeight = GetTextHeight();
lXWidth = GetTextWidth('X');
- // Skalierungsfaktor
+ // Scale factor
float fx = (float)(lOutWPix - (2 * (lLeftWidth + 15))) / (float)lOutWPix;
lOutWPix23 = (long)((float)lOutWPix * fx);
lOutHPix23 = (long)((float)lOutHPix * fx);
}
-// --------------------------------------------------------------------------
SwLabPreview::~SwLabPreview()
{
}
-// --------------------------------------------------------------------------
+
void SwLabPreview::Paint(const Rectangle &)
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -130,7 +128,7 @@ void SwLabPreview::Paint(const Rectangle &)
aPaintFont.SetTransparent(sal_False);
SetFont(aPaintFont);
- // Groesse des darzustellenden Bereichs
+ // size of region to be displayed
long lDispW = ROUND(aItem.lLeft + aItem.lHDist);
long lDispH = ROUND(aItem.lUpper + aItem.lVDist);
if (aItem.nCols == 1)
@@ -142,12 +140,12 @@ void SwLabPreview::Paint(const Rectangle &)
else
lDispH += ROUND(aItem.lVDist / 10);
- // Skalierungsfaktor
+ // Scale factor
float fx = (float) lOutWPix23 / Max(1L, lDispW),
fy = (float) lOutHPix23 / Max(1L, lDispH),
f = fx < fy ? fx : fy;
- // Nullpunkt
+ // zero point
long lOutlineW = ROUND(f * lDispW);
long lOutlineH = ROUND(f * lDispH);
@@ -160,19 +158,19 @@ void SwLabPreview::Paint(const Rectangle &)
long lX3 = ROUND(lX0 + f * (aItem.lLeft + aItem.lHDist ));
long lY3 = ROUND(lY0 + f * (aItem.lUpper + aItem.lVDist ));
- // Umriss zeichnen (Flaeche)
+ // draw outline (area)
DrawRect(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH)));
- // Umriss zeichnen (Umrandung)
+ // draw outline (border)
SetLineColor(rFieldTextColor);
- DrawLine(Point(lX0, lY0), Point(lX0 + lOutlineW - 1, lY0)); // Oben
- DrawLine(Point(lX0, lY0), Point(lX0, lY0 + lOutlineH - 1)); // Links
+ DrawLine(Point(lX0, lY0), Point(lX0 + lOutlineW - 1, lY0)); // Up
+ DrawLine(Point(lX0, lY0), Point(lX0, lY0 + lOutlineH - 1)); // Left
if (aItem.nCols == 1)
- DrawLine(Point(lX0 + lOutlineW - 1, lY0), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Rechts
+ DrawLine(Point(lX0 + lOutlineW - 1, lY0), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Right
if (aItem.nRows == 1)
- DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Unten
+ DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Down
- // Etiketten
+ // Labels
SetClipRegion (Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH)));
SetFillColor(rWinColor);
for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++)
@@ -184,7 +182,7 @@ void SwLabPreview::Paint(const Rectangle &)
ROUND(f * aItem.lHeight))));
SetClipRegion();
- // Beschritung: Rand links
+ // annotation: left border
if (aItem.lLeft)
{
long lX = (lX0 + lX1) / 2;
@@ -193,14 +191,14 @@ void SwLabPreview::Paint(const Rectangle &)
DrawText(Point(lX1 - lLeftWidth, lY0 - 10 - lXHeight), aLeftStr);
}
- // Beschriftung: Rand oben
+ // annotation: upper border
if (aItem.lUpper)
{
DrawArrow(Point(lX0 - 5, lY0), Point(lX0 - 5, lY1), sal_False);
DrawText(Point(lX0 - 10 - lUpperWidth, ROUND(lY0 + f * aItem.lUpper / 2 - lXHeight / 2)), aUpperStr);
}
- // Beschriftung: Breite und Hoehe
+ // annotation: width and height
{
long lX = lX2 - lXWidth / 2 - lHeightWidth / 2;
long lY = lY1 + lXHeight;
@@ -212,7 +210,7 @@ void SwLabPreview::Paint(const Rectangle &)
DrawText(Point(lX - lHeightWidth / 2, lY2 - lXHeight - lXHeight / 2), aHeightStr);
}
- // Beschriftung: Horz. Abstand
+ // annotation: horizontal gap
if (aItem.nCols > 1)
{
long lX = (lX1 + lX3) / 2;
@@ -221,21 +219,21 @@ void SwLabPreview::Paint(const Rectangle &)
DrawText(Point(lX - lHDistWidth / 2, lY0 - 10 - lXHeight), aHDistStr);
}
- // Beschriftung: Vertikaler Abstand
+ // annotation: vertical gap
if (aItem.nRows > 1)
{
DrawArrow(Point(lX0 - 5, lY1), Point(lX0 - 5, lY3), sal_False);
DrawText(Point(lX0 - 10 - lVDistWidth, ROUND(lY1 + f * aItem.lVDist / 2 - lXHeight / 2)), aVDistStr);
}
- // Beschriftung: Spalten
+ // annotation: columns
{
long lY = lY0 + lOutlineH + 4;
DrawArrow(Point(lX0, lY), Point(lX0 + lOutlineW - 1, lY), sal_True);
DrawText(Point((lX0 + lX0 + lOutlineW - 1) / 2 - lColsWidth / 2, lY + 5), aColsStr);
}
- // Beschriftung: Zeilen
+ // annotation: lines
{
long lX = lX0 + lOutlineW + 4;
DrawArrow(Point(lX, lY0), Point(lX, lY0 + lOutlineH - 1), sal_True);
@@ -243,9 +241,7 @@ void SwLabPreview::Paint(const Rectangle &)
}
}
-// Pfeil bzw. Intervall zeichnen --------------------------------------------
-
-
+// Arror or interval character --------------------------------------------
void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow)
{
@@ -255,10 +251,10 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow
{
Point aArr[3];
- // Pfeil zeichnen
+ // Arrow character
if (rP1.Y() == rP2.Y())
{
- // Waagerecht
+ // Horizontal
aArr[0].X() = rP2.X() - 5;
aArr[0].Y() = rP2.Y() - 2;
aArr[1].X() = rP2.X();
@@ -268,7 +264,7 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow
}
else
{
- // Senkrecht
+ // Vertical
aArr[0].X() = rP2.X() - 2;
aArr[0].Y() = rP2.Y() - 5;
aArr[1].X() = rP2.X() + 2;
@@ -283,34 +279,28 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow
}
else
{
- // Intervall zeichnen
+ // Interval symbol
if (rP1.Y() == rP2.Y())
{
- // Waagerecht
+ // Horizontal
DrawLine(Point(rP1.X(), rP1.Y() - 2), Point(rP1.X(), rP1.Y() + 2));
DrawLine(Point(rP2.X(), rP2.Y() - 2), Point(rP2.X(), rP2.Y() + 2));
}
else
{
- // Senkrecht
+ // Vertical
DrawLine(Point(rP1.X() - 2, rP1.Y()), Point(rP1.X() + 2, rP1.Y()));
DrawLine(Point(rP2.X() - 2, rP2.Y()), Point(rP2.X() + 2, rP2.Y()));
}
}
}
-// --------------------------------------------------------------------------
-
void SwLabPreview::Update(const SwLabItem& rItem)
{
aItem = rItem;
Invalidate();
}
-// --------------------------------------------------------------------------
-
-
-
SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_LAB_FMT), rSet),
@@ -340,7 +330,7 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
FreeResource();
SetExchangeSupport();
- // Metriken
+ // Metrics
FieldUnit aMetric = ::GetDfltMetric(sal_False);
SetMetric(aHDistField , aMetric);
SetMetric(aVDistField , aMetric);
@@ -349,7 +339,7 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
SetMetric(aLeftField , aMetric);
SetMetric(aUpperField , aMetric);
- // Handler installieren
+ // Install handlers
Link aLk = LINK(this, SwLabFmtPage, ModifyHdl);
aHDistField .SetModifyHdl( aLk );
aVDistField .SetModifyHdl( aLk );
@@ -371,23 +361,16 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
aRowsField .SetLoseFocusHdl( aLk );
aSavePB.SetClickHdl( LINK (this, SwLabFmtPage, SaveHdl));
- // Timer einstellen
+ // Set timer
aPreviewTimer.SetTimeout(1000);
aPreviewTimer.SetTimeoutHdl(LINK(this, SwLabFmtPage, PreviewHdl));
}
-// --------------------------------------------------------------------------
-
-
-
SwLabFmtPage::~SwLabFmtPage()
{
}
-// Modify-Handler der MetricFields. Preview-Timer starten -------------------
-
-
-
+// Modify-handler of MetricFields. start preview timer
IMPL_LINK_INLINE_START( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG )
{
bModified = sal_True;
@@ -396,10 +379,7 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG )
-// Preview invalidaten ------------------------------------------------------
-
-
-
+// Invalidate preview
IMPL_LINK_INLINE_START( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG )
{
aPreviewTimer.Stop();
@@ -411,10 +391,7 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG )
-// LoseFocus-Handler: Bei Aenderung sofort updaten --------------------------
-
-
-
+// LoseFocus-Handler: Update on change --------------------------
IMPL_LINK_INLINE_START( SwLabFmtPage, LoseFocusHdl, Control *, pControl )
{
if (((Edit*) pControl)->IsModified())
@@ -423,14 +400,11 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, LoseFocusHdl, Control *, pControl )
}
IMPL_LINK_INLINE_END( SwLabFmtPage, LoseFocusHdl, Control *, pControl )
-// Minima und Maxima fuer Fields festlegen ----------------------------------
-
-
void SwLabFmtPage::ChangeMinMax()
{
long lMax = 31748; // 56 cm
- // Min und Max
+ // Min and Max
long lLeft = static_cast< long >(GETFLDVAL(aLeftField )),
lUpper = static_cast< long >(GETFLDVAL(aUpperField)),
@@ -457,7 +431,7 @@ void SwLabFmtPage::ChangeMinMax()
aColsField .SetMax((lMax - lLeft ) / Max(1L, lHDist));
aRowsField .SetMax((lMax - lUpper) / Max(1L, lVDist));
- // First und Last
+ // First and Last
aHDistField .SetFirst(aHDistField .GetMin());
aVDistField .SetFirst(aVDistField .GetMin());
@@ -487,29 +461,17 @@ void SwLabFmtPage::ChangeMinMax()
aRowsField .Reformat();
}
-// --------------------------------------------------------------------------
-
-
-
SfxTabPage* SwLabFmtPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwLabFmtPage(pParent, rSet);
}
-// ----------------------------------------------------------------------------
-
-
-
void SwLabFmtPage::ActivatePage(const SfxItemSet& rSet)
{
SfxItemSet aSet(rSet);
Reset(aSet);
}
-// ----------------------------------------------------------------------------
-
-
-
int SwLabFmtPage::DeactivatePage(SfxItemSet* _pSet)
{
if (_pSet)
@@ -518,10 +480,6 @@ int SwLabFmtPage::DeactivatePage(SfxItemSet* _pSet)
return sal_True;
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabFmtPage::FillItem(SwLabItem& rItem)
{
if (bModified)
@@ -540,10 +498,6 @@ void SwLabFmtPage::FillItem(SwLabItem& rItem)
}
}
-// --------------------------------------------------------------------------
-
-
-
sal_Bool SwLabFmtPage::FillItemSet(SfxItemSet& rSet)
{
FillItem(aItem);
@@ -552,10 +506,9 @@ sal_Bool SwLabFmtPage::FillItemSet(SfxItemSet& rSet)
return sal_True;
}
-// --------------------------------------------------------------------------
void SwLabFmtPage::Reset(const SfxItemSet& )
{
- // Fields initialisieren
+ // Initialise fields
GetParent()->GetLabItem(aItem);
aHDistField .SetMax(100 * aItem.lHDist , FUNIT_TWIP);
@@ -581,9 +534,6 @@ void SwLabFmtPage::Reset(const SfxItemSet& )
aTypeFI.SetText(aItem.aType);
PreviewHdl(0);
}
-/* -----------------------------22.01.01 15:11--------------------------------
-
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwLabFmtPage, SaveHdl, PushButton *, EMPTYARG )
{
@@ -620,9 +570,7 @@ IMPL_LINK( SwLabFmtPage, SaveHdl, PushButton *, EMPTYARG )
delete pSaveDlg;
return 0;
}
-/* -----------------------------23.01.01 10:41--------------------------------
- ---------------------------------------------------------------------------*/
SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) :
ModalDialog(pParent, SW_RES(DLG_SAVE_LABEL)),
aOptionsFL(this,SW_RES(FL_OPTIONS )),
@@ -654,9 +602,7 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) :
for(sal_Int32 i = 0; i < rMan.getLength(); i++)
aMakeCB.InsertEntry(pMan[i]);
}
-/* -----------------------------23.01.01 10:40--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwSaveLabelDlg, OkHdl, OKButton*, EMPTYARG)
{
SwLabelConfig& rCfg = pLabPage->GetParent()->GetLabelsConfig();
@@ -681,17 +627,13 @@ IMPL_LINK(SwSaveLabelDlg, OkHdl, OKButton*, EMPTYARG)
EndDialog(RET_OK);
return 0;
}
-/* -----------------------------23.01.01 11:22--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwSaveLabelDlg, ModifyHdl, Edit*, EMPTYARG)
{
aOKPB.Enable(aMakeCB.GetText().Len() && aTypeED.GetText().Len());
return 0;
}
-/* -----------------------------23.01.01 16:06--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem)
{
if(bSuccess)
@@ -710,3 +652,4 @@ sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem)
return bSuccess;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labfmt.hrc b/sw/source/ui/envelp/labfmt.hrc
index ae6786dce3a9..6033e7e96f7e 100644
--- a/sw/source/ui/envelp/labfmt.hrc
+++ b/sw/source/ui/envelp/labfmt.hrc
@@ -28,11 +28,9 @@
#ifndef _LABFMT_HRC
#define _LABFMT_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define WIN_PREVIEW 1
#define TXT_HDIST 2
@@ -66,7 +64,7 @@
#define PB_HELP 8
#define MB_QUERY 9
-// Globale Resourcen ********************************************************
+// global resources ********************************************************
#define STR_HDIST (RC_LABFMT_BEGIN + 1)
#define STR_VDIST (RC_LABFMT_BEGIN + 2)
@@ -77,7 +75,7 @@
#define STR_COLS (RC_LABFMT_BEGIN + 7)
#define STR_ROWS (RC_LABFMT_BEGIN + 8)
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
#define LABFMT_ACT_END STR_ROWS
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 5b503c5da054..6019081157d1 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,9 +138,7 @@ public:
SwLabDlg* GetParent() {return (SwLabDlg*) SfxTabPage::GetParent()->GetParent();}
};
-/* -----------------------------23.01.01 10:26--------------------------------
- ---------------------------------------------------------------------------*/
class SwSaveLabelDlg : public ModalDialog
{
FixedLine aOptionsFL;
@@ -173,3 +172,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src
index 58605e3db43d..1d0c7b7cb557 100644
--- a/sw/source/ui/envelp/labfmt.src
+++ b/sw/source/ui/envelp/labfmt.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "labfmt.hrc"
#include "helpid.h"
// TP_LAB_FMT ---------------------------------------------------------------
diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx
index 88f78f950b3c..48715c375ece 100644
--- a/sw/source/ui/envelp/labimg.cxx
+++ b/sw/source/ui/envelp/labimg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <tools/stream.hxx>
-#ifndef _RESID_HXX //autogen
#include <tools/resid.hxx>
-#endif
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <unotools/useroptions.hxx>
@@ -44,11 +43,10 @@
#include <unomid.h>
using namespace utl;
-using namespace rtl;
using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
-// ----------------------------------------------------------------------------
SwLabItem::SwLabItem() :
SfxPoolItem(FN_LABEL),
@@ -67,13 +65,12 @@ SwLabItem::SwLabItem() :
lHeight = 5669; // 10 cm
}
-// ----------------------------------------------------------------------------
SwLabItem::SwLabItem(const SwLabItem& rItem) :
SfxPoolItem(FN_LABEL)
{
*this = rItem;
}
-// ----------------------------------------------------------------------------
+
SwLabItem& SwLabItem::operator =(const SwLabItem& rItem)
{
bAddr = rItem.bAddr;
@@ -134,10 +131,6 @@ SwLabItem& SwLabItem::operator =(const SwLabItem& rItem)
return *this;
}
-// --------------------------------------------------------------------------
-
-
-
int SwLabItem::operator ==(const SfxPoolItem& rItem) const
{
const SwLabItem& rLab = (const SwLabItem&) rItem;
@@ -163,7 +156,7 @@ int SwLabItem::operator ==(const SfxPoolItem& rItem) const
aLstMake == rLab.aLstMake&&
aLstType == rLab.aLstType&&
sDBName == rLab.sDBName &&
- aPrivFirstName == rLab.aPrivFirstName&&
+ aPrivFirstName == rLab.aPrivFirstName&&
aPrivName == rLab.aPrivName&&
aPrivShortCut == rLab.aPrivShortCut&&
aPrivFirstName2 == rLab.aPrivFirstName2&&
@@ -199,15 +192,11 @@ int SwLabItem::operator ==(const SfxPoolItem& rItem) const
sGlossaryBlockName == rLab.sGlossaryBlockName;
}
-// --------------------------------------------------------------------------
SfxPoolItem* SwLabItem::Clone(SfxItemPool*) const
{
return new SwLabItem(*this);
}
-/* -----------------------------25.09.00 16:25--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames()
{
static const char* aLabelPropNames[] =
@@ -279,9 +268,7 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames()
pNames[nIndex++] = OUString::createFromAscii(aBusinessPropNames[nBusiness]);
return aNames;
}
-/* ----------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
ConfigItem(bLabel ? C2U("Office.Writer/Label") : C2U("Office.Writer/BusinessCard")),
bIsLabel(bLabel)
@@ -290,7 +277,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
Sequence<Any> aValues = GetProperties(aNames);
EnableNotification(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
sal_Bool bNoConfigValues = sal_True;
if(aValues.getLength() == aNames.getLength())
{
@@ -404,9 +391,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
SetModified();
}
}
-/* -----------------------------25.09.00 16:26--------------------------------
- ---------------------------------------------------------------------------*/
void SwLabCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
void SwLabCfgItem::Commit()
@@ -480,3 +465,4 @@ void SwLabCfgItem::Commit()
PutProperties(aNames, aValues);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx
index 5176394e8249..3fdab60bd00b 100644
--- a/sw/source/ui/envelp/labimp.hxx
+++ b/sw/source/ui/envelp/labimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,10 +110,9 @@ public:
sal_Bool bCont;
};
-/* --------------------------------------------------
- --------------------------------------------------*/
SV_DECL_PTRARR_DEL( SwLabRecs, SwLabRec*, 110, 10 )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 4341bc9c5b75..afabaf3cf234 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,21 +41,10 @@
#include <label.hxx>
#include <labprt.hxx>
#include <labimg.hxx>
-#ifndef _LABIMP_HXX
#include "swuilabimp.hxx"
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _LABPRT_HRC
#include <labprt.hrc>
-#endif
-
-
-// --------------------------------------------------------------------------
-
-
SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
@@ -77,7 +67,7 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
FreeResource();
SetExchangeSupport();
- // Handler installieren
+ // Install handlers
Link aLk = LINK(this, SwLabPrtPage, CountHdl);
aPageButton .SetClickHdl( aLk );
aSingleButton.SetClickHdl( aLk );
@@ -95,25 +85,17 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
}
}
-// --------------------------------------------------------------------------
-
-
-
SwLabPrtPage::~SwLabPrtPage()
{
if (pPrinter)
delete pPrinter;
}
-// --------------------------------------------------------------------------
-
-
-
IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
{
if (pButton == &aPrtSetup)
{
- // Druck-Setup aufrufen
+ // Call printer setup
if (!pPrinter)
pPrinter = new Printer;
@@ -134,35 +116,23 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
if ( bEnable )
aColField.GrabFocus();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( pButton == &aPageButton, "NewButton?" );
+ OSL_ENSURE( pButton == &aPageButton, "NewButton?" );
#endif
return 0;
}
-// --------------------------------------------------------------------------
-
-
-
SfxTabPage* SwLabPrtPage::Create(Window* pParent, const SfxItemSet& rSet)
{
return new SwLabPrtPage( pParent, rSet );
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet )
{
Reset(rSet);
}
-// --------------------------------------------------------------------------
-
-
-
int SwLabPrtPage::DeactivatePage(SfxItemSet* _pSet)
{
if ( _pSet )
@@ -171,10 +141,6 @@ int SwLabPrtPage::DeactivatePage(SfxItemSet* _pSet)
return sal_True;
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabPrtPage::FillItem(SwLabItem& rItem)
{
rItem.bPage = aPageButton.IsChecked();
@@ -183,10 +149,6 @@ void SwLabPrtPage::FillItem(SwLabItem& rItem)
rItem.bSynchron = aSynchronCB.IsChecked() && aSynchronCB.IsEnabled();
}
-// --------------------------------------------------------------------------
-
-
-
sal_Bool SwLabPrtPage::FillItemSet(SfxItemSet& rSet)
{
SwLabItem aItem;
@@ -197,10 +159,6 @@ sal_Bool SwLabPrtPage::FillItemSet(SfxItemSet& rSet)
return sal_True;
}
-// --------------------------------------------------------------------------
-
-
-
void SwLabPrtPage::Reset(const SfxItemSet& )
{
SwLabItem aItem;
@@ -222,7 +180,7 @@ void SwLabPrtPage::Reset(const SfxItemSet& )
if (pPrinter)
{
- // Drucker anzeigen
+ // show printer
aPrinterInfo.SetText(pPrinter->GetName());
}
else
@@ -240,3 +198,4 @@ void SwLabPrtPage::Reset(const SfxItemSet& )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labprt.hrc b/sw/source/ui/envelp/labprt.hrc
index 07453cb01e89..7b930e4c182c 100644
--- a/sw/source/ui/envelp/labprt.hrc
+++ b/sw/source/ui/envelp/labprt.hrc
@@ -28,11 +28,9 @@
#ifndef _LABPRT_HRC
#define _LABPRT_HRC
-// #include *****************************************************************
-
#include "envelp.hrc"
-// Lokale Resourcen *********************************************************
+// local resources *********************************************************
#define BTN_PAGE 1
#define BTN_SINGLE 2
@@ -46,7 +44,7 @@
#define FL_DONTKNOW 10
#define CB_SYNCHRON 11
-// Ueberlaufpruefung ********************************************************
+// overflow check ********************************************************
#define LABPRT_ACT_END 0
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index 44fa4f4e9f3e..23f163d0a4b3 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <vcl/group.hxx>
#include <vcl/field.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <sfx2/tabdlg.hxx>
@@ -43,7 +42,7 @@ class SwLabItem;
class SwLabPrtPage : public SfxTabPage
{
- Printer* pPrinter; //Fuer die Schachteinstellug - leider.
+ Printer* pPrinter; // for the shaft setting - unfortunately
FixedLine aFLDontKnow;
RadioButton aPageButton;
@@ -84,3 +83,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/labprt.src b/sw/source/ui/envelp/labprt.src
index 2a8b4e537bd0..35dac125468f 100644
--- a/sw/source/ui/envelp/labprt.src
+++ b/sw/source/ui/envelp/labprt.src
@@ -26,7 +26,6 @@
************************************************************************/
// #pragma ******************************************************************
- // #include *****************************************************************
#include "labprt.hrc"
#include "helpid.h"
// TP_LAB_PRT ---------------------------------------------------------------
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 106e792229e6..90ee8072086e 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,7 +76,6 @@
#include <algorithm>
-using namespace rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
@@ -90,19 +90,18 @@ using namespace ::com::sun::star::form;
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::ui::dialogs;
+using ::rtl::OUString;
-/* -----------------------------05.06.01 13:54--------------------------------
-
- ---------------------------------------------------------------------------*/
struct SwMailMergeDlg_Impl
{
uno::Reference<runtime::XFormController> xFController;
uno::Reference<XSelectionChangeListener> xChgLstnr;
uno::Reference<XSelectionSupplier> xSelSupp;
};
-/* -----------------------------05.06.01 13:47--------------------------------
+
+/* --------------------------------------------------------------------------
helper classes
- ---------------------------------------------------------------------------*/
+----------------------------------------------------------------------------*/
class SwXSelChgLstnr_Impl : public cppu::WeakImplHelper1
<
view::XSelectionChangeListener
@@ -116,20 +115,14 @@ public:
virtual void SAL_CALL selectionChanged( const EventObject& aEvent ) throw (RuntimeException);
virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException);
};
-/* -----------------------------05.06.01 13:51--------------------------------
- ---------------------------------------------------------------------------*/
SwXSelChgLstnr_Impl::SwXSelChgLstnr_Impl(SwMailMergeDlg& rParentDlg) :
rParent(rParentDlg)
{}
-/* -----------------------------05.06.01 14:06--------------------------------
- ---------------------------------------------------------------------------*/
SwXSelChgLstnr_Impl::~SwXSelChgLstnr_Impl()
{}
-/* -----------------------------05.06.01 14:06--------------------------------
- ---------------------------------------------------------------------------*/
void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& ) throw (RuntimeException)
{
//call the parent to enable selection mode
@@ -147,16 +140,12 @@ void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& ) throw (Runtime
rParent.m_aSelection.realloc(0);
}
}
-/* -----------------------------05.06.01 14:06--------------------------------
- ---------------------------------------------------------------------------*/
void SwXSelChgLstnr_Impl::disposing( const EventObject& ) throw (RuntimeException)
{
- DBG_ERROR("disposing");
+ OSL_FAIL("disposing");
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
+
SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
const String& rSourceName,
const String& rTblName,
@@ -345,8 +334,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
pModOpt = SW_MOD()->GetModuleConfig();
- //aSingleJobsCB.Check(pModOpt->IsSinglePrintJob());// not supported in since cws printerpullpages anymore
-
sal_Int16 nMailingMode(pModOpt->GetMailingFormats());
aFormatSwCB.Check((nMailingMode & TXTFORMAT_OFFICE) != 0);
aFormatHtmlCB.Check((nMailingMode & TXTFORMAT_HTML) != 0);
@@ -354,7 +341,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
aAllRB.Check(sal_True);
- // Handler installieren
+ // Install handlers
Link aLk = LINK(this, SwMailMergeDlg, ButtonHdl);
aOkBTN.SetClickHdl(aLk);
@@ -445,9 +432,9 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
sCommand += String::CreateFromInt32(SFX_FILTER_NOTINFILEDLG);
sCommand += C2U(":default_first");
uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
- const ::rtl::OUString sName = OUString::createFromAscii("Name");
- const ::rtl::OUString sFlags = OUString::createFromAscii("Flags");
- const ::rtl::OUString sUIName = OUString::createFromAscii("UIName");
+ const ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
+ const ::rtl::OUString sFlags(RTL_CONSTASCII_USTRINGPARAM("Flags"));
+ const ::rtl::OUString sUIName(RTL_CONSTASCII_USTRINGPARAM("UIName"));
sal_uInt16 nODT = USHRT_MAX;
while(xList->hasMoreElements())
{
@@ -482,10 +469,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwMailMergeDlg::~SwMailMergeDlg()
{
if(xFrame.is())
@@ -504,34 +487,31 @@ SwMailMergeDlg::~SwMailMergeDlg()
delete pImpl;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwMailMergeDlg::Apply()
{
}
-/*-- 01.06.2007 13:06:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_MoveControlY( Window* ppW, long nDiffSize )
{
Point aPos( ppW->GetPosPixel());
aPos.Y() += nDiffSize;
ppW->SetPosPixel( aPos );
}
+
void lcl_MoveControlX( Window* ppW, long nDiffSize )
{
Point aPos( ppW->GetPosPixel());
aPos.X() += nDiffSize;
ppW->SetPosPixel( aPos );
}
+
void lcl_ChangeWidth( Window* ppW, long nDiffSize )
{
Size aSize( ppW->GetSizePixel());
aSize.Width() += nDiffSize;
ppW->SetSizePixel( aSize );
}
+
void SwMailMergeDlg::Resize()
{
//the only controls that profit from the resize is pBeamerWin
@@ -609,10 +589,6 @@ void SwMailMergeDlg::Resize()
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn )
{
if (pBtn == &aOkBTN)
@@ -623,10 +599,6 @@ IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, RadioButton *, pBtn )
{
sal_Bool bPrint = pBtn == &aPrinterRB;
@@ -654,9 +626,7 @@ IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, RadioButton *, pBtn )
return 0;
}
-/*-- 01.06.2007 12:36:43---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, RadioButton*, pBtn )
{
bool bIndividual = pBtn == &aSaveIndividualRB;
@@ -678,9 +648,6 @@ IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, RadioButton*, pBtn )
}
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
IMPL_LINK( SwMailMergeDlg, FilenameHdl, CheckBox*, pBox )
{
@@ -695,20 +662,12 @@ IMPL_LINK( SwMailMergeDlg, FilenameHdl, CheckBox*, pBox )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeDlg, ModifyHdl, NumericField *, EMPTYARG )
{
aFromRB.Check();
return (0);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
bool SwMailMergeDlg::ExecQryShell()
{
if(pImpl->xSelSupp.is())
@@ -768,7 +727,7 @@ bool SwMailMergeDlg::ExecQryShell()
pMgr->SetSubject(sPath);
}
- if (aFromRB.IsChecked()) // Liste Einfuegen
+ if (aFromRB.IsChecked()) // Insert list
{
// Safe: the maximal value of the fields is limited
sal_Int32 nStart = sal::static_int_cast<sal_Int32>(aFromNF.GetValue());
@@ -783,7 +742,7 @@ bool SwMailMergeDlg::ExecQryShell()
*pSelection <<= i;
}
else if (aAllRB.IsChecked() )
- m_aSelection.realloc(0); // Leere Selektion = Alles einfuegen
+ m_aSelection.realloc(0); // Empty selection = insert all
else
{
if(pImpl->xSelSupp.is())
@@ -823,10 +782,6 @@ bool SwMailMergeDlg::ExecQryShell()
return true;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG )
{
String sPath( aPathED.GetText() );
@@ -845,7 +800,6 @@ IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG )
C2U( "com.sun.star.ui.dialogs.FolderPicker" ) ),
UNO_QUERY );
}
-// pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE1);
xFP->setDisplayDirectory(sPath);
if( xFP->execute() == RET_OK )
{
@@ -858,17 +812,13 @@ IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, EMPTYARG )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
AbstractSvxMultiFileDialog* pFileDlg = pFact->CreateSvxMultiFileDialog( this );
- DBG_ASSERT(pFileDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pFileDlg, "Dialogdiet fail!");
pFileDlg->SetFiles(aAttachED.GetText());
pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE2);
@@ -879,9 +829,7 @@ IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, EMPTYARG )
}
return 0;
}
-/* -----------------------------05.06.01 14:56--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
{
uno::Reference< XResultSet > xResSetClone;
@@ -894,9 +842,7 @@ uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
}
return xResSetClone;
}
-/*-- 27.11.2002 12:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) :
ModalDialog(pParent, SW_RES(DLG_MERGE_CREATE)),
aCreateFromFL( this, SW_RES( FL_CREATEFROM )),
@@ -908,15 +854,11 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) :
{
FreeResource();
}
-/*-- 27.11.2002 12:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg()
{
}
-/* -----------------04.02.2003 13:45-----------------
- *
- * --------------------------------------------------*/
+
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) :
ModalDialog(pParent, SW_RES(DLG_MERGE_FIELD_CONNECTIONS)),
aConnectionsFL( this, SW_RES( FL_CONNECTIONS )),
@@ -929,10 +871,9 @@ SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent)
{
FreeResource();
}
-/* -----------------04.02.2003 13:45-----------------
- *
- * --------------------------------------------------*/
+
SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/mailmrge.hrc b/sw/source/ui/envelp/mailmrge.hrc
index f03c42663fe6..0068585379ef 100644
--- a/sw/source/ui/envelp/mailmrge.hrc
+++ b/sw/source/ui/envelp/mailmrge.hrc
@@ -28,11 +28,9 @@
#ifndef _MAILMRGE_HRC
#define _MAILMRGE_HRC
-// #include -----------------------------------------------------------------
-
#include "envelp.hrc"
-// Elemente -----------------------------------------------------------------
+// elements -----------------------------------------------------------------
#define FL_RECORD 1
#define RB_ALL 2
diff --git a/sw/source/ui/envelp/mailmrge.src b/sw/source/ui/envelp/mailmrge.src
index a19c36458366..bfce23e9eb2d 100644
--- a/sw/source/ui/envelp/mailmrge.src
+++ b/sw/source/ui/envelp/mailmrge.src
@@ -25,7 +25,6 @@
*
************************************************************************/
- // #include *****************************************************************
#include "mailmrge.hrc"
#include "cmdid.h"
#include "helpid.h"
@@ -290,7 +289,6 @@ ModalDialog DLG_MAILMERGE
Pos = MAP_APPFONT ( 220 , 156 ) ;
Size = MAP_APPFONT ( 90 , 10 ) ;
Disable = TRUE ;
- /* ### ACHTUNG: Neuer Text in Resource? HTM~L : HTML */
TabStop = TRUE ;
Text [ en-US ] = "HTM~L" ;
};
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 2bbbc8526f10..2f3558341797 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,9 +97,6 @@ public:
inline SwNewDBMgr* GetNewDBMgr() const { return pNewDBMgr; }
};
-/* -----------------08.07.99 13:48-------------------
-
- --------------------------------------------------*/
class SwOneExampleFrame;
class SwVisitingCardPage : public SfxTabPage
{
@@ -146,9 +144,7 @@ public:
virtual sal_Bool FillItemSet(SfxItemSet& rSet);
virtual void Reset(const SfxItemSet& rSet);
};
-/* -----------------29.09.99 08:51-------------------
- --------------------------------------------------*/
class SwPrivateDataPage : public SfxTabPage
{
FixedLine aDataFL;
@@ -198,9 +194,7 @@ public:
virtual sal_Bool FillItemSet(SfxItemSet& rSet);
virtual void Reset(const SfxItemSet& rSet);
};
-/* -----------------29.09.99 08:51-------------------
- --------------------------------------------------*/
class SwBusinessDataPage : public SfxTabPage
{
FixedLine aDataFL;
@@ -251,3 +245,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/syncbtn.cxx b/sw/source/ui/envelp/syncbtn.cxx
index d0b43dd2efc5..7998ea3ef264 100644
--- a/sw/source/ui/envelp/syncbtn.cxx
+++ b/sw/source/ui/envelp/syncbtn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,10 +47,6 @@
SFX_IMPL_FLOATINGWINDOW( SwSyncChildWin, FN_SYNC_LABELS )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwSyncChildWin::SwSyncChildWin( Window* _pParent,
sal_uInt16 nId,
SfxBindings* pBindings,
@@ -77,10 +74,6 @@ SwSyncChildWin::SwSyncChildWin( Window* _pParent,
pWindow->Show();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent) :
@@ -91,18 +84,10 @@ SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings,
aSyncBtn.SetClickHdl(LINK(this, SwSyncBtnDlg, BtnHdl));
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-__EXPORT SwSyncBtnDlg::~SwSyncBtnDlg()
+SwSyncBtnDlg::~SwSyncBtnDlg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwSyncBtnDlg, BtnHdl, PushButton *, EMPTYARG )
{
SfxViewFrame::Current()->GetDispatcher()->Execute(FN_UPDATE_ALL_LINKS, SFX_CALLMODE_ASYNCHRON);
@@ -110,3 +95,4 @@ IMPL_LINK( SwSyncBtnDlg, BtnHdl, PushButton *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx
index 0379059682e8..a5f2b6fe5bd3 100644
--- a/sw/source/ui/fldui/DropDownFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,8 @@ using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Feldeinfuegen bearbeiten
+ Description: edit insert-field
--------------------------------------------------------------------*/
-
sw::DropDownFieldDialog::DropDownFieldDialog( Window *pParent, SwWrtShell &rS,
SwField* pField, sal_Bool bNextButton ) :
@@ -104,10 +104,6 @@ sw::DropDownFieldDialog::~DropDownFieldDialog()
{
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
-
void sw::DropDownFieldDialog::Apply()
{
if(pDropField)
@@ -128,12 +124,11 @@ void sw::DropDownFieldDialog::Apply()
}
}
}
-/* -----------------17.06.2003 10:50-----------------
- --------------------------------------------------*/
IMPL_LINK(sw::DropDownFieldDialog, ButtonHdl, PushButton*, pButton)
{
EndDialog(&aNextPB == pButton ? RET_OK : RET_YES );
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx
index 38910327754e..5a82ea186877 100644
--- a/sw/source/ui/fldui/FldRefTreeListBox.cxx
+++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,5 @@ void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt )
Window::RequestHelp( rHEvt );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/FldRefTreeListBox.hxx b/sw/source/ui/fldui/FldRefTreeListBox.hxx
index 92df954c8ddd..bbd209c119f9 100644
--- a/sw/source/ui/fldui/FldRefTreeListBox.hxx
+++ b/sw/source/ui/fldui/FldRefTreeListBox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index cbd24bf1c498..d1377bebd85e 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,22 +38,16 @@
#define _CHANGEDB_CXX
#include <svtools/stdctrl.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdb/XDatabaseAccess.hpp>
#include <comphelper/processfactory.hxx>
#include <sfx2/viewfrm.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <fldmgr.hxx>
#include <expfld.hxx>
#include <txtatr.hxx>
@@ -61,15 +56,9 @@
#include <dbfld.hxx>
#include <changedb.hxx>
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _CHANGEDB_HRC
#include <changedb.hrc>
-#endif
#include <unomid.h>
@@ -79,10 +68,8 @@ using namespace ::com::sun::star::lang;
/*--------------------------------------------------------------------
- Beschreibung: Feldeinfuegen bearbeiten
+ Description: edit insert-field
--------------------------------------------------------------------*/
-
-
SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), SW_RES(DLG_CHANGE_DB)),
@@ -98,10 +85,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
aOKBT (this, SW_RES(BT_OK )),
aCancelBT (this, SW_RES(BT_CANCEL )),
aHelpBT (this, SW_RES(BT_HELP )),
-// aChangeBT (this, SW_RES(BT_CHANGEDB )),
aImageList (SW_RES(ILIST_DB_DLG )),
- aImageListHC (SW_RES(ILIST_DB_DLG_HC )),
-
pSh(rVw.GetWrtShellPtr()),
pMgr( new SwFldMgr() )
{
@@ -117,11 +101,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION);
aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
aUsedDBTLB.SetSpaceBetweenEntries(0);
-
- aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
- aImageList.GetImage(IMG_EXPAND ), BMP_COLOR_NORMAL );
- aUsedDBTLB.SetNodeBitmaps( aImageListHC.GetImage(IMG_COLLAPSE),
- aImageListHC.GetImage(IMG_EXPAND ), BMP_COLOR_HIGHCONTRAST );
+ aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND));
Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl);
@@ -133,10 +113,8 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) :
}
/*--------------------------------------------------------------------
- Beschreibung: Datenbank-Listboxen initialisieren
+ Description: initialise database listboxes
--------------------------------------------------------------------*/
-
-
void SwChangeDBDlg::FillDBPopup()
{
Reference<XNameAccess> xDBContext;
@@ -146,7 +124,7 @@ void SwChangeDBDlg::FillDBPopup()
Reference<XInterface> xInstance = xMgr->createInstance( C2U( "com.sun.star.sdb.DatabaseContext" ));
xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ;
}
- DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
+ OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
const SwDBData& rDBData = pSh->GetDBData();
String sDBName(rDBData.sDataSource);
@@ -188,16 +166,11 @@ void SwChangeDBDlg::FillDBPopup()
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName)
{
String sDBName(rDBName.GetToken(0, DB_DELIM));
String sTableName(rDBName.GetToken(1, DB_DELIM));
- int nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32();
+ sal_IntPtr nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32();
SvLBoxEntry* pParent;
SvLBoxEntry* pChild;
@@ -207,11 +180,7 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName)
Image aTableImg = aImageList.GetImage(IMG_DBTABLE);
Image aDBImg = aImageList.GetImage(IMG_DB);
Image aQueryImg = aImageList.GetImage(IMG_DBQUERY);
- Image aHCTableImg = aImageListHC.GetImage(IMG_DBTABLE);
- Image aHCDBImg = aImageListHC.GetImage(IMG_DB);
- Image aHCQueryImg = aImageListHC.GetImage(IMG_DBQUERY);
Image& rToInsert = nCommandType ? aQueryImg : aTableImg;
- Image& rHCToInsert = nCommandType ? aHCQueryImg : aHCTableImg;
while ((pParent = aUsedDBTLB.GetEntry(nParent++)) != NULL)
{
if (sDBName == aUsedDBTLB.GetEntryText(pParent))
@@ -222,41 +191,33 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName)
return pChild;
}
SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent);
- aUsedDBTLB.SetExpandedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST);
- aUsedDBTLB.SetCollapsedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST);
pRet->SetUserData((void*)nCommandType);
return pRet;
}
}
pParent = aUsedDBTLB.InsertEntry(sDBName, aDBImg, aDBImg);
- aUsedDBTLB.SetExpandedEntryBmp(pParent, aHCDBImg, BMP_COLOR_HIGHCONTRAST);
- aUsedDBTLB.SetCollapsedEntryBmp(pParent, aHCDBImg, BMP_COLOR_HIGHCONTRAST);
SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent);
- aUsedDBTLB.SetExpandedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST);
- aUsedDBTLB.SetCollapsedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST);
pRet->SetUserData((void*)nCommandType);
return pRet;
}
/*--------------------------------------------------------------------
- Beschreibung: Dialog zerstoeren
+ Description: destroy dialog
--------------------------------------------------------------------*/
-__EXPORT SwChangeDBDlg::~SwChangeDBDlg()
+SwChangeDBDlg::~SwChangeDBDlg()
{
delete pMgr;
}
/*--------------------------------------------------------------------
- Beschreibung: Schliessen
+ Description: close
--------------------------------------------------------------------*/
-void __EXPORT SwChangeDBDlg::Apply()
+void SwChangeDBDlg::Apply()
{
UpdateFlds();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
void SwChangeDBDlg::UpdateFlds()
{
SvStringsDtor aDBNames( (sal_uInt8)aUsedDBTLB.GetSelectionCount(), 1 );
@@ -290,11 +251,6 @@ void SwChangeDBDlg::UpdateFlds()
pSh->EndAllAction();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, EMPTYARG )
{
String sTableName, sColumnName;
@@ -310,11 +266,6 @@ IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
IMPL_LINK( SwChangeDBDlg, TreeSelectHdl, SvTreeListBox *, EMPTYARG )
{
sal_Bool bEnable = sal_False;
@@ -331,9 +282,8 @@ IMPL_LINK( SwChangeDBDlg, TreeSelectHdl, SvTreeListBox *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: Datenbankname fuer Anzeige wandeln
+ Description: convert database name for display
--------------------------------------------------------------------*/
-
void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData)
{
String sTmp(rDBData.sDataSource);
@@ -350,9 +300,7 @@ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData)
aDocDBNameFT.SetText(sName);
}
-/*-- 27.05.2004 09:14:01---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwChangeDBDlg, AddDBHdl, PushButton *, EMPTYARG )
{
String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource();
@@ -361,3 +309,4 @@ IMPL_LINK( SwChangeDBDlg, AddDBHdl, PushButton *, EMPTYARG )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/changedb.hrc b/sw/source/ui/fldui/changedb.hrc
index 7bccd2fa9363..bc90e9f453ee 100644
--- a/sw/source/ui/fldui/changedb.hrc
+++ b/sw/source/ui/fldui/changedb.hrc
@@ -28,9 +28,7 @@
#ifndef _CHANGEDB_HRC
#define _CHANGEDB_HRC
-// #include -----------------------------------------------------------------
-
-// Elemente -----------------------------------------------------------------
+// elements -----------------------------------------------------------------
#define FT_DESC 1
#define FT_DOCDBTEXT 2
@@ -48,7 +46,7 @@
/*--------------------------------------------------------------------
- Beschreibung: Bitmaps
+ Description: Bitmaps
--------------------------------------------------------------------*/
#define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 44fd4bc213ee..d6f57df395ef 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,38 +34,21 @@
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <dbfld.hxx>
-#ifndef _FLDTDLG_HXX
#include <fldtdlg.hxx>
-#endif
#include <numrule.hxx>
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _FLDDB_HXX
#include <flddb.hxx>
-#endif
#include <dbconfig.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwFldDBPage::SwFldDBPage(Window* pParent, const SfxItemSet& rCoreSet ) :
SwFldPage( pParent, SW_RES( TP_FLD_DB ), rCoreSet ),
@@ -97,19 +81,14 @@ SwFldDBPage::SwFldDBPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aAddDBPB.SetClickHdl(LINK(this, SwFldDBPage, AddDBHdl));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-__EXPORT SwFldDBPage::~SwFldDBPage()
+SwFldDBPage::~SwFldDBPage()
{
}
/*--------------------------------------------------------------------
- Beschreibung: TabPage initialisieren
+ Description: initialise TabPage
--------------------------------------------------------------------*/
-
-void __EXPORT SwFldDBPage::Reset(const SfxItemSet&)
+void SwFldDBPage::Reset(const SfxItemSet&)
{
Init(); // Allgemeine initialisierung
@@ -123,7 +102,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet&)
if (!IsFldEdit())
{
- // TypeListBox initialisieren
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
for(i = rRg.nStart; i < rRg.nEnd; ++i)
@@ -140,7 +119,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet&)
aTypeLB.SetEntryData(nPos, reinterpret_cast<void*>(nTypeId));
}
- // alte Pos selektieren
+ // select old Pos
if (GetTypeSel() != LISTBOX_ENTRY_NOTFOUND)
aTypeLB.SelectEntryPos(GetTypeSel());
@@ -212,11 +191,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet&)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-sal_Bool __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& )
+sal_Bool SwFldDBPage::FillItemSet(SfxItemSet& )
{
String sTableName, sColumnName;
SwDBData aData;
@@ -231,7 +206,7 @@ sal_Bool __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& )
if (!aData.sDataSource.getLength())
aData = pSh->GetDBData();
- if(aData.sDataSource.getLength()) // Ohne Datenbank kein neuer Feldbefehl
+ if(aData.sDataSource.getLength()) // without database no new field command
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
String aVal(aValueED.GetText());
@@ -285,35 +260,23 @@ sal_Bool __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& )
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwFldDBPage::Create( Window* pParent,
+SfxTabPage* SwFldDBPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldDBPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldDBPage::GetGroup()
{
return GRP_DB;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
- // Aktuelle ListBoxPos
+ // current ListBoxPos
SetTypeSel(aTypeLB.GetSelectEntryPos());
if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
@@ -356,7 +319,7 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox )
aNumFormatLB.Show();
aFormatLB.Hide();
- if (pBox) // Typ wurde vom User geaendert
+ if (pBox) // type was changed by user
aDBFormatRB.Check();
if (IsFldEdit())
@@ -373,7 +336,7 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox )
case TYP_DBNUMSETFLD:
bSetNo = sal_True;
- // kein break!
+ // no break!
case TYP_DBNEXTSETFLD:
bCond = sal_True;
if (IsFldEdit())
@@ -422,7 +385,7 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox )
aValueED.SetText(aEmptyStr);
if (bCond)
aConditionED.SetText( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "sal_True" )));
+ RTL_CONSTASCII_STRINGPARAM( "TRUE" )));
else
aConditionED.SetText(aEmptyStr);
}
@@ -433,10 +396,6 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDBPage, NumSelectHdl, NumFormatListBox *, pLB )
{
aNewFormatRB.Check();
@@ -445,10 +404,6 @@ IMPL_LINK( SwFldDBPage, NumSelectHdl, NumFormatListBox *, pLB )
return 0;
}
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
-
void SwFldDBPage::CheckInsert()
{
sal_Bool bInsert = sal_True;
@@ -478,10 +433,6 @@ void SwFldDBPage::CheckInsert()
EnableInsert(bInsert);
}
-/*---------------------------------------------------------------------
- Beschreibung:
----------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox )
{
SvLBoxEntry* pColEntry;
@@ -523,9 +474,7 @@ IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox )
}
return 0;
}
-/*-- 27.05.2004 09:14:01---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK( SwFldDBPage, AddDBHdl, PushButton *, EMPTYARG )
{
String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource();
@@ -537,18 +486,14 @@ IMPL_LINK( SwFldDBPage, AddDBHdl, PushButton *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: Modify
+ Description: Modify
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDBPage, ModifyHdl, Edit *, EMPTYARG )
{
CheckInsert();
return 0;
}
-/* -----------------12.01.99 11:21-------------------
- *
- * --------------------------------------------------*/
void SwFldDBPage::FillUserData()
{
String sData( String::CreateFromAscii(
@@ -563,9 +508,7 @@ void SwFldDBPage::FillUserData()
sData += String::CreateFromInt32( nTypeSel );
SetUserData(sData);
}
-/* -----------------12.12.2002 11:33-----------------
- *
- * --------------------------------------------------*/
+
void SwFldDBPage::ActivateMailMergeAddress()
{
sal_uLong nData = TYP_DBFLD;
@@ -574,10 +517,10 @@ void SwFldDBPage::ActivateMailMergeAddress()
const SwDBData& rData = SW_MOD()->GetDBConfig()->GetAddressSource();
aDatabaseTLB.Select(rData.sDataSource, rData.sCommand, aEmptyStr);
}
-/*-- 07.10.2003 13:59:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFldDBPage::SetWrtShell(SwWrtShell& rSh)
{
aDatabaseTLB.SetWrtShell(rSh);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index 8f93d97f8b16..07e76a171708 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include "condedit.hxx"
@@ -40,10 +39,6 @@
#include "fldpage.hxx"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwFldDBPage : public SwFldPage
{
FixedText aTypeFT;
@@ -104,3 +99,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 549593bc3496..9d29019bf3b1 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,16 +48,10 @@
#include <fldui.hrc>
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
-#ifndef _FLDDINF_HXX
#include <flddinf.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
@@ -67,9 +62,6 @@
using namespace nsSwDocInfoSubType;
using namespace com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
SwFldPage( pWindow, SW_RES( TP_FLD_DOKINF ), rCoreSet ),
@@ -90,8 +82,8 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
aTypeTLB.SetHelpId(HID_FIELD_DINF_TYPE);
aTypeTLB.SetSelectionMode(SINGLE_SELECTION);
aTypeTLB.SetStyle(aTypeTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
- // Font nicht setzen, damit der Font des Controls uebernommen wird!
- // Sonst bei falschem Font Bug an OV.
+ // Don't set font, so that the control's font is adobted!
+ // Otherwise at wrong font bug to OV.
aTypeTLB.SetSpaceBetweenEntries(0);
aTypeTLB.SetNodeDefaultImages();
@@ -103,28 +95,20 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
pItem->GetValue() >>= xCustomPropertySet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-__EXPORT SwFldDokInfPage::~SwFldDokInfPage()
+SwFldDokInfPage::~SwFldDokInfPage()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& )
+void SwFldDokInfPage::Reset(const SfxItemSet& )
{
- Init(); // Allgemeine initialisierung
+ Init(); // general initialisation
- // TypeListBox initialisieren
+ // initialise TypeListBox
aTypeTLB.SetUpdateMode(sal_False);
aTypeTLB.Clear();
pSelEntry = 0;
- // SubTypes in der TypeLB anzeigen
+ // display SubTypes in TypeLB
sal_uInt16 nTypeId = TYP_DOCINFOFLD;
SvLBoxEntry* pEntry = 0;
@@ -169,11 +153,7 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& )
{
uno::Reference< beans::XPropertySetInfo > xSetInfo = xCustomPropertySet->getPropertySetInfo();
const uno::Sequence< beans::Property > rProperties = xSetInfo->getProperties();
-// uno::Sequence< ::rtl::OUString > aPropertyNames(rProperties.getLength());
-// for (sal_Int32 i = 0; i < rProperties.getLength(); ++i) {
-// aPropertyNames[i] = rProperties[i].Name;
-// }
- //if ( !IsFldEdit() )
+
if( rProperties.getLength() )
{
pInfo = aTypeTLB.InsertEntry( String(SW_RES( STR_CUSTOM )) );
@@ -206,7 +186,7 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& )
}
}
- // alte Pos selektieren
+ // select old Pos
if (pSelEntry != 0)
{
aTypeTLB.Select(pSelEntry);
@@ -237,16 +217,12 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
SvLBoxEntry* pOldEntry = pSelEntry;
- // Aktuelle ListBoxPos
+ // current ListBoxPos
pSelEntry = aTypeTLB.FirstSelected();
if(!pSelEntry)
@@ -264,9 +240,6 @@ IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData();
@@ -402,13 +375,9 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
{
- // Format-Listbox fuellen
+ // fill Format-Listbox
sal_uInt16 nTypeId = TYP_DOCINFOFLD;
EnableInsert(nSubType != USHRT_MAX);
@@ -430,7 +399,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
if (nSubType < DI_CREATE || nSubType == DI_DOCNO || nSubType == DI_EDIT|| nSubType == DI_CUSTOM )
{
- // Format Box ist fuer Title und Time leer
+ // Format Box is empty for Title and Time
}
else
{
@@ -460,11 +429,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
return nSize;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-sal_Bool __EXPORT SwFldDokInfPage::FillItemSet(SfxItemSet& )
+sal_Bool SwFldDokInfPage::FillItemSet(SfxItemSet& )
{
if (!pSelEntry || (sal_uInt16)(sal_uLong)pSelEntry->GetUserData() == USHRT_MAX)
return sal_False;
@@ -501,27 +466,17 @@ sal_Bool __EXPORT SwFldDokInfPage::FillItemSet(SfxItemSet& )
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwFldDokInfPage::Create( Window* pParent,
+SfxTabPage* SwFldDokInfPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldDokInfPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldDokInfPage::GetGroup()
{
return GRP_REG;
}
-/* -----------------12.01.99 11:21-------------------
- *
- * --------------------------------------------------*/
+
void SwFldDokInfPage::FillUserData()
{
String sData( String::CreateFromAscii(
@@ -535,3 +490,4 @@ void SwFldDokInfPage::FillUserData()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index 05bee2dc32c3..ac19388d5c9f 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,6 @@
namespace com{namespace sun{ namespace star{ namespace beans{
class XPropertySet;
}}}}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SwFldDokInfPage : public SwFldPage
{
@@ -87,3 +85,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index d405245ed704..678d30eddb90 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,23 +36,13 @@
#include <vcl/svapp.hxx>
#include <flddat.hxx>
#include <docufld.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <chpfld.hxx>
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _FLDDOK_HXX
#include <flddok.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <svl/zformat.hxx>
@@ -60,10 +51,6 @@
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldDokPage::SwFldDokPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
SwFldPage( pWindow, SW_RES( TP_FLD_DOK ), rCoreSet ),
@@ -99,24 +86,16 @@ SwFldDokPage::SwFldDokPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
aNumFormatLB.SetShowLanguageControl(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-__EXPORT SwFldDokPage::~SwFldDokPage()
+SwFldDokPage::~SwFldDokPage()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-void __EXPORT SwFldDokPage::Reset(const SfxItemSet& )
+void SwFldDokPage::Reset(const SfxItemSet& )
{
SavePos(&aTypeLB);
- Init(); // Allgemeine initialisierung
+ Init(); // general initialisation
- // TypeListBox initialisieren
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
aTypeLB.SetUpdateMode(sal_False);
@@ -127,7 +106,7 @@ void __EXPORT SwFldDokPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // Typ-Listbox fuellen
+ // fill Type-Listbox
for(short i = rRg.nStart; i < rRg.nEnd; ++i)
{
nTypeId = GetFldMgr().GetTypeId(i);
@@ -174,7 +153,7 @@ void __EXPORT SwFldDokPage::Reset(const SfxItemSet& )
}
}
- // alte Pos selektieren
+ // select old Pos
RestorePos(&aTypeLB);
aTypeLB.SetUpdateMode(sal_True);
@@ -213,16 +192,12 @@ void __EXPORT SwFldDokPage::Reset(const SfxItemSet& )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
- // Aktuelle ListBoxPos
+ // current ListBoxPos
SetTypeSel(aTypeLB.GetSelectEntryPos());
if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
@@ -237,7 +212,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // Auswahl-Listbox fuellen
+ // fill Selection-Listbox
aSelectionLB.Clear();
if (nTypeId != USHRT_MAX)
@@ -329,7 +304,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
aSelectionLB.Enable( bEnable );
aSelectionFT.Enable( bEnable );
- // Format-Listbox fuellen
+ // fill Format-Listbox
sal_uInt16 nSize = FillFormatLB(nTypeId);
sal_Bool bValue = sal_False, bLevel = sal_False, bNumFmt = sal_False, bOffset = sal_False;
@@ -345,7 +320,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
nFmtType = NUMBERFORMAT_DATE;
aValueFT.SetText(sDateOffset);
- aDateOffsetED.SetFirst(-31); // Ein Monat
+ aDateOffsetED.SetFirst(-31); // one month
aDateOffsetED.SetLast(31);
if (IsFldEdit())
@@ -357,7 +332,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
nFmtType = NUMBERFORMAT_TIME;
aValueFT.SetText(sTimeOffset);
- aDateOffsetED.SetFirst(-1440); // Ein Tag
+ aDateOffsetED.SetFirst(-1440); // one day
aDateOffsetED.SetLast(1440);
if (IsFldEdit())
@@ -422,11 +397,11 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
if (aNumFormatLB.GetFormatType() == (NUMBERFORMAT_DATE|NUMBERFORMAT_TIME))
{
- // Format-Typ immer einstellen, da sonst bei kombinierten Datum/Zeitformaten
- // beide Formate gleichzeitig angezeigt werden wuerden
+ // always set Format-Type because otherwise when date/time formats are combined,
+ // both formats would be displayed at the same time
aNumFormatLB.SetFormatType(0);
aNumFormatLB.SetFormatType(nFmtType);
- // Nochmal richtiges Format einstellen
+ // set correct format once again
aNumFormatLB.SetDefFormat(GetCurField()->GetFormat());
}
}
@@ -471,20 +446,12 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldDokPage::AddSubType(sal_uInt16 nTypeId)
{
sal_uInt16 nPos = aSelectionLB.InsertEntry(SwFieldType::GetTypeStr(nTypeId));
aSelectionLB.SetEntryData(nPos, reinterpret_cast<void*>(nTypeId));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDokPage, SubTypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nPos = aSelectionLB.GetSelectEntryPos();
@@ -519,13 +486,9 @@ IMPL_LINK( SwFldDokPage, SubTypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId)
{
- // Format-Listbox fuellen
+ // fill Format-Listbox
aFormatLB.Clear();
if (nTypeId == TYP_AUTHORFLD)
@@ -558,10 +521,6 @@ sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId)
return nSize;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDokPage, FormatHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -577,7 +536,7 @@ IMPL_LINK( SwFldDokPage, FormatHdl, ListBox *, EMPTYARG )
if (nTypeId == TYP_NEXTPAGEFLD || nTypeId == TYP_PREVPAGEFLD)
{
- // Prev/Next - PageNumFelder Sonderbehandlung:
+ // Prev/Next - PageNumFields special treatment:
sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)aFormatLB.GetEntryData(
aFormatLB.GetSelectEntryPos() );
String sOldTxt( aValueFT.GetText() );
@@ -594,13 +553,8 @@ IMPL_LINK( SwFldDokPage, FormatHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& )
+sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& )
{
- sal_Bool bPage = sal_False;
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
if (nTypeId == USHRT_MAX)
@@ -609,7 +563,6 @@ sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& )
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
nTypeId = (sal_uInt16)(sal_uLong)aSelectionLB.GetEntryData(nPos);
- bPage = sal_True;
}
String aVal(aValueED.GetText());
@@ -635,7 +588,7 @@ sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& )
case TYP_AUTHORFLD:
nFormat = nSubType;
nSubType = 0;
- // kein break!
+ // no break!
case TYP_EXTUSERFLD:
nFormat |= aFixedCB.IsChecked() ? AF_FIXED : 0;
break;
@@ -692,28 +645,17 @@ sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& )
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwFldDokPage::Create( Window* pParent,
+SfxTabPage* SwFldDokPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldDokPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldDokPage::GetGroup()
{
return GRP_DOC;
}
-/* -----------------12.01.99 10:09-------------------
- *
- * --------------------------------------------------*/
void SwFldDokPage::FillUserData()
{
String sData( String::CreateFromAscii(
@@ -728,4 +670,4 @@ void SwFldDokPage::FillUserData()
SetUserData(sData);
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx
index d5720a4e2872..9bff88a0bb9c 100644
--- a/sw/source/ui/fldui/flddok.hxx
+++ b/sw/source/ui/fldui/flddok.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include <vcl/edit.hxx>
#include <vcl/field.hxx>
@@ -40,10 +39,6 @@
#include "numfmtlb.hxx"
#include "fldpage.hxx"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwFldDokPage : public SwFldPage
{
FixedText aTypeFT;
@@ -93,3 +88,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 3d6d52659c9d..279701c13284 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,61 +38,34 @@
#include <sfx2/app.hxx>
#include <svx/optgenrl.hxx>
#include <docufld.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <dbfld.hxx>
#include <wrtsh.hxx>
-#ifndef _FLDDB_HXX
#include <flddb.hxx>
-#endif
-#ifndef _FLDDINF_HXX
#include <flddinf.hxx>
-#endif
-#ifndef _FLDVAR_HXX
#include <fldvar.hxx>
-#endif
-#ifndef _FLDDOK_HXX
#include <flddok.hxx>
-#endif
-#ifndef _FLDFUNC_HXX
#include <fldfunc.hxx>
-#endif
-#ifndef _FLDREF_HXX
#include <fldref.hxx>
-#endif
#include <fldedt.hxx>
#include <crsskip.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
#include "swabstdlg.hxx"
#include "dialog.hrc"
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-
namespace swui
{
SwAbstractDialogFactory * GetFactory();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
SfxSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, 0),
pSh (rVw.GetWrtShellPtr()),
@@ -120,9 +94,9 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
GetOKButton()->SetClickHdl(LINK(this, SwFldEditDlg, OKHdl));
- // Buttons selbst positionieren, da sie sonst bei unterschiedlichen
- // Fontgroessen im Wald stehen, und da PB im SingleTabDlg feste Pixelgroessen
- // fuer seine Buttons und die Dialogbreite verwendet.
+ // position buttons ourselves because otherwise when font sizes are
+ // varying, they are in the woods, and because PB uses fixed pixel sizes
+ // for its buttons and dialog width in SingleTabDlg.
aPrevBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aPrevBT.GetPosPixel().Y()));
sal_uInt16 nWidth = static_cast< sal_uInt16 >(GetOKButton()->GetOutputSize().Width() / 2 - 3);
Size aNewSize(LogicToPixel(Size(nWidth, GetOKButton()->GetOutputSize().Height())));
@@ -147,9 +121,8 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
}
/*--------------------------------------------------------------------
- Beschreibung: Controlls initialisieren
+ Description: initialise controls
--------------------------------------------------------------------*/
-
void SwFldEditDlg::Init()
{
SwFldPage* pTabPage = (SwFldPage*)GetTabPage();
@@ -163,7 +136,7 @@ void SwFldEditDlg::Init()
if(!pCurFld)
return;
- // Traveling nur bei mehr als einem Feld
+ // Traveling only when more than one field
pSh->StartAction();
pSh->CreateCrsr();
@@ -187,13 +160,9 @@ void SwFldEditDlg::Init()
!pSh->HasReadonlySel() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
{
- // TabPage erzeugen
+ // create TabPage
SfxTabPage* pTabPage = 0;
const char* pHelpId = 0;
@@ -223,14 +192,6 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
uno::Reference< beans::XPropertySet > xUDProps(
xDocProps->getUserDefinedProperties(),
uno::UNO_QUERY_THROW);
-// uno::Reference< beans::XPropertySetInfo > xSetInfo
-// = xUDProps->getPropertySetInfo();
-// const uno::Sequence< beans::Property > props
-// = xSetInfo->getProperties();
-// uno::Sequence< ::rtl::OUString > names(props.getLength());
-// for (sal_Int32 i = 0; i < props.getLength(); ++i) {
-// names[i] = props[i].Name;
-// }
pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) );
pTabPage = SwFldDokInfPage::Create(this, *pSet);
pHelpId = HID_EDIT_FLD_DOKINF;
@@ -261,20 +222,12 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
return pTabPage;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldEditDlg::~SwFldEditDlg()
{
pSh->SetCareWin(NULL);
pSh->EnterStdMode();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldEditDlg::EnableInsert(sal_Bool bEnable)
{
if( bEnable && pSh->IsReadOnlyAvailable() && pSh->HasReadonlySel() )
@@ -282,19 +235,14 @@ void SwFldEditDlg::EnableInsert(sal_Bool bEnable)
GetOKButton()->Enable( bEnable );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldEditDlg::InsertHdl()
{
GetOKButton()->Click();
}
/*--------------------------------------------------------------------
- Beschreibung: Aendern des Feldes anstossen
+ Description: kick off changing of the field
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldEditDlg, OKHdl, Button *, EMPTYARG )
{
if (GetOKButton()->IsEnabled())
@@ -311,20 +259,15 @@ IMPL_LINK( SwFldEditDlg, OKHdl, Button *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
short SwFldEditDlg::Execute()
{
- // Ohne TabPage kein Dialog
+ // without TabPage no dialog
return GetTabPage() ? Dialog::Execute() : RET_CANCEL;
}
/*--------------------------------------------------------------------
- Beschreibung: Traveling zwishen Feldern gleichen Typs
+ Description: Traveling between fields of the same type
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton )
{
sal_Bool bNext = pButton == &aNextBT;
@@ -366,10 +309,6 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG )
{
SwFldPage* pTabPage = (SwFldPage*)GetTabPage();
@@ -405,12 +344,12 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG )
}
aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, nEditPos));
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aSet,
pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(),
RC_DLG_ADDR );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
pSh->UpdateFlds( *pCurFld );
@@ -419,4 +358,4 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG )
return 0;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 1f3030686a1a..719f8e892883 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,26 +38,16 @@
#include <basic/sbmod.hxx>
#include <docsh.hxx>
#include <swtypes.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <fldbas.hxx>
#include <docufld.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <swmodule.hxx>
-#ifndef _FLDFUNC_HXX
#include <fldfunc.hxx>
-#endif
#include <flddropdown.hxx>
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
@@ -65,10 +56,6 @@ using namespace ::com::sun::star;
using rtl::OUString;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldFuncPage::SwFldFuncPage(Window* pParent, const SfxItemSet& rCoreSet ) :
SwFldPage( pParent, SW_RES( TP_FLD_FUNC ), rCoreSet ),
@@ -111,25 +98,16 @@ SwFldFuncPage::SwFldFuncPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aCond1ED.ShowBrackets(sal_False);
aCond2ED.ShowBrackets(sal_False);
-// SwWrtShell* pSh = (SwWrtShell*)ViewShell::GetCurrShell();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldFuncPage::~SwFldFuncPage()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldFuncPage::Reset(const SfxItemSet& )
{
SavePos(&aTypeLB);
- Init(); // Allgemeine initialisierung
+ Init(); // general initialisation
aTypeLB.SetUpdateMode(sal_False);
aTypeLB.Clear();
@@ -138,10 +116,10 @@ void SwFldFuncPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // TypeListBox initialisieren
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
- // Typ-Listbox fuellen
+ // fill Typ-Listbox
for(short i = rRg.nStart; i < rRg.nEnd; ++i)
{
nTypeId = GetFldMgr().GetTypeId(i);
@@ -162,7 +140,7 @@ void SwFldFuncPage::Reset(const SfxItemSet& )
}
}
- // alte Pos selektieren
+ // select old Pos
RestorePos(&aTypeLB);
aTypeLB.SetDoubleClickHdl (LINK(this, SwFldFuncPage, InsertHdl));
@@ -213,16 +191,12 @@ void SwFldFuncPage::Reset(const SfxItemSet& )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
- // Aktuelle ListBoxPos
+ // current ListBoxPos
SetTypeSel(aTypeLB.GetSelectEntryPos());
if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
@@ -235,10 +209,10 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // Auswahl-Listbox fuellen
+ // fill Selection-Listbox
UpdateSubType();
- // Format-Listbox fuellen
+ // fill Format-Listbox
aFormatLB.Clear();
sal_uInt16 nSize = GetFldMgr().GetFormatCount(nTypeId, sal_False, IsFldDlgHtmlMode());
@@ -262,7 +236,7 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
sal_Bool bShowSelection = sal_False;
sal_Bool bFormat = nSize != 0;
- // fuer Conditional Text zwei Controls
+ // two controls for conditional text
sal_Bool bDropDown = TYP_DROPDOWN == nTypeId;
sal_Bool bCondTxtFld = TYP_CONDTXTFLD == nTypeId;
@@ -386,7 +360,6 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
case TYP_INPUTFLD:
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
bValue = sal_True;
- // bShowSelection = TRUE;
aNameED.SetAccessibleName(aNameFT.GetText());
aValueED.SetAccessibleName(aValueFT.GetText());
break;
@@ -439,10 +412,6 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldFuncPage, SelectHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -453,10 +422,6 @@ IMPL_LINK( SwFldFuncPage, SelectHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldFuncPage, InsertMacroHdl, ListBox *, EMPTYARG )
{
SelectHdl();
@@ -464,9 +429,7 @@ IMPL_LINK( SwFldFuncPage, InsertMacroHdl, ListBox *, EMPTYARG )
return 0;
}
-/* -----------------16.06.2003 16:24-----------------
- --------------------------------------------------*/
IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl)
{
aListItemsLB.SetUpdateMode(sal_False);
@@ -513,9 +476,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl)
ListEnableHdl(0);
return 0;
}
-/* -----------------17.06.2003 08:36-----------------
- --------------------------------------------------*/
IMPL_LINK( SwFldFuncPage, ListEnableHdl, void*, EMPTYARG)
{
//enable "Add" button when text is in the Edit that's not already member of the box
@@ -531,15 +492,13 @@ IMPL_LINK( SwFldFuncPage, ListEnableHdl, void*, EMPTYARG)
}
/*--------------------------------------------------------------------
- Beschreibung: Typen in der SelectionBox erneuern
+ Description: renew types in SelectionBox
--------------------------------------------------------------------*/
-
-
void SwFldFuncPage::UpdateSubType()
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // Auswahl-Listbox fuellen
+ // fill Selction-Listbox
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
@@ -580,9 +539,8 @@ void SwFldFuncPage::UpdateSubType()
}
/*--------------------------------------------------------------------
- Beschreibung: MacroBrowser aufrufen, Listbox mit Macros fuellen
+ Description: call MacroBrowser, fill Listbox with Macros
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn )
{
Window* pDefModalDlgParent = Application::GetDefDialogParent();
@@ -599,10 +557,6 @@ IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -666,20 +620,16 @@ sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& )
InsertFld( nTypeId, nSubType, aName, aVal, nFormat );
}
- ModifyHdl(); // Insert ggf enablen/disablen
+ ModifyHdl(); // enable/disable Insert if applicable
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String SwFldFuncPage::TurnMacroString(const String &rMacro)
{
if (rMacro.Len())
{
- // Inhalt von aName umdrehen
+ // reverse content of aName
String sTmp, sBuf;
sal_uInt16 nPos = 0;
@@ -700,28 +650,17 @@ String SwFldFuncPage::TurnMacroString(const String &rMacro)
return rMacro;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxTabPage* SwFldFuncPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldFuncPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldFuncPage::GetGroup()
{
return GRP_FKT;
}
-/* -----------------12.01.99 10:09-------------------
- *
- * --------------------------------------------------*/
void SwFldFuncPage::FillUserData()
{
String sData( String::CreateFromAscii(
@@ -753,6 +692,4 @@ IMPL_LINK( SwFldFuncPage, ModifyHdl, Edit *, EMPTYARG )
return 0;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx
index 9a052bed7034..9db7ed3d2fbe 100644
--- a/sw/source/ui/fldui/fldfunc.hxx
+++ b/sw/source/ui/fldui/fldfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,18 +31,13 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include <vcl/edit.hxx>
#include "condedit.hxx"
#include "fldpage.hxx"
#include <actctrl.hxx>
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SwFldFuncPage : public SwFldPage
{
@@ -86,7 +82,7 @@ class SwFldFuncPage : public SwFldPage
DECL_LINK( ListModifyHdl, Control*);
DECL_LINK( ListEnableHdl, void*);
- // Macro ausw„hlen
+ // select Macro
DECL_LINK( MacroHdl, Button * );
void UpdateSubType();
@@ -111,3 +107,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index ccf91732ccef..ae82af0b772f 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,9 +60,9 @@
#include <svl/zformat.hxx>
#include <vcl/mnemonic.hxx>
#include <view.hxx>
-#include <wrtsh.hxx> // Actives Fenster
-#include <doc.hxx> // Actives Fenster
-#include <docsh.hxx> // Actives Fenster
+#include <wrtsh.hxx> // active window
+#include <doc.hxx> // active window
+#include <docsh.hxx> // active window
#include <swmodule.hxx>
#include <charatr.hxx>
#include <fmtinfmt.hxx>
@@ -96,7 +97,7 @@ using namespace ::com::sun::star;
using namespace nsSwDocInfoSubType;
/*--------------------------------------------------------------------
- Beschreibung: Gruppen der Felder
+ Description: groups of fields
--------------------------------------------------------------------*/
enum
{
@@ -125,15 +126,15 @@ enum
GRP_WEB_DOC_END = GRP_WEB_DOC_BEGIN + 9,
GRP_WEB_FKT_BEGIN = GRP_WEB_DOC_END + 2,
- GRP_WEB_FKT_END = GRP_WEB_FKT_BEGIN + 0, // Die Gruppe ist leer!
+ GRP_WEB_FKT_END = GRP_WEB_FKT_BEGIN + 0, // the group is empty!
- GRP_WEB_REF_BEGIN = GRP_WEB_FKT_END + 6, // Die Gruppe ist leer!
+ GRP_WEB_REF_BEGIN = GRP_WEB_FKT_END + 6, // the group is empty!
GRP_WEB_REF_END = GRP_WEB_REF_BEGIN + 0,
GRP_WEB_REG_BEGIN = GRP_WEB_REF_END + 2,
GRP_WEB_REG_END = GRP_WEB_REG_BEGIN + 1,
- GRP_WEB_DB_BEGIN = GRP_WEB_REG_END, // Die Gruppe ist leer!
+ GRP_WEB_DB_BEGIN = GRP_WEB_REG_END, // the group is empty!
GRP_WEB_DB_END = GRP_WEB_DB_BEGIN + 0,
GRP_WEB_VAR_BEGIN = GRP_WEB_DB_END + 5,
@@ -141,35 +142,31 @@ enum
};
/*--------------------------------------------------------------------
- Beschreibung: Formate in der richtigen Reihenfolge
+ Description: formats in the correct order
--------------------------------------------------------------------*/
-static const sal_uInt16 __FAR_DATA aSetFmt[] =
+static const sal_uInt16 aSetFmt[] =
{
-// die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_SETVAR_???
-// uebereinstimmen
+// at first the order has to match the ResourceIds for FMT_SETVAR_???
0,
0
};
-static const sal_uInt16 __FAR_DATA aGetFmt[] =
+static const sal_uInt16 aGetFmt[] =
{
-// die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_GETVAR_???
-// uebereinstimmen
+// at first the order has to match the ResourceIds for FMT_GETVAR_???
0
};
-static const sal_uInt16 __FAR_DATA aUsrFmt[] =
+static const sal_uInt16 aUsrFmt[] =
{
-// die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_SETVAR_???
-// uebereinstimmen
+// at first the order has to match the ResourceIds for FMT_SETVAR_???
0,
nsSwExtendedSubType::SUB_CMD
};
-static const sal_uInt16 __FAR_DATA aDBFmt[] =
+static const sal_uInt16 aDBFmt[] =
{
-// die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_DBFLD_???
-// uebereinstimmen
+// at first the order has to match the ResourceIds for FMT_DBFLD_???
nsSwExtendedSubType::SUB_OWN_FMT
};
@@ -178,7 +175,7 @@ static const sal_uInt16 VF_USR_COUNT = sizeof(aUsrFmt) / sizeof(sal_uInt16);
static const sal_uInt16 VF_DB_COUNT = sizeof(aDBFmt) / sizeof(sal_uInt16);
/*--------------------------------------------------------------------
- Beschreibung: Feldtypen und Subtypes
+ Description: field types and subtypes
--------------------------------------------------------------------*/
struct SwFldPack
{
@@ -192,11 +189,11 @@ struct SwFldPack
};
/*--------------------------------------------------------------------
- Beschreibung: Strings und Formate
+ Description: strings and formats
--------------------------------------------------------------------*/
-static const SwFldPack __FAR_DATA aSwFlds[] =
+static const SwFldPack aSwFlds[] =
{
- // Dokument
+ // Document
{ TYP_EXTUSERFLD, FLD_EU_BEGIN, FLD_EU_END, 0, 0 },
{ TYP_AUTHORFLD, 0, 0, FMT_AUTHOR_BEGIN, FMT_AUTHOR_END },
{ TYP_DATEFLD, FLD_DATE_BEGIN, FLD_DATE_END, 0, 0 },
@@ -210,7 +207,7 @@ static const SwFldPack __FAR_DATA aSwFlds[] =
{ TYP_CHAPTERFLD, 0, 0, FMT_CHAPTER_BEGIN, FMT_CHAPTER_END },
{ TYP_TEMPLNAMEFLD, 0, 0, FMT_FF_BEGIN, FMT_FF_END },
- // Funktion
+ // Functions
{ TYP_CONDTXTFLD, 0, 0, 0, 0 },
{ TYP_DROPDOWN, 0, 0, 0, 0 },
{ TYP_INPUTFLD, FLD_INPUT_BEGIN, FLD_INPUT_END, 0, 0 },
@@ -220,21 +217,21 @@ static const SwFldPack __FAR_DATA aSwFlds[] =
{ TYP_HIDDENTXTFLD, 0, 0, 0, 0 },
{ TYP_HIDDENPARAFLD, 0, 0, 0, 0 },
- // Referenzen
+ // Cross-References
{ TYP_SETREFFLD, 0, 0, 0, 0 },
{ TYP_GETREFFLD, 0, 0, FMT_REF_BEGIN, FMT_REF_END },
- // Ablage
+ // DocInformation
{ TYP_DOCINFOFLD, 0, 0, FMT_REG_BEGIN, FMT_REG_END },
- // Datenbank
+ // Database
{ TYP_DBFLD, 0, 0, FMT_DBFLD_BEGIN, FMT_DBFLD_END },
{ TYP_DBNEXTSETFLD, 0, 0, 0, 0 },
{ TYP_DBNUMSETFLD, 0, 0, 0, 0 },
{ TYP_DBSETNUMBERFLD, 0, 0, FMT_NUM_BEGIN, FMT_NUM_END-2 },
{ TYP_DBNAMEFLD, 0, 0, 0, 0 },
- // Variablen
+ // Variables
{ TYP_SETFLD, 0, 0, FMT_SETVAR_BEGIN, FMT_SETVAR_END },
{ TYP_GETFLD, 0, 0, FMT_GETVAR_BEGIN, FMT_GETVAR_END },
@@ -248,7 +245,7 @@ static const SwFldPack __FAR_DATA aSwFlds[] =
};
/*--------------------------------------------------------------------
- Beschreibung: Zugriff auf die Shell
+ Description: access to the shell
--------------------------------------------------------------------*/
static SwWrtShell* lcl_GetShell()
@@ -256,15 +253,14 @@ static SwWrtShell* lcl_GetShell()
SwView* pView;
if ( 0 != (pView = ::GetActiveView()) )
return pView->GetWrtShellPtr();
- DBG_ERROR("no current shell found!");
+ OSL_FAIL("no current shell found!");
return 0;
}
inline sal_uInt16 GetPackCount() { return sizeof(aSwFlds) / sizeof(SwFldPack); }
/*--------------------------------------------------------------------
- Beschreibung: FieldManager regelt das Einfuegen und Updaten
- von Feldern
+ Description: FieldManager controls inserting and updating of fields
--------------------------------------------------------------------*/
SwFldMgr::SwFldMgr(SwWrtShell* pSh ) :
@@ -273,7 +269,7 @@ SwFldMgr::SwFldMgr(SwWrtShell* pSh ) :
pWrtShell(pSh),
bEvalExp(sal_True)
{
- // aktuelles Feld ermitteln falls vorhanden
+ // determine current field if existing
GetCurFld();
}
@@ -283,19 +279,19 @@ SwFldMgr::~SwFldMgr()
}
/*--------------------------------------------------------------------
- Beschreibung: RefMark ueber Namen organisieren
+ Description: organise RefMark by names
--------------------------------------------------------------------*/
sal_Bool SwFldMgr::CanInsertRefMark( const String& rStr )
{
sal_Bool bRet = sal_False;
SwWrtShell *pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
if(pSh)
{
sal_uInt16 nCnt = pSh->GetCrsrCnt();
- // der letzte Crsr muss keine aufgespannte Selektion
+ // the last Crsr doesn't have to be a spanned selection
if( 1 < nCnt && !pSh->SwCrsrShell::HasSelection() )
--nCnt;
@@ -305,13 +301,13 @@ sal_Bool SwFldMgr::CanInsertRefMark( const String& rStr )
}
/*--------------------------------------------------------------------
- Beschreibung: Zugriff ueber ResIds
+ Description: access over ResIds
--------------------------------------------------------------------*/
void SwFldMgr::RemoveFldType(sal_uInt16 nResId, const String& rName )
{
SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
if( pSh )
pSh->RemoveFldType(nResId, rName);
}
@@ -319,7 +315,7 @@ void SwFldMgr::RemoveFldType(sal_uInt16 nResId, const String& rName )
sal_uInt16 SwFldMgr::GetFldTypeCount(sal_uInt16 nResId) const
{
SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
return pSh ? pSh->GetFldTypeCount(nResId) : 0;
}
@@ -327,7 +323,7 @@ sal_uInt16 SwFldMgr::GetFldTypeCount(sal_uInt16 nResId) const
SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, sal_uInt16 nId) const
{
SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
return pSh ? pSh->GetFldType(nId, nResId) : 0;
}
@@ -335,13 +331,13 @@ SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, sal_uInt16 nId) const
SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, const String& rName) const
{
SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
return pSh ? pSh->GetFldType(nResId, rName) : 0;
}
/*--------------------------------------------------------------------
- Beschreibung: Aktuelles Feld ermitteln
+ Description: determine current field
--------------------------------------------------------------------*/
SwField* SwFldMgr::GetCurFld()
{
@@ -351,8 +347,7 @@ SwField* SwFldMgr::GetCurFld()
else
pCurFld = NULL;
- // Strings und Format initialisieren
- //
+ // initialise strings and format
aCurPar1.Erase();
aCurPar2.Erase();
sCurFrame.Erase();
@@ -361,9 +356,8 @@ SwField* SwFldMgr::GetCurFld()
if(!pCurFld)
return 0;
- // Aktuelle Werte aufbereiten Parameter 1 und Parameter 2
- // als auch das Format ermitteln
- //
+ // preprocess current values; determine parameter 1 and parameter 2
+ // as well as the format
const sal_uInt16 nTypeId = pCurFld->GetTypeId();
nCurFmt = pCurFld->GetFormat();
@@ -384,29 +378,29 @@ SwField* SwFldMgr::GetCurFld()
}
/*--------------------------------------------------------------------
- Beschreibung: Gruppen-Bereich liefern
+ Description: provide group range
--------------------------------------------------------------------*/
const SwFldGroupRgn& SwFldMgr::GetGroupRange(sal_Bool bHtmlMode, sal_uInt16 nGrpId) const
{
-static SwFldGroupRgn __READONLY_DATA aRanges[] =
+static SwFldGroupRgn const aRanges[] =
{
- { /* Dokument */ GRP_DOC_BEGIN, GRP_DOC_END },
- { /* Funktionen */ GRP_FKT_BEGIN, GRP_FKT_END },
- { /* Referenzen */ GRP_REF_BEGIN, GRP_REF_END },
- { /* Ablage */ GRP_REG_BEGIN, GRP_REG_END },
- { /* DB */ GRP_DB_BEGIN, GRP_DB_END },
+ { /* Document */ GRP_DOC_BEGIN, GRP_DOC_END },
+ { /* Functions */ GRP_FKT_BEGIN, GRP_FKT_END },
+ { /* Cross-Refs */ GRP_REF_BEGIN, GRP_REF_END },
+ { /* DocInfos */ GRP_REG_BEGIN, GRP_REG_END },
+ { /* Database */ GRP_DB_BEGIN, GRP_DB_END },
{ /* User */ GRP_VAR_BEGIN, GRP_VAR_END }
};
-static SwFldGroupRgn __READONLY_DATA aWebRanges[] =
+static SwFldGroupRgn const aWebRanges[] =
{
- { /* Dokument */ GRP_WEB_DOC_BEGIN, GRP_WEB_DOC_END },
- { /* Funktionen */ GRP_WEB_FKT_BEGIN, GRP_WEB_FKT_END },
- { /* Referenzen */ GRP_WEB_REF_BEGIN, GRP_WEB_REF_END },
- { /* Ablage */ GRP_WEB_REG_BEGIN, GRP_WEB_REG_END },
- { /* DB */ GRP_WEB_DB_BEGIN, GRP_WEB_DB_END },
- { /* User */ GRP_WEB_VAR_BEGIN, GRP_WEB_VAR_END }
+ { /* Document */ GRP_WEB_DOC_BEGIN, GRP_WEB_DOC_END },
+ { /* Functions */ GRP_WEB_FKT_BEGIN, GRP_WEB_FKT_END },
+ { /* Cross-Refs */ GRP_WEB_REF_BEGIN, GRP_WEB_REF_END },
+ { /* DocInfos */ GRP_WEB_REG_BEGIN, GRP_WEB_REG_END },
+ { /* Database */ GRP_WEB_DB_BEGIN, GRP_WEB_DB_END },
+ { /* User */ GRP_WEB_VAR_BEGIN, GRP_WEB_VAR_END }
};
if (bHtmlMode)
@@ -416,7 +410,7 @@ static SwFldGroupRgn __READONLY_DATA aWebRanges[] =
}
/*--------------------------------------------------------------------
- Beschreibung: GroupId bestimmen
+ Description: determine GroupId
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16 nSubType) const
@@ -446,25 +440,25 @@ sal_uInt16 SwFldMgr::GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16
}
/*--------------------------------------------------------------------
- Beschreibung: Namen zur TypeId ermitteln
- ZUGRIFF ueber TYP_....
+ Description: determine names to TypeId
+ ACCESS over TYP_....
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetTypeId(sal_uInt16 nPos)
{
- ASSERT(nPos < ::GetPackCount(), "unzulaessige Pos");
+ OSL_ENSURE(nPos < ::GetPackCount(), "forbidden Pos");
return aSwFlds[ nPos ].nTypeId;
}
const String& SwFldMgr::GetTypeStr(sal_uInt16 nPos)
{
- ASSERT(nPos < ::GetPackCount(), "unzulaessige TypeId");
+ OSL_ENSURE(nPos < ::GetPackCount(), "forbidden TypeId");
sal_uInt16 nFldWh = aSwFlds[ nPos ].nTypeId;
- // Sonderbehandlung fuer Datum/Zeit Felder (ohne var/fix)
+ // special treatment for date/time fields (without var/fix)
if( TYP_DATEFLD == nFldWh )
{
static String g_aDate( SW_RES( STR_DATEFLD ) );
@@ -480,7 +474,7 @@ const String& SwFldMgr::GetTypeStr(sal_uInt16 nPos)
}
/*--------------------------------------------------------------------
- Beschreibung: Pos in der Liste bestimmen
+ Description: determine Pos in the list
--------------------------------------------------------------------*/
@@ -502,14 +496,14 @@ sal_uInt16 SwFldMgr::GetPos(sal_uInt16 nTypeId)
}
/*--------------------------------------------------------------------
- Beschreibung: Subtypen eines Feldes lokalisieren
+ Description: localise subtypes of a field
--------------------------------------------------------------------*/
sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
{
sal_Bool bRet = sal_False;
SwWrtShell *pSh = pWrtShell ? pWrtShell : lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
if(pSh)
{
const sal_uInt16 nPos = GetPos(nTypeId);
@@ -519,7 +513,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
case TYP_SETREFFLD:
case TYP_GETREFFLD:
{
- // Referenzen sind keine Felder
+ // references are no fields
pSh->GetRefMarks( &rToFill );
break;
}
@@ -530,7 +524,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
case TYP_INPUTFLD:
{ String* pNew = new SW_RESSTR(aSwFlds[nPos].nSubTypeStart);
rToFill.Insert(pNew, rToFill.Count());
- // Weiter bei generischen Typen
+ // move on at generic types
}
case TYP_DDEFLD:
case TYP_SEQFLD:
@@ -578,7 +572,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
default:
{
- // statische SubTypes
+ // static SubTypes
if(nPos != USHRT_MAX)
{
sal_uInt16 nCount;
@@ -611,14 +605,14 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
}
/*--------------------------------------------------------------------
- Beschreibung: Format ermitteln
- ZUGRIFF ueber TYP_....
+ Description: determine format
+ ACCESS over TYP_....
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bool bHtmlMode) const
{
- ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+ OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
{
const sal_uInt16 nPos = GetPos(nTypeId);
@@ -633,7 +627,7 @@ sal_uInt16 SwFldMgr::GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bo
return 2;
if (nTypeId == TYP_FILENAMEFLD)
- nEnd -= 2; // Kein Bereich oder Vorlage
+ nEnd -= 2; // no range or template
switch(nStart)
{
@@ -669,14 +663,14 @@ sal_uInt16 SwFldMgr::GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bo
}
/*--------------------------------------------------------------------
- Beschreibung: FormatString zu einem Typ ermitteln
+ Description: determine FormatString to a type
--------------------------------------------------------------------*/
String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
{
String aRet;
- ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+ OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
const sal_uInt16 nPos = GetPos(nTypeId);
@@ -688,7 +682,7 @@ String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
nStart = aSwFlds[nPos].nFmtBegin;
if (TYP_AUTHORFLD == nTypeId|| TYP_FILENAMEFLD == nTypeId)
- nFormatId &= ~FF_FIXED; // Fixed-Flag ausmaskieren
+ nFormatId &= ~FF_FIXED; // mask out Fixed-Flag
if((nStart + nFormatId) < aSwFlds[nPos].nFmtEnd)
aRet = SW_RESSTR((sal_uInt16)(nStart + nFormatId));
@@ -720,7 +714,7 @@ String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
}
/*--------------------------------------------------------------------
- Beschreibung: FormatId aus Pseudo-ID ermitteln
+ Description: determine FormatId from Pseudo-ID
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const
@@ -800,7 +794,7 @@ sal_uInt16 SwFldMgr::GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const
}
/*--------------------------------------------------------------------
- Beschreibung: Traveling
+ Description: Traveling
--------------------------------------------------------------------*/
@@ -821,7 +815,7 @@ sal_Bool SwFldMgr::GoNextPrev( sal_Bool bNext, SwFieldType* pTyp )
if (pTyp && pTyp->Which() == RES_DBFLD)
{
- // Fuer Feldbefehl-bearbeiten (alle DB-Felder anspringen)
+ // for fieldcommand-edit (hop to all DB fields)
return pSh->MoveFldType( 0, bNext, USHRT_MAX, RES_DBFLD );
}
@@ -829,20 +823,20 @@ sal_Bool SwFldMgr::GoNextPrev( sal_Bool bNext, SwFieldType* pTyp )
}
/*--------------------------------------------------------------------
- Beschreibung: Feldtypen einfuegen
+ Description: insert field types
--------------------------------------------------------------------*/
void SwFldMgr::InsertFldType(SwFieldType& rType)
{
SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
if(pSh)
pSh->InsertFldType(rType);
}
/*--------------------------------------------------------------------
- Beschreibung: Aktuelle TypeId ermitteln
+ Description: determine current TypeId
--------------------------------------------------------------------*/
@@ -852,7 +846,7 @@ sal_uInt16 SwFldMgr::GetCurTypeId() const
}
/*--------------------------------------------------------------------
- Beschreibung: Ueber String Feld einfuegen oder Update
+ Description: Over string insert field or update
--------------------------------------------------------------------*/
@@ -868,12 +862,12 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
SwWrtShell* pCurShell = rData.pSh;
if(!pCurShell)
pCurShell = pWrtShell ? pWrtShell : ::lcl_GetShell();
- DBG_ASSERT(pCurShell, "no SwWrtShell found");
+ OSL_ENSURE(pCurShell, "no SwWrtShell found");
if(!pCurShell)
return sal_False;
switch(rData.nTypeId)
- { // ACHTUNG dieses Feld wird ueber einen gesonderten Dialog eingefuegt
+ { // ATTENTION this field is inserted by a seperate dialog
case TYP_POSTITFLD:
{
SwPostItFieldType* pType = (SwPostItFieldType*)pCurShell->GetFldType(0, RES_POSTITFLD);
@@ -1028,8 +1022,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
}
case TYP_DDEFLD:
{
- //JP 28.08.95: DDE-Topics/-Items koennen Blanks in ihren
- // Namen haben! Wird hier noch nicht beachtet.
+ //JP 28.08.95: DDE-Topics/-Items can have blanks in their names!
+ // That's not yet considered here.
String sCmd( rData.sPar2 );
sal_uInt16 nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
@@ -1103,7 +1097,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
pFld = new SwDBField(pTyp);
pFld->SetSubType(nSubType);
- if( !(nSubType & nsSwExtendedSubType::SUB_OWN_FMT) ) // Datenbankformat ermitteln
+ if( !(nSubType & nsSwExtendedSubType::SUB_OWN_FMT) ) // determinee database format
{
Reference< XDataSource> xSource;
rData.aDBDataSource >>= xSource;
@@ -1135,7 +1129,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
String sPar1;
SwDBData aDBData;
- // DBName aus rData.sPar1 extrahieren. Format: DBName.TableName.CommandType.ExpStrg
+ // excract DBName from rData.sPar1. Format: DBName.TableName.CommandType.ExpStrg
if ((nTablePos = rData.sPar1.Search(DB_DELIM)) != STRING_NOTFOUND)
aDBData.sDataSource = rData.sPar1.Copy(0, nTablePos++);
if ((nCmdTypePos = rData.sPar1.Search(DB_DELIM, nTablePos)) != STRING_NOTFOUND)
@@ -1199,7 +1193,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
SwUserFieldType* pTyp =
(SwUserFieldType*)pCurShell->GetFldType(RES_USERFLD, rData.sPar1);
- // nur wenn vorhanden
+ // only if existing
if(!pTyp)
{
pTyp = (SwUserFieldType*)pCurShell->InsertFldType(
@@ -1220,13 +1214,13 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
SwSetExpFieldType* pTyp = (SwSetExpFieldType*)
pCurShell->GetFldType(RES_SETEXPFLD, rData.sPar1);
- // kein Experssion Type mit dem Namen vorhanden -> anlegen
+ // no Experssion Type with this name existing -> create
if(pTyp)
{
SwSetExpField* pExpFld =
new SwSetExpField(pTyp, aEmptyStr, nFormatId);
- // Typ vom SwSetExpFieldType nicht veraendern:
+ // Don't change type of SwSetExpFieldType:
sal_uInt16 nOldSubType = pExpFld->GetSubType();
pExpFld->SetSubType(nOldSubType | (nSubType & 0xff00));
@@ -1248,14 +1242,13 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
pFld = pInpFld;
}
- // Dialog starten
- //
+ // start dialog
pCurShell->StartInputFldDlg(pFld, sal_False, rData.pParent);
break;
}
case TYP_SETFLD:
{
- if (!rData.sPar2.Len()) // Leere Variablen sind nicht erlaubt
+ if (!rData.sPar2.Len()) // empty variables are not allowed
return sal_False;
SwSetExpFieldType* pTyp = (SwSetExpFieldType*)pCurShell->InsertFldType(
@@ -1288,7 +1281,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
}
case TYP_GETFLD:
{
- // gibt es ein entprechendes SetField
+ // is there a corresponding SetField
SwSetExpFieldType* pSetTyp = (SwSetExpFieldType*)
pCurShell->GetFldType(RES_SETEXPFLD, rData.sPar1);
@@ -1335,11 +1328,6 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
pCurShell->EndAllAction();
return sal_True;
-/* // In der Tabelle Tabellenformeln einfuegen
- SwTblFieldType* pTyp = (SwTblFieldType*)pCurShell->GetFldType(
- 0, RES_TABLEFLD);
- pFld = new SwTblField(pTyp, rData.sPar2, nsSwGetSetExpType::GSE_EXPR, nFormatId);
- bTbl = sal_True;*/
}
else
{
@@ -1376,11 +1364,11 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
}
break;
default:
- { ASSERT(!this, "Falscher Feldtyp");
+ { OSL_ENSURE(!this, "wrong field type");
return sal_False;
}
}
- ASSERT(pFld, "Feld nicht vorhanden");
+ OSL_ENSURE(pFld, "field not available");
//the auto language flag has to be set prior to the language!
@@ -1388,7 +1376,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
sal_uInt16 nLang = GetCurrLanguage();
pFld->SetLanguage(nLang);
- // Einfuegen
+ // insert
pCurShell->StartAllAction();
pCurShell->Insert(*pFld);
@@ -1407,7 +1395,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
else if( TYP_GETREFFLD == rData.nTypeId )
pFld->GetTyp()->ModifyNotification( 0, 0 );
- // temporaeres Feld loeschen
+ // delete temporary field
delete pFld;
pCurShell->EndAllAction();
@@ -1415,7 +1403,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
}
/*--------------------------------------------------------------------
- Beschreibung: Felder Update
+ Description: fields update
--------------------------------------------------------------------*/
@@ -1424,8 +1412,8 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
const String& rPar2,
SwField * _pTmpFld) // #111840#
{
- // Format aendern
- ASSERT(pCurFld, "kein Feld an der CursorPos");
+ // change format
+ OSL_ENSURE(pCurFld, "no field at CursorPos");
bool bDelete = false;
SwField *pTmpFld; // mb: fixed memory leak
@@ -1443,7 +1431,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
const sal_uInt16 nTypeId = pTmpFld->GetTypeId();
SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell();
- DBG_ASSERT(pSh, "no SwWrtShell found");
+ OSL_ENSURE(pSh, "no SwWrtShell found");
if(!pSh)
return;
pSh->StartAllAction();
@@ -1458,8 +1446,8 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
{
case TYP_DDEFLD:
{
- //JP 28.08.95: DDE-Topics/-Items koennen Blanks in ihren
- // Namen haben! Wird hier noch nicht beachtet.
+ // DDE-Topics/-Items can have blanks in their names!
+ // That's not yet considered here!
sal_uInt16 nTmpPos = sPar2.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sPar2.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
break;
@@ -1563,8 +1551,8 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
break;
}
- // Format setzen
- // Format wegen NumberFormatter vor SetPar2 einstellen!
+ // set format
+ // setup format before SetPar2 because of NumberFormatter!
pTmpFld->ChangeFormat(nFormat);
if(bSetPar1)
@@ -1572,7 +1560,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
if( bSetPar2 )
pTmpFld->SetPar2( sPar2 );
- // Update anschmeissen
+ // kick off update
if(nTypeId == TYP_DDEFLD ||
nTypeId == TYP_USERFLD ||
nTypeId == TYP_USRINPFLD)
@@ -1593,7 +1581,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
}
/*--------------------------------------------------------------------
- Beschreibung: ExpressionFields explizit evaluieren
+ Description: explicitly evaluate ExpressionFields
--------------------------------------------------------------------*/
void SwFldMgr::EvalExpFlds(SwWrtShell* pSh)
{
@@ -1619,7 +1607,7 @@ void SwFieldType::_GetFldName()
{
static const sal_uInt16 coFldCnt = STR_TYPE_END - STR_TYPE_BEGIN;
- static sal_uInt16 __READONLY_DATA coFldNms[ coFldCnt ] = {
+ static sal_uInt16 coFldNms[ coFldCnt ] = {
FLD_DATE_STD,
FLD_TIME_STD,
STR_FILENAMEFLD,
@@ -1665,7 +1653,7 @@ void SwFieldType::_GetFldName()
STR_DROPDOWN
};
- // Infos fuer Felder einfuegen
+ // insert infos for fields
SwFieldType::pFldNames = new SvStringsDtor( (sal_uInt8)coFldCnt, 2 );
for( sal_uInt16 nIdx = 0; nIdx < coFldCnt; ++nIdx )
{
@@ -1675,10 +1663,6 @@ void SwFieldType::_GetFldName()
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwFldMgr::ChooseMacro(const String&)
{
sal_Bool bRet = sal_False;
@@ -1709,8 +1693,8 @@ void SwFldMgr::SetMacroPath(const String& rPath)
Reference< uri::XUriReferenceFactory >
xFactory( xSMgr->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uri.UriReferenceFactory" )) ), UNO_QUERY );
if ( xFactory.is() )
{
@@ -1724,10 +1708,6 @@ void SwFldMgr::SetMacroPath(const String& rPath)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNumberFormatter* pFormatter, double* pVal)
{
double fValue;
@@ -1774,20 +1754,19 @@ sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNum
return pFormatter->GetStandardFormat(nDefFormat, GetCurrLanguage());
}
-/* -----------------------------01.03.01 16:46--------------------------------
-
- ---------------------------------------------------------------------------*/
Reference<XNumberingTypeInfo> SwFldMgr::GetNumberingInfo() const
{
if(!xNumberingInfo.is())
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
Reference < XInterface > xI = xMSF->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.text.DefaultNumberingProvider" ));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.text.DefaultNumberingProvider" )));
Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY);
- DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
+ OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
((SwFldMgr*)this)->xNumberingInfo = Reference<XNumberingTypeInfo>(xDefNum, UNO_QUERY);
}
return xNumberingInfo;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 26882f1d8325..fae0ba371ec5 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,10 +58,6 @@
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
const SfxItemSet &rAttrSet )
:SfxTabPage (pParent, rId, rAttrSet),
@@ -75,19 +72,15 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
m_bRefresh (sal_False),
m_bFirstHTMLInit (sal_True)
{
-// FreeResource();
-}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+}
SwFldPage::~SwFldPage()
{
}
/*--------------------------------------------------------------------
- Beschreibung: TabPage initialisieren
+ Description: initialise TabPage
--------------------------------------------------------------------*/
void SwFldPage::Init()
@@ -97,15 +90,15 @@ void SwFldPage::Init()
m_bFldEdit = 0 == GetTabDialog();
- // FieldManager neu initialisieren wichtig fuer
- // Dok-Wechsel (fldtdlg:ReInitTabPage)
+ // newly initialise FieldManager. important for
+ // Dok-Switch (fldtdlg:ReInitTabPage)
m_pCurFld = m_aMgr.GetCurFld();
if( bNewMode != m_bFldDlgHtmlMode )
{
m_bFldDlgHtmlMode = bNewMode;
- // Bereichslistbox initialisieren
+ // initialise Rangelistbox
if( m_bFldDlgHtmlMode && m_bFirstHTMLInit )
{
m_bFirstHTMLInit = sal_False;
@@ -125,7 +118,7 @@ void SwFldPage::Init()
}
/*--------------------------------------------------------------------
- Beschreibung: Seite neu initialisieren
+ Description: newly initialise page
--------------------------------------------------------------------*/
void SwFldPage::ActivatePage()
@@ -134,7 +127,7 @@ void SwFldPage::ActivatePage()
}
/*--------------------------------------------------------------------
- Beschreibung: Kompletter Reset; neues Feld editieren
+ Description: complete reset; edit new field
--------------------------------------------------------------------*/
void SwFldPage::EditNewField( sal_Bool bOnlyActivate )
@@ -150,7 +143,7 @@ void SwFldPage::EditNewField( sal_Bool bOnlyActivate )
}
/*--------------------------------------------------------------------
- Beschreibung: Feld einfuegen
+ Description: insert field
--------------------------------------------------------------------*/
sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const String& rPar1,
@@ -161,7 +154,7 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
SwView* pView = GetActiveView();
SwWrtShell *pSh = m_pWrtShell ? m_pWrtShell : pView->GetWrtShellPtr();
- if (!IsFldEdit()) // Neues Feld einfuegen
+ if (!IsFldEdit()) // insert new field
{
SwInsertFld_Data aData(nTypeId, nSubType, rPar1, rPar2, nFormatId, 0, cSeparator, bIsAutomaticLanguage );
//#i26566# provide parent for SwWrtShell::StartInputFldDlg
@@ -205,13 +198,12 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
}
}
- else // Feld aendern
+ else // change field
{
SwField *const pTmpFld = m_pCurFld->CopyField();
String sPar1(rPar1);
String sPar2(rPar2);
- sal_Bool bDBChanged = sal_False;
switch( nTypeId )
{
case TYP_DATEFLD:
@@ -234,7 +226,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
sPar1 = rPar1.Copy(nPos);
((SwDBNameInfField*)pTmpFld)->SetDBData(aData);
- bDBChanged = sal_True;
}
break;
@@ -261,7 +252,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
break;
}
}
- bDBChanged = sal_True;
}
break;
@@ -277,7 +267,7 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
case TYP_INPUTFLD:
{
- // User- oder SetField ?
+ // User- or SetField ?
if (m_aMgr.GetFldType(RES_USERFLD, sPar1) == 0 &&
!(pTmpFld->GetSubType() & INP_TXT)) // SETEXPFLD
{
@@ -322,10 +312,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2,
const ListBox* pLst3 )
{
@@ -339,10 +325,6 @@ void SwFldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2,
m_aLstStrArr[ i ].Erase();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3)
{
sal_uInt16 nPos = 0;
@@ -356,7 +338,7 @@ void SwFldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3)
}
/*--------------------------------------------------------------------
- Beschreibung: Einfuegen von neuen Feldern
+ Description: Insert new fields
--------------------------------------------------------------------*/
IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn )
@@ -368,7 +350,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn )
pDlg->InsertHdl();
if (pBtn)
- pBtn->GrabFocus(); // Wegen InputField-Dlg
+ pBtn->GrabFocus(); // because of InputField-Dlg
}
else
{
@@ -380,7 +362,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn )
}
/*--------------------------------------------------------------------
- Beschreibung: "Einfuegen"-Button Enablen/Disablen
+ Description: enable/disable "Insert"-Button
--------------------------------------------------------------------*/
void SwFldPage::EnableInsert(sal_Bool bEnable)
@@ -401,10 +383,6 @@ void SwFldPage::EnableInsert(sal_Bool bEnable)
m_bInsert = bEnable;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldPage, NumFormatHdl, ListBox *, EMPTYARG )
{
InsertHdl();
@@ -417,3 +395,5 @@ void SwFldPage::SetWrtShell( SwWrtShell* pShell )
m_pWrtShell = pShell;
m_aMgr.SetWrtShell( pShell );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx
index 00517a154efa..40c4ef60ae75 100644
--- a/sw/source/ui/fldui/fldpage.hxx
+++ b/sw/source/ui/fldui/fldpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,6 @@
class ListBox;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
const int coLBCount = 3;
class SwFldPage : public SfxTabPage
@@ -76,7 +73,7 @@ protected:
void EnableInsert(sal_Bool bEnable = sal_True);
inline sal_Bool IsFldEdit() const { return m_bFldEdit; }
- // Feld einfuegen
+ // insert field
sal_Bool InsertFld( sal_uInt16 nTypeId,
sal_uInt16 nSubType,
const String& rPar1,
@@ -105,3 +102,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 7ef5b58e9b8b..58361e34c2a8 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,26 +40,17 @@
#include <IMark.hxx>
#include <expfld.hxx>
#include <swmodule.hxx>
-#ifndef _FLDREF_HXX
#include <fldref.hxx>
-#endif
#include <reffld.hxx>
#include <wrtsh.hxx>
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-// --> OD 2007-11-14 #i83479#
+// #i83479#
#include <SwNodeNum.hxx>
#include <IDocumentMarkAccess.hxx>
#include <ndtxt.hxx>
-// <--
// sw/inc/expfld.hxx
SV_IMPL_PTRARR( _SwSeqFldList, _SeqFldLstElem* )
@@ -67,21 +59,15 @@ SV_IMPL_PTRARR( _SwSeqFldList, _SeqFldLstElem* )
#define REFFLDFLAG_BOOKMARK 0x4800
#define REFFLDFLAG_FOOTNOTE 0x5000
#define REFFLDFLAG_ENDNOTE 0x6000
-// --> OD 2007-11-09 #i83479#
+// #i83479#
#define REFFLDFLAG_HEADING 0x7100
#define REFFLDFLAG_NUMITEM 0x7200
-// <--
sal_uInt16 nFldDlgFmtSel = 0;
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
SwFldPage( pParent, SW_RES( TP_FLD_REF ), rCoreSet ),
@@ -89,9 +75,8 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aTypeLB (this, SW_RES(LB_REFTYPE)),
aSelectionFT (this, SW_RES(FT_REFSELECTION)),
aSelectionLB (this, SW_RES(LB_REFSELECTION)),
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB( this, SW_RES(LB_REFSELECTION_TOOLTIP) ),
- // <--
aFormatFT (this, SW_RES(FT_REFFORMAT)),
aFormatLB (this, SW_RES(LB_REFFORMAT)),
aNameFT (this, SW_RES(FT_REFNAME)),
@@ -102,14 +87,13 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
sBookmarkTxt (SW_RES(STR_REFBOOKMARK)),
sFootnoteTxt (SW_RES(STR_REFFOOTNOTE)),
sEndnoteTxt (SW_RES(STR_REFENDNOTE)),
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
sHeadingTxt (SW_RES(STR_REFHEADING)),
sNumItemTxt (SW_RES(STR_REFNUMITEM)),
maOutlineNodes(),
maNumItems(),
mpSavedSelectedTxtNode( 0 ),
mnSavedSelectedPos( 0 )
- // <--
{
FreeResource();
@@ -121,24 +105,19 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aSelectionLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl));
aFormatLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl));
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) );
aSelectionToolTipLB.SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) );
aSelectionToolTipLB.SetStyle( aSelectionToolTipLB.GetStyle() | WB_HSCROLL );
aSelectionToolTipLB.SetSpaceBetweenEntries(1);
aSelectionToolTipLB.SetHighlightRange();
- // <--
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldRefPage::~SwFldRefPage()
{
}
-// --> OD 2007-11-22 #i83479#
+// #i83479#
void SwFldRefPage::SaveSelectedTxtNode()
{
mpSavedSelectedTxtNode = 0;
@@ -184,33 +163,27 @@ sal_uInt16 SwFldRefPage::GetSavedSelectedPos() const
return mnSavedSelectedPos;
}
-// <--
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwFldRefPage::Reset(const SfxItemSet& )
{
if (!IsFldEdit())
{
SavePos(&aTypeLB);
- // --> OD 2007-11-22 #i83479#
+ // #i83479#
SaveSelectedTxtNode();
- // <--
}
SetSelectionSel(LISTBOX_ENTRY_NOTFOUND);
SetTypeSel(LISTBOX_ENTRY_NOTFOUND);
- Init(); // Allgemeine initialisierung
+ Init(); // general initialisation
- // TypeListBox initialisieren
+ // initialise TypeListBox
aTypeLB.SetUpdateMode(sal_False);
aTypeLB.Clear();
- // Typ-Listbox fuellen
+ // fill Type-Listbox
sal_uInt16 nPos;
- // Referenz setzen / einfuegen
+ // set/insert reference
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
for (short i = rRg.nStart; i < rRg.nEnd; ++i)
@@ -224,15 +197,14 @@ void SwFldRefPage::Reset(const SfxItemSet& )
}
}
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
// entries for headings and numbered items
nPos = aTypeLB.InsertEntry(sHeadingTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_HEADING);
nPos = aTypeLB.InsertEntry(sNumItemTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM);
- // <--
- // mit den Sequence-Typen auffuellen
+ // fill up with the sequence types
SwWrtShell *pSh = GetWrtShell();
if(!pSh)
pSh = ::GetActiveWrtShell();
@@ -246,29 +218,29 @@ void SwFldRefPage::Reset(const SfxItemSet& )
if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType))
{
nPos = aTypeLB.InsertEntry(pType->GetName());
- aTypeLB.SetEntryData(nPos, (void*)(REFFLDFLAG | n));
+ aTypeLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n));
}
}
- // Textmarken - jetzt immer (wegen Globaldokumenten)
+ // text marks - now always (because of globaldocuments)
nPos = aTypeLB.InsertEntry(sBookmarkTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_BOOKMARK);
- // Fussnoten:
+ // footnotes:
if( pSh->HasFtns() )
{
nPos = aTypeLB.InsertEntry(sFootnoteTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_FOOTNOTE);
}
- // Endnoten:
+ // endnotes:
if ( pSh->HasFtns(true) )
{
nPos = aTypeLB.InsertEntry(sEndnoteTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_ENDNOTE);
}
- // alte Pos selektieren
+ // select old Pos
if (!IsFldEdit())
RestorePos(&aTypeLB);
@@ -307,23 +279,19 @@ void SwFldRefPage::Reset(const SfxItemSet& )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
- // Aktuelle ListBoxPos
+ // current ListBoxPos
SetTypeSel(aTypeLB.GetSelectEntryPos());
if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
{
if (IsFldEdit())
{
- // Positionen selektieren
+ // select positions
String sName;
sal_uInt16 nFlag = 0;
@@ -331,9 +299,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
case REF_BOOKMARK:
{
- // --> OD 2007-11-14 #i83479#
-// sName = sBookmarkTxt;
-// nFlag = REFFLDFLAG_BOOKMARK;
+ // #i83479#
SwGetRefField* pRefFld = dynamic_cast<SwGetRefField*>(GetCurField());
if ( pRefFld &&
pRefFld->IsRefToHeadingCrossRefBookmark() )
@@ -352,7 +318,6 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
sName = sBookmarkTxt;
nFlag = REFFLDFLAG_BOOKMARK;
}
- // <--
}
break;
@@ -377,7 +342,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
break;
}
- if (aTypeLB.GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND) // Referenz zu gel?schter Marke
+ if (aTypeLB.GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND) // reference to deleted mark
{
sal_uInt16 nPos = aTypeLB.InsertEntry(sName);
aTypeLB.SetEntryData(nPos, reinterpret_cast<void*>(nFlag));
@@ -397,7 +362,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // Auswahl-Listbox fuellen
+ // fill selection-ListBox
UpdateSubType();
sal_Bool bName = sal_False; nFldDlgFmtSel = 0;
@@ -413,7 +378,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
case TYP_GETREFFLD:
if (REFFLDFLAG & (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(nOld))
- // dann bleibt die alte bestehen
+ // the the old one stays
nFldDlgFmtSel = aFormatLB.GetSelectEntryPos();
bName = sal_True;
break;
@@ -424,13 +389,13 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
case REFFLDFLAG_BOOKMARK:
bName = sal_True;
- // kein break!!!
+ // no break!!!
default:
if( REFFLDFLAG & nTypeId )
{
sal_uInt16 nOldId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(nOld);
if( nOldId & REFFLDFLAG || nOldId == TYP_GETREFFLD )
- // dann bleibt die alte bestehen
+ // then the old one stays
nFldDlgFmtSel = aFormatLB.GetSelectEntryPos();
}
break;
@@ -439,7 +404,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
aNameED.Enable(bName);
aNameFT.Enable(bName);
- // Format-Listbox fuellen
+ // fill Format-Listbox
sal_uInt16 nSize = FillFormatLB(nTypeId);
sal_Bool bFormat = nSize != 0;
aFormatLB.Enable(bFormat);
@@ -452,10 +417,6 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -482,7 +443,7 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
break;
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
case REFFLDFLAG_HEADING:
case REFFLDFLAG_NUMITEM:
{
@@ -493,7 +454,6 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
}
break;
- // <--
default:
if (!IsFldEdit() || aSelectionLB.GetSelectEntryCount())
@@ -505,7 +465,7 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: Typen in SelectionLB erneuern
+ Description: renew types in SelectionLB
--------------------------------------------------------------------*/
void SwFldRefPage::UpdateSubType()
@@ -517,7 +477,7 @@ void SwFldRefPage::UpdateSubType()
const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
String sOldSel;
- // --> OD 2007-11-22 #i83479#
+ // #i83479#
if ( aSelectionLB.IsVisible() )
{
const sal_uInt16 nSelectionSel = aSelectionLB.GetSelectEntryPos();
@@ -526,24 +486,22 @@ void SwFldRefPage::UpdateSubType()
sOldSel = aSelectionLB.GetEntry(nSelectionSel);
}
}
- // <--
if (IsFldEdit() && !sOldSel.Len())
sOldSel = String::CreateFromInt32( pRefFld->GetSeqNo() + 1 );
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.SetUpdateMode(sal_False);
aSelectionToolTipLB.Clear();
bool bShowSelectionToolTipLB( false );
- // <--
if( REFFLDFLAG & nTypeId )
{
- if (nTypeId == REFFLDFLAG_BOOKMARK) // TextMarken!
+ if (nTypeId == REFFLDFLAG_BOOKMARK) // text marks!
{
aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_SORT);
- // alle Textmarken besorgen
+ // get all text marks
IDocumentMarkAccess* const pMarkAccess = pSh->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
ppMark != pMarkAccess->getBookmarksEnd();
@@ -582,7 +540,7 @@ void SwFldRefPage::UpdateSubType()
sOldSel = aArr[n]->sDlgEntry;
}
}
- // --> OD 2007-11-14 #i83479#
+ // #i83479#
else if ( nTypeId == REFFLDFLAG_HEADING )
{
bShowSelectionToolTipLB = true;
@@ -643,11 +601,10 @@ void SwFldRefPage::UpdateSubType()
}
}
}
- // <--
else
{
aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_SORT);
- // zum Seq-FeldTyp die Felder besorgen:
+ // get the fields to Seq-FieldType:
SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(
nTypeId & ~REFFLDFLAG, RES_SETEXPFLD );
@@ -683,7 +640,7 @@ void SwFldRefPage::UpdateSubType()
sOldSel = pRefFld->GetSetRefName();
}
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.Show( bShowSelectionToolTipLB );
aSelectionLB.Show( !bShowSelectionToolTipLB );
if ( bShowSelectionToolTipLB )
@@ -708,7 +665,7 @@ void SwFldRefPage::UpdateSubType()
{
aSelectionLB.SetUpdateMode(sal_True);
- // Enable oder Disable
+ // enable or disable
sal_Bool bEnable = aSelectionLB.GetEntryCount() != 0;
aSelectionLB.Enable( bEnable );
aSelectionFT.Enable( bEnable );
@@ -720,16 +677,11 @@ void SwFldRefPage::UpdateSubType()
aSelectionLB.SelectEntryPos(0);
}
- if (IsFldEdit() && !aSelectionLB.GetSelectEntryCount()) // Falls die Referenz schon geloescht wurde...
+ if (IsFldEdit() && !aSelectionLB.GetSelectEntryCount()) // in case the reference was already deleted...
aNameED.SetText(sOldSel);
}
- // <--
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
{
String sOldSel;
@@ -738,20 +690,19 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
if (nFormatSel != LISTBOX_ENTRY_NOTFOUND)
sOldSel = aFormatLB.GetEntry(nFormatSel);
- // Format-Listbox fuellen
+ // fill Format-Listbox
aFormatLB.Clear();
- // Referenz hat weniger als die Beschriftung
+ // refernce has less that the annotation
sal_uInt16 nSize( 0 );
bool bAddCrossRefFormats( false );
switch (nTypeId)
{
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
case REFFLDFLAG_HEADING:
case REFFLDFLAG_NUMITEM:
bAddCrossRefFormats = true;
// intentional no break here
- // <--
case TYP_GETREFFLD:
case REFFLDFLAG_BOOKMARK:
@@ -761,10 +712,8 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
break;
default:
- // --> OD 2007-11-16 #i83479#
-// nSize = GetFldMgr().GetFormatCount( (REFFLDFLAG & nTypeId)
-// ? (sal_uInt16)TYP_GETREFFLD : nTypeId,
-// sal_False, IsFldDlgHtmlMode() );
+ // #i83479#
+
if ( REFFLDFLAG & nTypeId )
{
nSize = FMT_REF_ONLYSEQNO - FMT_REF_BEGIN + 1;
@@ -784,7 +733,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
sal_uInt16 nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i ));
aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i )));
}
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
if ( bAddCrossRefFormats )
{
sal_uInt16 nFormat = FMT_REF_NUMBER - FMT_REF_BEGIN;
@@ -798,7 +747,6 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat )));
nSize += 3;
}
- // <--
// select a certain entry
if (nSize)
@@ -820,7 +768,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
}
/*--------------------------------------------------------------------
- Beschreibung: Modify
+ Description: Modify
--------------------------------------------------------------------*/
IMPL_LINK( SwFldRefPage, ModifyHdl, Edit *, EMPTYARG )
@@ -843,10 +791,6 @@ IMPL_LINK( SwFldRefPage, ModifyHdl, Edit *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
{
sal_Bool bModified = sal_False;
@@ -868,7 +812,6 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
switch(nTypeId)
{
case TYP_GETREFFLD:
- // aName = aSelectionLB.GetSelectEntry();
nSubType = REF_SETREFATTR;
break;
@@ -876,7 +819,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
{
SwFieldType* pType = GetFldMgr().GetFldType(RES_SETEXPFLD, aName);
- if(!pType) // Nur einfuegen, wenn es den Namen noch nicht gibt
+ if(!pType) // Only insert when the name doesn't exist yet
{
aSelectionLB.InsertEntry(aName);
aSelectionLB.Enable();
@@ -895,13 +838,13 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
{
pSh = ::GetActiveWrtShell();
}
- if (nTypeId == REFFLDFLAG_BOOKMARK) // TextMarken!
+ if (nTypeId == REFFLDFLAG_BOOKMARK) // text marks!
{
aName = aNameED.GetText();
nTypeId = TYP_GETREFFLD;
nSubType = REF_BOOKMARK;
}
- else if (REFFLDFLAG_FOOTNOTE == nTypeId) // Fussnoten
+ else if (REFFLDFLAG_FOOTNOTE == nTypeId) // footnotes
{
SwSeqFldList aArr;
_SeqFldLstElem aElem( aSelectionLB.GetSelectEntry(), 0 );
@@ -917,12 +860,12 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
aVal = String::CreateFromInt32( aArr[nPos]->nSeqNo );
if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
- bModified = sal_True; // Kann bei Feldern passieren, deren Referenz geloescht wurde
+ bModified = sal_True; // can happen with fields of which the references were deleted
}
else if (IsFldEdit())
aVal = String::CreateFromInt32( pRefFld->GetSeqNo() );
}
- else if (REFFLDFLAG_ENDNOTE == nTypeId) // Endnoten
+ else if (REFFLDFLAG_ENDNOTE == nTypeId) // endnotes
{
SwSeqFldList aArr;
_SeqFldLstElem aElem( aSelectionLB.GetSelectEntry(), 0 );
@@ -938,16 +881,16 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
aVal = String::CreateFromInt32( aArr[nPos]->nSeqNo );
if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
- bModified = sal_True; // Kann bei Feldern passieren, deren Referenz geloescht wurde
+ bModified = sal_True; // can happen with fields of which the reference was deleted
}
else if (IsFldEdit())
aVal = String::CreateFromInt32( pRefFld->GetSeqNo() );
}
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
else if ( nTypeId == REFFLDFLAG_HEADING )
{
SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
- ASSERT( pEntry,
+ OSL_ENSURE( pEntry,
"<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
if ( pEntry )
{
@@ -967,7 +910,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
else if ( nTypeId == REFFLDFLAG_NUMITEM )
{
SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
- ASSERT( pEntry,
+ OSL_ENSURE( pEntry,
"<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
if ( pEntry )
{
@@ -984,10 +927,9 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
}
}
}
- // <--
- else // SeqenceFelder
+ else // SeqenceFields
{
- // zum Seq-FeldTyp die Felder besorgen:
+ // get fields for Seq-FeldType:
SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(
nTypeId & ~REFFLDFLAG, RES_SETEXPFLD );
if( pType )
@@ -1006,7 +948,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
aVal = String::CreateFromInt32( aArr[nPos]->nSeqNo );
if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
- bModified = sal_True; // Kann bei Feldern passieren, deren Referenz geloescht wurde
+ bModified = sal_True; // can happen with fields of which the reference was deleted
}
else if (IsFldEdit())
aVal = String::CreateFromInt32( pRefFld->GetSeqNo() );
@@ -1030,33 +972,22 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
InsertFld( nTypeId, nSubType, aName, aVal, nFormat );
}
- ModifyHdl(); // Insert ggf enablen/disablen
+ ModifyHdl(); // enable/disable insert if applicable
return sal_False;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxTabPage* SwFldRefPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldRefPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldRefPage::GetGroup()
{
return GRP_REF;
}
-/* -----------------12.01.99 10:09-------------------
- *
- * --------------------------------------------------*/
void SwFldRefPage::FillUserData()
{
String sData( String::CreateFromAscii(
@@ -1071,3 +1002,4 @@ void SwFldRefPage::FillUserData()
SetUserData(sData);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx
index e65e05b19d2f..9268e0a96561 100644
--- a/sw/source/ui/fldui/fldref.hxx
+++ b/sw/source/ui/fldui/fldref.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,23 +31,16 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include <vcl/edit.hxx>
#include "fldpage.hxx"
-// --> OD 2007-11-15 #i83479#
+// #i83479#
#include <IDocumentOutlineNodes.hxx>
#include <IDocumentListItems.hxx>
#include <FldRefTreeListBox.hxx>
class SwTxtNode;
-// <--
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SwFldRefPage : public SwFldPage
{
@@ -54,9 +48,8 @@ class SwFldRefPage : public SwFldPage
ListBox aTypeLB;
FixedText aSelectionFT;
ListBox aSelectionLB;
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
SwFldRefTreeListBox aSelectionToolTipLB;
- // <--
FixedText aFormatFT;
ListBox aFormatLB;
FixedText aNameFT;
@@ -66,7 +59,7 @@ class SwFldRefPage : public SwFldPage
const String sBookmarkTxt;
const String sFootnoteTxt;
const String sEndnoteTxt;
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
const String sHeadingTxt;
const String sNumItemTxt;
@@ -78,7 +71,6 @@ class SwFldRefPage : public SwFldPage
const SwTxtNode* mpSavedSelectedTxtNode;
// fallback, if previously selected text node doesn't exist anymore
sal_uInt16 mnSavedSelectedPos;
- // <--
DECL_LINK( TypeHdl, ListBox* pLB = 0 );
DECL_LINK( SubTypeHdl, ListBox* pLB = 0 );
@@ -87,11 +79,10 @@ class SwFldRefPage : public SwFldPage
void UpdateSubType();
sal_uInt16 FillFormatLB(sal_uInt16 nTypeId);
- // --> OD 2007-12-05 #i83479#
+ // #i83479#
void SaveSelectedTxtNode();
const SwTxtNode* GetSavedSelectedTxtNode() const;
sal_uInt16 GetSavedSelectedPos() const;
- // <--
protected:
virtual sal_uInt16 GetGroup();
@@ -112,3 +103,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 9efc63519459..2c97dedcee18 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <swtypes.hxx>
#include <unotools/confignode.hxx>
#include <comphelper/processfactory.hxx>
@@ -68,7 +67,7 @@
/*--------------------------------------------------------------------
- Beschreibung: Der Traeger des Dialoges
+ Description: carrier of the dialog
--------------------------------------------------------------------*/
@@ -85,11 +84,11 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent)
GetOKButton().SetText(String(SW_RES(STR_FLD_INSERT)));
GetOKButton().SetHelpId(HID_FIELD_INSERT);
- GetOKButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird
+ GetOKButton().SetHelpText(aEmptyStr); // so that generated help text is used
GetCancelButton().SetText(String(SW_RES(STR_FLD_CLOSE)));
GetCancelButton().SetHelpId(HID_FIELD_CLOSE);
- GetCancelButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird
+ GetCancelButton().SetHelpText(aEmptyStr); // so that generated help text is used
FreeResource();
@@ -130,18 +129,10 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldDlg::~SwFldDlg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwFldDlg::Close()
{
m_pBindings->GetDispatcher()->
@@ -150,10 +141,6 @@ sal_Bool SwFldDlg::Close()
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
{
Point aPos;
@@ -165,16 +152,16 @@ void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
if ( GetStyle() & WB_SIZEABLE )
SetSizePixel( pInfo->aSize );
- // Initiale Gr"o\se aus pInfo merken
+ // remember initial size from pInfo
aSize = GetSizePixel();
- // Soll das FloatingWindow eingezoomt werden ?
+ // should the FloatingWindow get zoomed?
if ( pInfo->nFlags & SFX_CHILDWIN_ZOOMIN )
RollUp();
}
else
{
- // Initiale Gr"o\se aus Resource oder ctor merken
+ // remember initial size from resource or ctor
aSize = GetSizePixel();
Size aParentSize = GetParent()->GetOutputSizePixel();
@@ -200,10 +187,6 @@ void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
SetPosPixel( aPos );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxItemSet* SwFldDlg::CreateInputItemSet( sal_uInt16 nID )
{
if ( nID == TP_FLD_DOKINF )
@@ -226,7 +209,7 @@ SfxItemSet* SwFldDlg::CreateInputItemSet( sal_uInt16 nID )
}
/*--------------------------------------------------------------------
- Beschreibung: Einfuegen von neuen Feldern anstossen
+ Description: kick off inserting of new fields
--------------------------------------------------------------------*/
IMPL_LINK( SwFldDlg, OKHdl, Button *, EMPTYARG )
@@ -236,14 +219,14 @@ IMPL_LINK( SwFldDlg, OKHdl, Button *, EMPTYARG )
SfxTabPage* pPage = GetTabPage(GetCurPageId());
pPage->FillItemSet(*(SfxItemSet*)0);
- GetOKButton().GrabFocus(); // Wegen InputField-Dlg
+ GetOKButton().GrabFocus(); // because of InputField-Dlg
}
return 0;
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren
+ Description: newly initialise dialog after Doc-Switch
--------------------------------------------------------------------*/
void SwFldDlg::ReInitDlg()
@@ -280,7 +263,7 @@ void SwFldDlg::ReInitDlg()
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel TabPage neu initialisieren
+ Description: newly initialise TabPage after Doc-Switch
--------------------------------------------------------------------*/
void SwFldDlg::ReInitTabPage( sal_uInt16 nPageId, sal_Bool bOnlyActivate )
@@ -288,11 +271,11 @@ void SwFldDlg::ReInitTabPage( sal_uInt16 nPageId, sal_Bool bOnlyActivate )
SwFldPage* pPage = (SwFldPage* )GetTabPage(nPageId);
if ( pPage )
- pPage->EditNewField( bOnlyActivate ); // TabPage neu initialisieren
+ pPage->EditNewField( bOnlyActivate ); // newly initialise TabPage
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Aktivierung einige TabPages neu initialisieren
+ Description: newly initialise after activation of a few TabPages
--------------------------------------------------------------------*/
void SwFldDlg::Activate()
@@ -315,16 +298,12 @@ void SwFldDlg::Activate()
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldDlg::EnableInsert(sal_Bool bEnable)
{
if( bEnable )
{
SwView* pView = ::GetActiveView();
- DBG_ASSERT(pView, "no view found");
+ OSL_ENSURE(pView, "no view found");
if( !pView ||
(pView->GetWrtShell().IsReadOnlyAvailable() &&
pView->GetWrtShell().HasReadonlySel()) )
@@ -333,17 +312,11 @@ void SwFldDlg::EnableInsert(sal_Bool bEnable)
GetOKButton().Enable(bEnable);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldDlg::InsertHdl()
{
GetOKButton().Click();
}
-/* -----------------27.11.2002 15:24-----------------
- *
- * --------------------------------------------------*/
+
void SwFldDlg::ActivateDatabasePage()
{
m_bDataBaseMode = sal_True;
@@ -360,9 +333,7 @@ void SwFldDlg::ActivateDatabasePage()
RemoveTabPage(TP_FLD_REF);
RemoveTabPage(TP_FLD_FUNC);
}
-/*-- 07.10.2003 14:01:44---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
{
if( TP_FLD_DB == nId)
@@ -384,3 +355,4 @@ void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldtdlg.hrc b/sw/source/ui/fldui/fldtdlg.hrc
index 221b943779c0..ef66b16d6f7e 100644
--- a/sw/source/ui/fldui/fldtdlg.hrc
+++ b/sw/source/ui/fldui/fldtdlg.hrc
@@ -28,13 +28,9 @@
#ifndef _FLDTDLG_HRC
#define _FLDTDLG_HRC
-// #include -----------------------------------------------------------------
-
-// #define ------------------------------------------------------------------
-
#define RC_FLDTDLG_BEGIN 0
-// Datenbankfeld-TabPage:
+// database field TabPage:
#define RC_TP_DB_START (RC_FLDTDLG_BEGIN)
#define FT_DBTYPE (RC_TP_DB_START + 1)
#define LB_DBTYPE (RC_TP_DB_START + 2)
@@ -54,7 +50,7 @@
#define FT_ADDDB (RC_TP_DB_START + 16)
#define PB_ADDDB (RC_TP_DB_START + 17)
-// Dokumentinfo-TabPage:
+// Documentinfo-TabPage:
#define RC_TP_DOCINF_START (RC_TP_DB_END)
#define FT_DOKINFTYPE (RC_TP_DOCINF_START + 1)
#define TLB_DOKINFTYPE (RC_TP_DOCINF_START + 2)
@@ -68,7 +64,7 @@
#define STR_DOKINF_INFO (RC_TP_DOCINF_START + 10)
#define RC_TP_DOCINF_END (RC_TP_DOCINF_START + 11)
-// Variablen-TabPage:
+// Variable-TabPage:
#define RC_TP_VAR_START (RC_TP_DOCINF_END)
#define FT_VARTYPE (RC_TP_VAR_START + 1)
#define LB_VARTYPE (RC_TP_VAR_START + 2)
@@ -92,7 +88,7 @@
#define BT_VARDELETE (RC_TP_VAR_START + 20)
#define RC_TP_VAR_END (RC_TP_VAR_START + 21)
-// Dokument-TabPage:
+// Document-TabPage:
#define RC_TP_DOC_START (RC_TP_VAR_END)
#define FT_DOKTYPE (RC_TP_DOC_START + 1)
#define LB_DOKTYPE (RC_TP_DOC_START + 2)
@@ -112,7 +108,7 @@
#define BMP_DOKROOT_CLOSED (RC_TP_DOC_START + 16)
#define RC_TP_DOC_END (RC_TP_DOC_START + 17)
-// Funktion-TabPage:
+// Function-TabPage:
#define RC_TP_FUNC_START (RC_TP_DOC_END)
#define FT_FUNCTYPE (RC_TP_FUNC_START + 1)
#define LB_FUNCTYPE (RC_TP_FUNC_START + 2)
@@ -141,7 +137,7 @@
#define FT_LISTNAME (RC_TP_FUNC_START + 25)
#define ED_LISTNAME (RC_TP_FUNC_START + 26)
-// Referenz-TabPage:
+// Reference-TabPage:
#define RC_TP_REF_START (RC_TP_FUNC_END)
#define FT_REFTYPE (RC_TP_REF_START + 1)
#define LB_REFTYPE (RC_TP_REF_START + 2)
diff --git a/sw/source/ui/fldui/fldui.src b/sw/source/ui/fldui/fldui.src
index 7fb6a2e730c8..e3d99725761e 100644
--- a/sw/source/ui/fldui/fldui.src
+++ b/sw/source/ui/fldui/fldui.src
@@ -30,17 +30,17 @@
#include "helpid.h"
/*--------------------------------------------------------------------
- Beschreibung: Strings fuer die Types
+ Description: strings for the types
--------------------------------------------------------------------*/
String STR_FLD_EDIT_DLG
{
Text [ en-US ] = "Edit Fields" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Strings fuer die Types
+ Description: strings for the types
--------------------------------------------------------------------*/
//
- // Bereich Dokument
+ // range document
//
String STR_DATEFLD
{
@@ -83,7 +83,7 @@ String STR_EXTUSERFLD
Text [ en-US ] = "Sender" ;
};
//
- // Bereich Funktionen
+ // range functions
//
String STR_SETFLD
{
@@ -103,11 +103,6 @@ String STR_INPUTFLD
};
String STR_SETINPUTFLD
{
- /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */
- /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */
- /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */
- /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */
- /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */
Text [ en-US ] = "Input field (variable)" ;
};
String STR_USRINPUTFLD
@@ -155,7 +150,7 @@ String STR_DROPDOWN
Text [ en-US ] = "Input list" ;
};
//
- // Bereich Referenzen
+ // range references
//
String STR_SETREFFLD
{
@@ -166,7 +161,7 @@ String STR_GETREFFLD
Text [ en-US ] = "Insert Reference" ;
};
//
- // Bereich Datenbank
+ // range database
//
String STR_DBFLD
{
@@ -197,7 +192,7 @@ String STR_HIDDENTXTFLD
Text [ en-US ] = "Hidden text" ;
};
//
- // Bereich Benutzerfelder
+ // range user fields
//
String STR_USERFLD
{
@@ -220,14 +215,14 @@ String STR_HIDDENPARAFLD
Text [ en-US ] = "Hidden Paragraph" ;
};
//
- // Bereich DokumentInfo
+ // range DocumentInfo
//
String STR_DOCINFOFLD
{
Text [ en-US ] = "DocInformation" ;
};
/*--------------------------------------------------------------------
- Beschreibung: SubCmd-Strings
+ Description: SubCmd-Strings
--------------------------------------------------------------------*/
String FLD_DATE_STD
{
@@ -246,7 +241,7 @@ String FLD_TIME_FIX
Text [ en-US ] = "Time (fixed)" ;
};
//
- // SubCmd Statistik
+ // SubCmd Statistic
//
String FLD_STAT_TABLE
{
@@ -276,7 +271,7 @@ String FLD_STAT_PAGE
{
Text [ en-US ] = "Pages" ;
};
- // SubCmd DDETypen
+ // SubCmd DDETypes
//
String FMT_DDE_HOT
{
@@ -291,7 +286,7 @@ String FLD_INPUT_TEXT
TEXT = "[Text]" ;
};
/*--------------------------------------------------------------------
- Beschreibung: SubType Extuser
+ Description: SubType Extuser
--------------------------------------------------------------------*/
String FLD_EU_FIRMA
{
@@ -362,7 +357,7 @@ String FLD_PAGEREF_ON
Text [ en-US ] = "on" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Pfadname
+ Description: path name
--------------------------------------------------------------------*/
// Formate FileName
String FMT_FF_NAME
@@ -390,7 +385,7 @@ String FMT_FF_UI_RANGE
Text [ en-US ] = "Category" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Format Kapitel
+ Description: format chapter
--------------------------------------------------------------------*/
String FMT_CHAPTER_NAME
{
@@ -406,11 +401,10 @@ String FMT_CHAPTER_NO_NOSEPARATOR
};
String FMT_CHAPTER_NAMENO
{
- /* ### ACHTUNG: Neuer Text in Resource? Kapitelnummer und Name : Nummer und Name */
Text [ en-US ] = "Chapter number and name" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Formate
+ Description: formats
--------------------------------------------------------------------*/
String FMT_NUM_ABC
{
@@ -449,7 +443,7 @@ String FMT_NUM_PAGESPECIAL
Text [ en-US ] = "Text" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Author
+ Description: Author
--------------------------------------------------------------------*/
String FMT_AUTHOR_NAME
{
@@ -460,7 +454,7 @@ String FMT_AUTHOR_SCUT
Text [ en-US ] = "Initials" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Varibale setzen
+ Description: set variable
--------------------------------------------------------------------*/
String FMT_SETVAR_SYS
{
@@ -495,7 +489,7 @@ String FMT_DBFLD_SYS
Text [ en-US ] = "System" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Ablagefelder
+ Description: storage fields
--------------------------------------------------------------------*/
String FMT_REG_AUTHOR
{
@@ -510,7 +504,7 @@ String FMT_REG_DATE
Text [ en-US ] = "Date" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Formate Referenzen
+ Description: formats references
--------------------------------------------------------------------*/
String FMT_REF_TEXT
{
@@ -557,7 +551,7 @@ String FMT_REF_NUMBER_FULL_CONTEXT
Text [ en-US ] = "Number (full context)";
};
/*--------------------------------------------------------------------
- Beschreibung: Platzhalter
+ Description: paceholder
--------------------------------------------------------------------*/
String FMT_MARK_TEXT
{
@@ -580,14 +574,14 @@ String FMT_MARK_OLE
Text [ en-US ] = "Object" ;
};
/*--------------------------------------------------------------------
- Beschreibung: Nur-Text
+ Description: text only
--------------------------------------------------------------------*/
String FMT_TEXT
{
TEXT = "Text" ;
};
/*--------------------------------------------------------------------
- Beschreibung: globale String-Ressourcen
+ Description: global String resources
--------------------------------------------------------------------*/
String STR_ALL
{
@@ -598,7 +592,7 @@ String STR_INSERT
Text [ en-US ] = "Insert" ;
};
/*--------------------------------------------------------------------
- Beschreibung: AustauschStrings fuer Edit/NameFT
+ Description: ExchangeStrings for Edit/NameFT
--------------------------------------------------------------------*/
String STR_COND
{
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 74256233560d..3167b3a22dd6 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,33 +39,20 @@
#include <docufld.hxx>
#include <expfld.hxx>
#include <ddefld.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <doc.hxx>
#include <docary.hxx>
#include <swmodule.hxx>
-#ifndef _FLDVAR_HXX
#include <fldvar.hxx>
-#endif
#include <calc.hxx>
#include <svl/zformat.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwFldVarPage::SwFldVarPage(Window* pParent, const SfxItemSet& rCoreSet ) :
SwFldPage ( pParent, SW_RES( TP_FLD_VAR ), rCoreSet ),
@@ -109,23 +97,15 @@ SwFldVarPage::SwFldVarPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aNumFormatLB.SetShowLanguageControl(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldVarPage::~SwFldVarPage()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldVarPage::Reset(const SfxItemSet& )
{
SavePos(&aTypeLB);
- Init(); // Allgemeine initialisierung
+ Init(); // general initialisation
aTypeLB.SetUpdateMode(sal_False);
aTypeLB.Clear();
@@ -134,7 +114,7 @@ void SwFldVarPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // TypeListBox initialisieren
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
for (short i = rRg.nStart; i < rRg.nEnd; ++i)
@@ -164,7 +144,7 @@ void SwFldVarPage::Reset(const SfxItemSet& )
}
}
- // alte Pos selektieren
+ // select old Pos
RestorePos(&aTypeLB);
aTypeLB.SetDoubleClickHdl (LINK(this, SwFldVarPage, InsertHdl));
@@ -214,16 +194,12 @@ void SwFldVarPage::Reset(const SfxItemSet& )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG )
{
- // Alte ListBoxPos sichern
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
- // Aktuelle ListBoxPos
+ // current ListBoxPos
SetTypeSel(aTypeLB.GetSelectEntryPos());
if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
@@ -242,7 +218,7 @@ IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG )
}
aValueED.SetDropEnable(sal_False);
- UpdateSubType(); // Auswahl-Listboxen initialisieren
+ UpdateSubType(); // initialise selection-listboxes
}
bInit = sal_False;
@@ -250,10 +226,6 @@ IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -289,7 +261,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
{
case TYP_USERFLD:
{
- // Benutzertyp aendern oder anlegen
+ // change or create user type
SwUserFieldType* pType = (SwUserFieldType*)
GetFldMgr().GetFldType(RES_USERFLD, nSelPos);
@@ -297,7 +269,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
{
if (!IsFldEdit())
{
- if (pBox || (bInit && !IsRefresh())) // Nur bei Interaktion mit Maus
+ if (pBox || (bInit && !IsRefresh())) // only when interacting via mouse
{
aNameED.SetText(pType->GetName());
@@ -308,7 +280,6 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
}
else
aValueED.SetText(pType->GetContent());
-// aValueED.SetText(pType->GetContent(aNumFormatLB.GetFormat()));
}
}
else
@@ -316,7 +287,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
}
else
{
- if (pBox) // Nur bei Interaktion mit Maus
+ if (pBox) // only when interacting via mouse
{
aNameED.SetText(aEmptyStr);
aValueED.SetText(aEmptyStr);
@@ -342,8 +313,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
aNumFormatLB.SetEntryData(nPos, (void *)ULONG_MAX);
aNumFormatLB.SelectEntryPos(0);
}
- // gibt es ein entprechendes SetField
- if (IsFldEdit() || pBox) // Nur bei Interaktion mit Maus
+ // is there a corresponding SetField
+ if (IsFldEdit() || pBox) // only when interacting via mouse
{
if (nSelPos != LISTBOX_ENTRY_NOTFOUND)
{
@@ -361,18 +332,18 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
pSh->GetFldType(RES_SETEXPFLD, sName);
if (pSetTyp && pSetTyp->GetType() == nsSwGetSetExpType::GSE_STRING)
- aNumFormatLB.SelectEntryPos(0); // Textuell
+ aNumFormatLB.SelectEntryPos(0); // textual
}
}
}
}
if (IsFldEdit())
{
- // GetFormula fuehrt bei Datumsformaten zu Problemen,
- // da nur der numerische Wert ohne Formatierung returned wird.
- // Muss aber verwendet werden, da sonst bei GetPar2 nur der vom
- // Kalkulator errechnete Wert angezeigt werden wuerde
- // (statt test2 = test + 1)
+ // GetFormula leads to problems with date formats because
+ // only the numeric value without formating is returned.
+ // It must be used though because otherwise in GetPar2 only
+ // the value calculated by Kalkulator would be displayed
+ // (instead of test2 = test + 1)
aValueED.SetText(((SwSetExpField*)GetCurField())->GetFormula());
}
aValueED.SetDropEnable(sal_True);
@@ -401,7 +372,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
if (!IsFldEdit())
aNameED.SetText(sName);
- // gibt es ein entprechendes SetField
+ // is there a corresponding SetField
SwWrtShell *pSh = GetWrtShell();
if(!pSh)
pSh = ::GetActiveWrtShell();
@@ -412,9 +383,9 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
if(pSetTyp)
{
- if (pSetTyp->GetType() & nsSwGetSetExpType::GSE_STRING) // Textuell?
+ if (pSetTyp->GetType() & nsSwGetSetExpType::GSE_STRING) // textual?
bFormat = sal_True;
- else // Numerisch
+ else // numeric
bNumFmt = sal_True;
}
}
@@ -438,19 +409,19 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
sName = aSelectionLB.GetSelectEntry();
aNameED.SetText( sName );
- // User- oder SetField ?
+ // User- or SetField ?
sal_uInt16 nInpType = 0;
nInpType = static_cast< sal_uInt16 >(GetFldMgr().GetFldType(RES_USERFLD, sName) ? 0 : TYP_SETINPFLD);
if (nInpType) // SETEXPFLD
{
- // gibt es ein entprechendes SetField
+ // is there a corresponding SetField
SwSetExpFieldType* pSetTyp = (SwSetExpFieldType*)
GetFldMgr().GetFldType(RES_SETEXPFLD, sName);
if(pSetTyp)
{
- if (pSetTyp->GetType() == nsSwGetSetExpType::GSE_STRING) // Textuell?
+ if (pSetTyp->GetType() == nsSwGetSetExpType::GSE_STRING) // textual?
{
aNumFormatLB.Clear();
@@ -470,7 +441,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
case TYP_DDEFLD:
aValueFT.SetText(SW_RESSTR(STR_DDE_CMD));
- if (IsFldEdit() || pBox) // Nur bei Interaktion mit Maus
+ if (IsFldEdit() || pBox) // only when interacting via mouse
{
if (nSelPos != LISTBOX_ENTRY_NOTFOUND)
{
@@ -481,8 +452,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
{
aNameED.SetText(pType->GetName());
- //JP 28.08.95: DDE-Topics/-Items koennen Blanks in ihren
- // Namen haben! Wird hier noch nicht beachtet
+ //JP 28.08.95: DDE-Topics/-Items can have blanks in their names!
+ // That's not considered here yet
String sCmd( pType->GetCmd() );
sal_uInt16 nTmpPos = sCmd.SearchAndReplace( sfx2::cTokenSeperator, ' ' );
sCmd.SearchAndReplace( sfx2::cTokenSeperator, ' ', nTmpPos );
@@ -497,7 +468,6 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
case TYP_SEQFLD:
{
- // aNumRB.Check(sal_True);
bName = bValue = bSeparator = bChapterLevel = sal_True;
SwFieldType* pFldTyp;
@@ -517,7 +487,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
aValueED.SetText( ((SwSetExpField*)GetCurField())->
GetFormula() );
- if( IsFldEdit() || pBox ) // Nur bei Interaktion mit Maus
+ if( IsFldEdit() || pBox ) // only when interacting via mouse
aNameED.SetText( aSelectionLB.GetSelectEntry() );
if( pFldTyp )
@@ -539,12 +509,12 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
bValue = sal_False;
aValueFT.SetText( SW_RESSTR( STR_OFFSET ));
- if (IsFldEdit() || pBox) // Nur bei Interaktion mit Maus
+ if (IsFldEdit() || pBox) // only when interacting via mouse
aNameED.SetText(aEmptyStr);
if (nSelPos != 0 && nSelPos != LISTBOX_ENTRY_NOTFOUND)
{
- bValue = sal_True; // SubType OFF - kennt keinen Offset
+ bValue = sal_True; // SubType OFF - knows no Offset
if (IsFldEdit())
aValueED.SetText(String::CreateFromInt32(((SwRefPageSetField*)GetCurField())->GetOffset()));
}
@@ -587,7 +557,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
aChapterLevelLB.Show(bChapterLevel);
aInvisibleCB.Enable(bInvisible);
- ModifyHdl(); // Anwenden/Einfuegen/Loeschen Status update
+ ModifyHdl(); // apply/insert/delete status update
aNumFormatLB.SetUpdateMode(sal_True);
aFormatLB.SetUpdateMode(sal_True);
@@ -619,9 +589,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
}
/*--------------------------------------------------------------------
- Beschreibung: Typen in der SelectionBox erneuern
+ Description: renew types in SelectionBox
--------------------------------------------------------------------*/
-
void SwFldVarPage::UpdateSubType()
{
String sOldSel;
@@ -631,7 +600,7 @@ void SwFldVarPage::UpdateSubType()
if(GetSelectionSel() != LISTBOX_ENTRY_NOTFOUND)
sOldSel = aSelectionLB.GetEntry(GetSelectionSel());
- // Auswahl-Listbox fuellen
+ // fill Selection-Listbox
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
@@ -684,7 +653,7 @@ void SwFldVarPage::UpdateSubType()
(!((SwRefPageSetField*)GetCurField())->IsOn() && !i))
sOldSel = *aList[i];
- // Alle Eintr?ge zur Auswahl zulassen:
+ // allow all entries for selection:
nPos = aSelectionLB.InsertEntry(*aList[i]);
aSelectionLB.SetEntryData(nPos, reinterpret_cast<void*>(i));
break;
@@ -714,7 +683,7 @@ void SwFldVarPage::UpdateSubType()
if (!aSelectionLB.GetSelectEntryCount())
{
aSelectionLB.SelectEntryPos(0);
- pLB = &aSelectionLB; // Alle Controls neu initialisieren
+ pLB = &aSelectionLB; // newly initialise all controls
}
}
@@ -725,10 +694,6 @@ void SwFldVarPage::UpdateSubType()
aSelectionLB.SetUpdateMode(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId)
{
String sOldSel, sOldNumSel;
@@ -745,7 +710,7 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId)
nOldNumFormat = aNumFormatLB.GetFormat();
}
- // Format-Listbox fuellen
+ // fill Format-Listbox
aFormatLB.Clear();
aNumFormatLB.Clear();
sal_Bool bSpecialFmt = sal_False;
@@ -859,9 +824,8 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId)
}
/*--------------------------------------------------------------------
- Beschreibung: Modify
+ Description: Modify
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
{
String sValue(aValueED.GetText());
@@ -884,19 +848,19 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
nLen = sName.Len();
Selection aSel(aNameED.GetSelection());
aNameED.SetText( sName );
- aNameED.SetSelection( aSel ); // Cursorpos restaurieren
+ aNameED.SetSelection( aSel ); // restore Cursorpos
}
break;
}
- // Buttons ueberpruefen
+ // check buttons
switch (nTypeId)
{
case TYP_DDEFLD:
if( nLen )
{
- // Gibts schon einen entsprechenden Type
+ // is there already a corrensponding type
bInsert = bApply = sal_True;
SwFieldType* pType = GetFldMgr().GetFldType(RES_DDEFLD, sName);
@@ -912,7 +876,7 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
case TYP_USERFLD:
if( nLen )
{
- // Gibts schon einen entsprechenden Type
+ // is there already a corresponding type
SwFieldType* pType = GetFldMgr().GetFldType(RES_USERFLD, sName);
SwWrtShell *pSh = GetWrtShell();
@@ -922,9 +886,9 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
bDelete = !pSh->IsUsed( *pType );
pType = GetFldMgr().GetFldType(RES_SETEXPFLD, sName);
- if (!pType) // Kein Namenskonflikt mit Variablen
+ if (!pType) // no name conflict with variables
{
- // Benutzerfelder duerfen auch ohne Inhalt eingefuegt werden!
+ // user fields can also be inserted without content!
// Bug #56845
bInsert = bApply = sal_True;
}
@@ -988,10 +952,6 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -1050,7 +1010,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
if (nFormat != LISTBOX_ENTRY_NOTFOUND)
nFormat = (sal_uLong)aFormatLB.GetEntryData((sal_uInt16)nFormat);
- if (pType) // Aendern
+ if (pType) // change
{
SwWrtShell *pSh = GetWrtShell();
if(!pSh)
@@ -1065,9 +1025,9 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
{
sal_uLong nFmt = nNumFormatPos == 0 ? 0 : aNumFormatLB.GetFormat();
if (nFmt)
- { // Sprache auf Office-Sprache umstellen, da String im Office
- // Format vom Kalkulator erwartet wird und so in den Dlg
- // eingegeben werden sollte
+ { // Switch language to office-language because Kalkulator expects
+ // String in office format and it should be fed into dialog like
+ // that
nFmt = SwValueField::GetSystemFormat(pSh->GetNumberFormatter(), nFmt);
}
((SwUserFieldType*)pType)->SetContent(aValueED.GetText(), nFmt);
@@ -1079,8 +1039,8 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
{
if (nFormat != LISTBOX_ENTRY_NOTFOUND)
{
- //JP 28.08.95: DDE-Topics/-Items koennen Blanks in ihren
- // Namen haben! Wird hier noch nicht beachtet.
+ // DDE-Topics/-Items can have blanks in their names!
+ // That's not being considered here yet.
sal_uInt16 nTmpPos = sValue.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sValue.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
((SwDDEFieldType*)pType)->SetCmd(sValue);
@@ -1092,7 +1052,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
pSh->EndAllAction();
}
}
- else // Neu
+ else // new
{
if(nTypeId == TYP_USERFLD)
{
@@ -1109,7 +1069,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
aType.SetContent( sValue, nNumFormatPos == 0 ? 0 : aNumFormatLB.GetFormat() );
aSelectionLB.InsertEntry(sName);
aSelectionLB.SelectEntry(sName);
- GetFldMgr().InsertFldType( aType ); // Userfld Neu
+ GetFldMgr().InsertFldType( aType ); // Userfld new
}
}
}
@@ -1117,20 +1077,20 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
{
if (nFormat != LISTBOX_ENTRY_NOTFOUND)
{
- //JP 28.08.95: DDE-Topics/-Items koennen Blanks in ihren
- // Namen haben! Wird hier noch nicht beachtet.
+ // DDE-Topics/-Items can have blanks in their names!
+ // That's not being considered here yet.
sal_uInt16 nTmpPos = sValue.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sValue.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
SwDDEFieldType aType(sName, sValue, (sal_uInt16)nFormat);
aSelectionLB.InsertEntry(sName);
aSelectionLB.SelectEntry(sName);
- GetFldMgr().InsertFldType(aType); // DDE-Feld Neu
+ GetFldMgr().InsertFldType(aType); // DDE-Field new
}
}
}
if (IsFldEdit())
- GetFldMgr().GetCurFld(); // FieldManager Updaten
+ GetFldMgr().GetCurFld(); // update FieldManager
UpdateSubType();
}
@@ -1140,10 +1100,6 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, ChapterHdl, ListBox *, EMPTYARG )
{
sal_Bool bEnable = aChapterLevelLB.GetSelectEntryPos() != 0;
@@ -1155,10 +1111,6 @@ IMPL_LINK( SwFldVarPage, ChapterHdl, ListBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFldVarPage, SeparatorHdl, Edit *, EMPTYARG )
{
sal_Bool bEnable = aSeparatorED.GetText().Len() != 0 ||
@@ -1168,10 +1120,6 @@ IMPL_LINK( SwFldVarPage, SeparatorHdl, Edit *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
@@ -1202,9 +1150,9 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
if (nFormat && nFormat != ULONG_MAX && aNumFormatLB.IsAutomaticLanguage())
{
- // Sprache auf Office-Sprache umstellen, da String im Office-
- // Format vom Kalkulator erwartet wird und so in den Dlg
- // eingegeben werden sollte
+ // Switch language to office language because Kalkulator expects
+ // String in office format and it should be fed into the dialog
+ // like that
SwWrtShell *pSh = GetWrtShell();
if(!pSh)
pSh = ::GetActiveWrtShell();
@@ -1265,7 +1213,6 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
}
case TYP_SEQFLD:
{
- // nSubType = nsSwGetSetExpType::GSE_SEQ; // nsSwGetSetExpType::GSE_SEQ wird im Fldmgr fest gesetzt, kann also entfallen
nSubType = aChapterLevelLB.GetSelectEntryPos();
if (nSubType == 0)
nSubType = 0x7f;
@@ -1274,7 +1221,6 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
nSubType--;
String sSeparator(aSeparatorED.GetText().GetChar(0));
cSeparator = sSeparator.Len() ? sSeparator.GetChar(0) : ' ';
- //nSubType |= (sal_uInt16)(((sal_uInt8)) << 8);
}
break;
}
@@ -1303,30 +1249,17 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
return sal_False;
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxTabPage* SwFldVarPage::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new SwFldVarPage( pParent, rAttrSet ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFldVarPage::GetGroup()
{
return GRP_VAR;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SelectionListBox::SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId ) :
ListBox (pDialog, rResId),
pDlg (pDialog),
@@ -1334,40 +1267,28 @@ SelectionListBox::SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId )
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
long SelectionListBox::PreNotify( NotifyEvent& rNEvt )
{
long nHandled = ListBox::PreNotify( rNEvt );
- //sal_Bool bAddSel = sal_False;
if ( rNEvt.GetType() == EVENT_KEYUP )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
const KeyCode aKeyCode = pKEvt->GetKeyCode();
const sal_uInt16 nModifier = aKeyCode.GetModifier();
if( aKeyCode.GetCode() == KEY_SPACE && !nModifier)
-// bAddSel = sal_True;
bCallAddSelection = sal_True;
}
if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- if (pMEvt && (pMEvt->IsMod1() || pMEvt->IsMod2())) // Alt oder Ctrl
- //bAddSel = sal_True;
+ if (pMEvt && (pMEvt->IsMod1() || pMEvt->IsMod2())) // Alt or Ctrl
bCallAddSelection = sal_True;
}
-// if (bAddSel)
-// pDlg->AddSelection(this);
-
return nHandled;
}
-/* -----------------12.01.99 11:14-------------------
- *
- * --------------------------------------------------*/
+
void SwFldVarPage::FillUserData()
{
String sData(String::CreateFromAscii(USER_DATA_VERSION));
@@ -1381,3 +1302,4 @@ void SwFldVarPage::FillUserData()
SetUserData(sData);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx
index 3c3ecf60b983..f4d55ceb5755 100644
--- a/sw/source/ui/fldui/fldvar.hxx
+++ b/sw/source/ui/fldui/fldvar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/edit.hxx>
@@ -43,10 +42,6 @@
class SwFldVarPage;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SelectionListBox : public ListBox
{
SwFldVarPage* pDlg;
@@ -57,15 +52,11 @@ class SelectionListBox : public ListBox
public:
SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId );
- // Selektieren per Ctrl oder Alt erkennen und mit SelectHdl auswerten
+ // detect selection via Ctrl or Alt and evaluate with SelectHdl
sal_Bool IsCallAddSelection() const {return bCallAddSelection;}
void ResetCallAddSelection() {bCallAddSelection = sal_False;}
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwFldVarPage : public SwFldPage
{
friend class SelectionListBox;
@@ -124,3 +115,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldwrap.cxx b/sw/source/ui/fldui/fldwrap.cxx
index bda3a14282f8..e8217701cc5d 100644
--- a/sw/source/ui/fldui/fldwrap.cxx
+++ b/sw/source/ui/fldui/fldwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,67 +31,46 @@
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <swtypes.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/msgbox.hxx>
#include <svx/htmlmode.hxx>
#include <viewopt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <fldwrap.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
#include <swmodule.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
#include "swabstdlg.hxx"
SFX_IMPL_CHILDWINDOW(SwFldDlgWrapper, FN_INSERT_FIELD)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwChildWinWrapper::SwChildWinWrapper(Window *pParentWindow, sal_uInt16 nId) :
SfxChildWindow(pParentWindow, nId),
m_pDocSh(0)
{
- // Flackern der Buttons vermeiden:
+ // avoid flickering of buttons:
m_aUpdateTimer.SetTimeout(200);
m_aUpdateTimer.SetTimeoutHdl(LINK(this, SwChildWinWrapper, UpdateHdl));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwChildWinWrapper, UpdateHdl, void*, EMPTYARG )
{
- GetWindow()->Activate(); // Dialog aktualisieren
+ GetWindow()->Activate(); // update dialog
return 0;
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren
+ Description: newly initialise dialog after Doc switch
--------------------------------------------------------------------*/
-
sal_Bool SwChildWinWrapper::ReInitDlg(SwDocShell *)
{
sal_Bool bRet = sal_False;
@@ -98,7 +78,7 @@ sal_Bool SwChildWinWrapper::ReInitDlg(SwDocShell *)
if (m_pDocSh != GetOldDocShell())
{
m_aUpdateTimer.Stop();
- bRet = sal_True; // Sofortiges Update
+ bRet = sal_True; // immediate Update
}
else
m_aUpdateTimer.Start();
@@ -106,10 +86,6 @@ sal_Bool SwChildWinWrapper::ReInitDlg(SwDocShell *)
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxChildWinInfo SwFldDlgWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
@@ -117,21 +93,16 @@ SfxChildWinInfo SwFldDlgWrapper::GetInfo() const
return aInfo;
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId,
SfxBindings* pB,
SfxChildWinInfo* )
: SwChildWinWrapper( _pParent, nId )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
pWindow = pDlg->GetWindow();
pDlg->Start();
@@ -139,14 +110,13 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId,
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren
+ Description: newly initialise dialog after Doc switch
--------------------------------------------------------------------*/
-
sal_Bool SwFldDlgWrapper::ReInitDlg(SwDocShell *pDocSh)
{
sal_Bool bRet;
- if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // Sofort aktualisieren, Dok-Wechsel
+ if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // update immediately, Doc switch
{
pDlgInterface->ReInitDlg();
}
@@ -154,10 +124,6 @@ sal_Bool SwFldDlgWrapper::ReInitDlg(SwDocShell *pDocSh)
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFldDlgWrapper::ShowPage(sal_uInt16 nPage)
{
pDlgInterface->ShowPage(nPage ? nPage : TP_FLD_REF);
@@ -165,9 +131,6 @@ void SwFldDlgWrapper::ShowPage(sal_uInt16 nPage)
SFX_IMPL_CHILDWINDOW(SwFldDataOnlyDlgWrapper, FN_INSERT_FIELD_DATA_ONLY)
-/* -----------------04.02.2003 14:17-----------------
- *
- * --------------------------------------------------*/
SfxChildWinInfo SwFldDataOnlyDlgWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
@@ -176,19 +139,17 @@ SfxChildWinInfo SwFldDataOnlyDlgWrapper::GetInfo() const
aInfo.bVisible = sal_False;
return aInfo;
}
-/* -----------------04.02.2003 14:17-----------------
- *
- * --------------------------------------------------*/
+
SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, sal_uInt16 nId,
SfxBindings* pB,
SfxChildWinInfo* pInfo )
: SwChildWinWrapper( _pParent, nId )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
pWindow = pDlg->GetWindow();
@@ -197,16 +158,19 @@ SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, sal_uInt16 n
pDlg->Initialize( pInfo );
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
}
-/* -----------------04.02.2003 14:17-----------------
+
+/* --------------------------------------------------
* re-init after doc activation
* --------------------------------------------------*/
sal_Bool SwFldDataOnlyDlgWrapper::ReInitDlg(SwDocShell *pDocSh)
{
sal_Bool bRet;
- if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // Sofort aktualisieren, Dok-Wechsel
+ if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // update immediately, Doc switch
{
pDlgInterface->ReInitDlg();
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx
index b8c26c701b04..ed1b04bc45da 100644
--- a/sw/source/ui/fldui/inpdlg.cxx
+++ b/sw/source/ui/fldui/inpdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,7 @@
/*--------------------------------------------------------------------
- Beschreibung: Feldeinfuegen bearbeiten
+ Description: edit field-insert
--------------------------------------------------------------------*/
SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
@@ -69,7 +70,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
aNextBT (this, SW_RES(PB_NEXT )),
aHelpBT (this, SW_RES(PB_HELP ))
{
- // Font fuers Edit umschalten
+ // switch font for Edit
Font aFont(aEditED.GetFont());
aFont.SetWeight(WEIGHT_LIGHT);
aEditED.SetFont(aFont);
@@ -87,10 +88,10 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
aHelpBT.SetPosPixel(aPos);
}
- // Auswertung hier
+ // evaluation here
String aStr;
if( RES_INPUTFLD == pField->GetTyp()->Which() )
- { // Es ist eine Eingabefeld
+ { // it is an input field
//
pInpFld = (SwInputField*)pField;
aLabelED.SetText( pInpFld->GetPar2() );
@@ -103,7 +104,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
break;
case INP_USR:
- // Benutzerfeld
+ // user field
if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType(
RES_USERFLD, pInpFld->GetPar1() ) ) )
aStr = pUsrType->GetContent();
@@ -112,7 +113,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
}
else
{
- // es ist eine SetExpression
+ // it is a SetExpression
pSetFld = (SwSetExpField*)pField;
String sFormula(pSetFld->GetFormula());
//values are formatted - formulas are not
@@ -129,7 +130,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
// JP 31.3.00: Inputfields in readonly regions must be allowed to
// input any content. - 74639
sal_Bool bEnable = !rSh.IsCrsrReadonly();
- /*!rSh.IsReadOnlyAvailable() || !rSh.HasReadonlySel()*/;
+
aOKBT.Enable( bEnable );
aEditED.SetReadOnly( !bEnable );
@@ -150,7 +151,7 @@ void SwFldInputDlg::StateChanged( StateChangedType nType )
}
/*--------------------------------------------------------------------
- Beschreibung: Schliessen
+ Description: Close
--------------------------------------------------------------------*/
void SwFldInputDlg::Apply()
@@ -199,3 +200,4 @@ IMPL_LINK(SwFldInputDlg, NextHdl, PushButton*, EMPTYARG)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx
index cd8081701b31..ba7f91d44714 100644
--- a/sw/source/ui/fldui/javaedit.cxx
+++ b/sw/source/ui/fldui/javaedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,14 +40,10 @@
#define _JAVAEDIT_CXX
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <vcl/svapp.hxx>
#include <svl/urihelper.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <sfx2/docfile.hxx>
#include <sfx2/filedlghelper.hxx>
#include <docsh.hxx>
@@ -55,16 +52,10 @@
#include <fldmgr.hxx>
#include <docufld.hxx>
#include <uitool.hxx>
-#ifndef _JAVAEDIT_HXX
#include <javaedit.hxx>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _JAVAEDIT_HRC
#include <javaedit.hrc>
-#endif
// static ----------------------------------------------------------------
@@ -98,7 +89,7 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) :
pFileDlg(NULL),
pOldDefDlgParent(NULL)
{
- // Handler installieren
+ // install handler
aPrevBtn.SetClickHdl( LINK( this, SwJavaEditDialog, PrevHdl ) );
aNextBtn.SetClickHdl( LINK( this, SwJavaEditDialog, NextHdl ) );
aOKBtn.SetClickHdl( LINK( this, SwJavaEditDialog, OKHdl ) );
@@ -122,7 +113,7 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) :
if( !bNew )
SetText( SW_RES( STR_JAVA_EDIT ) );
else
- // neu anlegen
+ // newly create
SetText( SW_RES( STR_JAVA_INSERT ) );
FreeResource();
@@ -130,12 +121,6 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) :
RadioButtonHdl(NULL);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
SwJavaEditDialog::~SwJavaEditDialog()
{
delete pMgr;
@@ -143,12 +128,6 @@ SwJavaEditDialog::~SwJavaEditDialog()
Application::SetDefDialogParent( pOldDefDlgParent );
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
IMPL_LINK_INLINE_START( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG )
{
SetFld();
@@ -161,12 +140,6 @@ IMPL_LINK_INLINE_START( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
IMPL_LINK_INLINE_START( SwJavaEditDialog, NextHdl, Button *, EMPTYARG )
{
SetFld();
@@ -179,12 +152,6 @@ IMPL_LINK_INLINE_START( SwJavaEditDialog, NextHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwJavaEditDialog, NextHdl, Button *, EMPTYARG )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwJavaEditDialog, OKHdl, Button *, EMPTYARG )
{
SetFld();
@@ -192,22 +159,10 @@ IMPL_LINK( SwJavaEditDialog, OKHdl, Button *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
void SwJavaEditDialog::Apply()
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
void SwJavaEditDialog::CheckTravel()
{
sal_Bool bTravel = sal_False;
@@ -215,7 +170,7 @@ void SwJavaEditDialog::CheckTravel()
if(!bNew)
{
- // Traveling nur bei mehr als einem Feld
+ // Traveling only when more than one field
pSh->StartAction();
pSh->CreateCrsr();
@@ -264,12 +219,6 @@ void SwJavaEditDialog::CheckTravel()
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
void SwJavaEditDialog::SetFld()
{
if( !aOKBtn.IsEnabled() )
@@ -304,10 +253,6 @@ sal_Bool SwJavaEditDialog::IsUpdate()
return pFld && ( bIsUrl != pFld->GetFormat() || pFld->GetPar2() != aType || pFld->GetPar1() != aText );
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, EMPTYARG )
{
sal_Bool bEnable = aUrlRB.IsChecked();
@@ -328,10 +273,6 @@ IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, EMPTYARG )
return 0;
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn )
{
if ( !pFileDlg )
@@ -364,3 +305,4 @@ IMPL_LINK( SwJavaEditDialog, DlgClosedHdl, sfx2::FileDialogHelper *, EMPTYARG )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/javaedit.src b/sw/source/ui/fldui/javaedit.src
index bae88ed1adc5..a5ebb890fb50 100644
--- a/sw/source/ui/fldui/javaedit.src
+++ b/sw/source/ui/fldui/javaedit.src
@@ -142,7 +142,6 @@ ModalDialog DLG_JAVAEDIT
};
String STR_JAVA_INSERT
{
- /* ### ACHTUNG: Neuer Text in Resource? Script einfügen : Script einf³gen */
Text [ en-US ] = "Insert Script" ;
};
Text [ en-US ] = "Edit Script" ;
diff --git a/sw/source/ui/fldui/xfldui.cxx b/sw/source/ui/fldui/xfldui.cxx
index 15cb04547b41..14b193eeb5df 100644
--- a/sw/source/ui/fldui/xfldui.cxx
+++ b/sw/source/ui/fldui/xfldui.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
@@ -40,13 +41,9 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/processfactory.hxx>
#include <fldmgr.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
-#include <wrtsh.hxx> // Actives Fenster
-#ifndef _VIEW_HXX
+#include <wrtsh.hxx> // active window
#include <view.hxx>
-#endif
#include <swmodule.hxx>
@@ -66,8 +63,8 @@ using namespace ::com::sun::star::beans;
// ---------------------------------------------------------------------------
/*--------------------------------------------------------------------
- Beschreibung: Ist das Datenbankfeld numerisch?
- Anm: Im Fehlerfall wird sal_True returnt.
+ Description: Is the database field numeric?
+ remark: in case of error sal_True is returned
--------------------------------------------------------------------*/
sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
@@ -92,7 +89,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
if(xTSupplier.is())
{
Reference<XNameAccess> xTbls = xTSupplier->getTables();
- DBG_ASSERT(xTbls->hasByName(rTblQryName), "table not available anymore?");
+ OSL_ENSURE(xTbls->hasByName(rTblQryName), "table not available anymore?");
try
{
Any aTable = xTbls->getByName(rTblQryName);
@@ -109,7 +106,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
if(xQSupplier.is())
{
Reference<XNameAccess> xQueries = xQSupplier->getQueries();
- DBG_ASSERT(xQueries->hasByName(rTblQryName), "table not available anymore?");
+ OSL_ENSURE(xQueries->hasByName(rTblQryName), "table not available anymore?");
try
{
Any aQuery = xQueries->getByName(rTblQryName);
@@ -130,7 +127,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
}
catch(Exception& )
{
- DBG_ERROR("Exception in getColumns()");
+ OSL_FAIL("Exception in getColumns()");
}
if(xCols.is() && xCols->hasByName(rFldName))
{
@@ -182,3 +179,4 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index bacee1ee3a5e..2843aa98d64f 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,25 +51,18 @@
#include <fmtclds.hxx>
#include <swtypes.hxx>
#include <swmodule.hxx>
-#include <errhdl.hxx> // fuer Create-Methoden
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wdocsh.hxx>
#include <viewopt.hxx>
#include <pgfnote.hxx>
-#ifndef _PGFGRID_HXX
#include <pggrid.hxx>
-#endif
-#ifndef _TMPDLG_HXX
-#include <tmpdlg.hxx> // der Dialog
-#endif
-#include <column.hxx> // Spalten
-#include <drpcps.hxx> // Initialen
-#include <frmpage.hxx> // Rahmen
-#include <wrap.hxx> // Rahmen
-#include <frmmgr.hxx> // Rahmen
+#include <tmpdlg.hxx> // the dialog
+#include <column.hxx> // columns
+#include <drpcps.hxx> // initials
+#include <frmpage.hxx> // frames
+#include <wrap.hxx> // frames
+#include <frmmgr.hxx> // frames
#include <ccoll.hxx> // CondColl
#include <swuiccoll.hxx>
#include <docstyle.hxx> //
@@ -77,19 +71,12 @@
#include <poolfmt.hxx>
#include <uitool.hxx>
#include <shellres.hxx>
+#include <swabstdlg.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FMTUI_HRC
#include <fmtui.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include <svx/svxids.hrc>
#include <svl/stritem.hxx>
@@ -104,7 +91,7 @@
extern SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
/*--------------------------------------------------------------------
- Beschreibung: Der Traeger des Dialoges
+ Description: the dialog's carrier
--------------------------------------------------------------------*/
SwTemplateDlg::SwTemplateDlg(Window* pParent,
@@ -126,31 +113,31 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell());
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
- // TabPages zusammenfieseln
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
+ // tinker TabPages together
switch( nRegion )
{
- // Zeichenvorlagen
+ // character styles
case SFX_STYLE_FAMILY_CHAR:
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
SvtCJKOptions aCJKOptions;
@@ -158,44 +145,44 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
RemoveTabPage(TP_CHAR_TWOLN);
}
break;
- // Absatzvorlagen
+ // paragraph styles
case SFX_STYLE_FAMILY_PARA:
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_STD, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_EXT, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
AddTabPage( TP_TABULATOR, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
@@ -203,11 +190,11 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SwParagraphNumTabPage::GetRanges);
AddTabPage(TP_DROPCAPS, SwDropCapsPage::Create,
SwDropCapsPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
AddTabPage( TP_CONDCOLL, SwCondCollPage::Create,
@@ -219,8 +206,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SvtCJKOptions aCJKOptions;
if(nHtmlMode & HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!rHtmlOpt.IsPrintLayoutExtension())
RemoveTabPage(TP_PARA_EXT);
RemoveTabPage(TP_PARA_ASIAN);
RemoveTabPage(TP_TABULATOR);
@@ -243,7 +230,7 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
}
}
break;
- // Rahmenvorlagen
+ // frame styles
case SFX_STYLE_FAMILY_FRAME:
{
AddTabPage(TP_FRM_STD, SwFrmPage::Create,
@@ -252,11 +239,11 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SwFrmAddPage::GetRanges );
AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create,
SwWrapTabPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
AddTabPage(TP_COLUMN, SwColumnPage::Create,
@@ -264,22 +251,13 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
- // Auskommentiert wegen Bug #45776 (per default keine Breite&Groesse in Rahmenvorlagen)
-/* SwFmtFrmSize aSize( (const SwFmtFrmSize&)rBase.
- GetItemSet().Get(RES_FRM_SIZE));
- if( !aSize.GetWidth() )
- {
- aSize.SetWidth( DFLT_WIDTH );
- aSize.SetHeight( DFLT_HEIGHT );
- rBase.GetItemSet().Put( aSize );
- }*/
break;
}
- // Seitenvorlagen
+ // page styles
case SFX_STYLE_FAMILY_PAGE:
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
AddTabPage(TP_HEADER_PAGE, String(SW_RES(STR_PAGE_HEADER)),
SvxHeaderPage::Create,
@@ -290,17 +268,17 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
if(bColumn)
SetCurPageId(TP_COLUMN);
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_PAGE_STD, String(SW_RES(STR_PAGE_STD)),
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ),
pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ),
sal_False,
- 1 ); // nach der Verwalten-Page
+ 1 ); // after the manage-page
if(!pActShell || 0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell()))
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
AddTabPage(TP_BORDER, String(SW_RES(STR_PAGE_BORDER)),
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
AddTabPage(TP_COLUMN, String(SW_RES(STR_PAGE_COLUMN)),
@@ -320,7 +298,7 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
}
break;
- // Numerierungsvorlagen
+ // numbering styles
case SFX_STYLE_FAMILY_PSEUDO:
{
AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM );
@@ -330,34 +308,31 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
AddTabPage( RID_SVXPAGE_NUM_OPTIONS );
AddTabPage( RID_SVXPAGE_NUM_POSITION );
-
-/* const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState(
- FN_PARAM_ACT_NUMBER, sal_False, &pItem ))
- {
-// pActNum = (ActNumberFormat*)((const SwPtrItem*)pItem)->GetValue();
- }
-*/
}
break;
default:
- ASSERT(!this, "Falsche Familie");
+ OSL_ENSURE(!this, "wrong family");
}
+ EnableApplyButton( true );
+ SetApplyHandler( LINK(this, SwTemplateDlg, ApplyHdl ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwTemplateDlg::~SwTemplateDlg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+IMPL_LINK( SwTemplateDlg, ApplyHdl, void*, pVoid )
+{
+ (void)pVoid; //unused
+ if ( OK_Impl() )
+ {
+ Ok();
+ EndDialog( RET_APPLY_TEMPLATE );
+ }
+ return 0;
+}
short SwTemplateDlg::Ok()
{
@@ -380,15 +355,11 @@ short SwTemplateDlg::Ok()
}
else
//JP 09.01.98 Bug #46446#:
- // das ist der Ok - Handler also muss auf OK defaultet werden!
+ // that's the Ok-Handler, so OK has to be default!
nRet = RET_OK;
return nRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
const SfxItemSet* SwTemplateDlg::GetRefreshedSet()
{
SfxItemSet* pInSet = GetInputSetImpl();
@@ -397,13 +368,9 @@ const SfxItemSet* SwTemplateDlg::GetRefreshedSet()
return pInSet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
- //Namen der Vorlagen und Metric setzen
+ // set style's and metric's names
String sNumCharFmt, sBulletCharFmt;
SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt);
SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt);
@@ -413,7 +380,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
case TP_CHAR_STD:
{
- ASSERT(::GetActiveView(), "keine View aktiv");
+ OSL_ENSURE(::GetActiveView(), "no active view");
SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()->
GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
@@ -538,10 +505,10 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
case TP_PAGE_STD:
if(0 == (nHtmlMode & HTMLMODE_ON ))
{
- List aList;
- String* pNew = new String;
- SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, *pNew );
- aList.Insert( pNew, (sal_uLong)0 );
+ std::vector<String> aList;
+ String aNew;
+ SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, aNew );
+ aList.push_back( aNew );
if( pWrtShell )
{
SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->
@@ -550,15 +517,12 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
while(pFirstStyle)
{
- aList.Insert( new String(pFirstStyle->GetName()),
- aList.Count());
+ aList.push_back( pFirstStyle->GetName() );
pFirstStyle = pStyleSheetPool->Next();
}
}
aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (String*)aList.Remove(i);
}
break;
@@ -584,25 +548,21 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
- // Zeichenvorlagen sammeln
+ // collect character styles
ListBox rCharFmtLB(this);
rCharFmtLB.Clear();
rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
::FillCharStyleListBox(rCharFmtLB, pDocShell);
- List aList;
+
+ std::vector<String> aList;
for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
- {
+ aList.push_back( rCharFmtLB.GetEntry(j) );
- aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
- }
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (XubString*)aList.Remove(i);
- aList.Clear();
}
break;
case RID_SVXPAGE_NUM_POSITION:
@@ -645,3 +605,4 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src
index da2479717373..b9cde9c9494c 100644
--- a/sw/source/ui/fmtui/tmpdlg.src
+++ b/sw/source/ui/fmtui/tmpdlg.src
@@ -89,7 +89,6 @@ TabDialog DLG_TEMPLATE_2
PageItem
{
Identifier = TP_PARA_STD ;
- /* ### ACHTUNG: Neuer Text in Resource? Einzüge und Abstände : Einz³ge und Abstõnde */
Text [ en-US ] = "Indents & Spacing" ;
PageResID = TP_PARA_STD ;
};
@@ -102,7 +101,6 @@ TabDialog DLG_TEMPLATE_2
PageItem
{
Identifier = TP_PARA_EXT ;
- /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/
Text [ en-US ] = "Text Flow" ;
PageResID = TP_PARA_EXT ;
};
@@ -253,7 +251,6 @@ String STR_PAGE_HEADER
};
String STR_PAGE_FOOTER
{
- /* ### ACHTUNG: Neuer Text in Resource? Fußzeile : Fu˜zeile */
Text [ en-US ] = "Footer" ;
};
String STR_PAGE_TEXTGRID
@@ -266,7 +263,6 @@ String STR_PAGE_COLUMN
};
String STR_PAGE_FOOTNOTE
{
- /* ### ACHTUNG: Neuer Text in Resource? Fußnote : Fu˜note */
Text [ en-US ] = "Footnote" ;
};
TabDialog DLG_TEMPLATE_3
@@ -300,7 +296,6 @@ TabDialog DLG_TEMPLATE_3
{
Identifier = TP_FRM_ADD ;
PageResID = TP_FRM_ADD ;
- /* ### ACHTUNG: Neuer Text in Resource? Zusätze : Zusõtze */
Text [ en-US ] = "Options" ;
};
PageItem
diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx
index f9b3a678f8f2..e2e8b8a292ba 100644
--- a/sw/source/ui/frmdlg/colex.cxx
+++ b/sw/source/ui/frmdlg/colex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@
#include "colmgr.hxx"
/*-----------------------------------------------------------------------
- Beschreibung: Uebernahme der aktualisierten Werte aus dem Set
+ Description: Taking the updated values from the set
-----------------------------------------------------------------------*/
void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{
@@ -61,7 +62,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
{
- // Ausrichtung
+ // alignment
pPage = (const SvxPageItem*)&rSet.Get( nWhich );
if ( pPage )
@@ -72,14 +73,14 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
{
- // Orientation und Size aus dem PageItem
+ // orientation and size from PageItem
const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get( nWhich );
SetSize( rSize.GetSize() );
}
nWhich = RES_LR_SPACE;
if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
{
- // linken und rechten Rand einstellen
+ // set left and right border
const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)rSet.Get( nWhich );
SetLeft( rLRSpace.GetLeft() );
@@ -95,7 +96,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
{
- // oberen und unteren Rand einstellen
+ // set upper and lower border
const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)rSet.Get( nWhich );
SetTop( rULSpace.GetUpper() );
@@ -108,7 +109,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
}
- // Kopfzeilen-Attribute auswerten
+ // evaluate header-attributes
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_HEADERSET),
sal_False, &pItem ) )
@@ -204,10 +205,6 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
Invalidate();
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
void SwColExample::DrawPage( const Point& rOrg,
const sal_Bool bSecond,
@@ -222,7 +219,7 @@ void SwColExample::DrawPage( const Point& rOrg,
if ( GetUsage() == SVX_PAGE_MIRROR && !bSecond )
{
- // fuer gespiegelt drehen
+ // rotate for mirrored
nL = GetRight();
nR = GetLeft();
}
@@ -307,11 +304,6 @@ void SwColExample::DrawPage( const Point& rOrg,
}
}
-/*-----------------25.10.96 09.15-------------------
-
---------------------------------------------------*/
-
-
SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId) :
Window(pParent, rResId),
m_aFrmSize(1,1)
@@ -336,11 +328,6 @@ SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId)
SetMapMode( aMapMode );
}
-/*-----------------25.10.96 09.16-------------------
-
---------------------------------------------------*/
-
-
void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -373,7 +360,7 @@ void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ )
SetFillColor( aGrayColor );
- //Spaltentrenner?
+ //column seperator?
long nLength = aLogSize.Height() - 2 * aTL.Y();
Point aUp( aTL );
Point aDown( aTL.X(), nLength );
@@ -429,11 +416,6 @@ void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ )
}
}
-/*-----------------25.10.96 12.05-------------------
-
---------------------------------------------------*/
-
-
void SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol)
{
m_aCols = rCol;
@@ -477,16 +459,12 @@ void SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol)
}
}
}
-/* -----------------------------08.02.2002 11:44------------------------------
- ---------------------------------------------------------------------------*/
SwPageGridExample::~SwPageGridExample()
{
delete pGridItem;
}
-/* -----------------------------08.02.2002 11:48------------------------------
- ---------------------------------------------------------------------------*/
#define MAX_ROWS 10
#define MAX_LINES 15
void SwPageGridExample::DrawPage( const Point& rOrg,
@@ -509,7 +487,7 @@ void SwPageGridExample::DrawPage( const Point& rOrg,
if ( GetUsage() == SVX_PAGE_MIRROR && !bSecond )
{
- // fuer gespiegelt drehen
+ // rotate for mirrored
nL = GetRight();
nR = GetLeft();
}
@@ -589,9 +567,7 @@ void SwPageGridExample::DrawPage( const Point& rOrg,
}
}
}
-/* -----------------------------08.02.2002 11:48------------------------------
- ---------------------------------------------------------------------------*/
void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
{
DELETEZ(pGridItem);
@@ -608,3 +584,4 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
SwPageExample::UpdateExample(rSet);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx
index 90f695aa8ae5..856b00832cf5 100644
--- a/sw/source/ui/frmdlg/colmgr.cxx
+++ b/sw/source/ui/frmdlg/colmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,13 +39,10 @@
#include "colmgr.hxx"
-// PRIVATE METHODES ------------------------------------------------------
+// private methods
/*------------------------------------------------------------------------
- Beschreibung: Spaltenbreite auf aktuelle Breite einstellen
+ Description: set column width to current width
------------------------------------------------------------------------*/
-
-
-
void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth)
{
const sal_uInt16 nCount = rCol.GetColumns().Count();
@@ -56,14 +54,10 @@ void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth)
rCol.SetWishWidth(nWidth);
}
-
-// PUBLIC METHODES -------------------------------------------------------
+// public methods
/*------------------------------------------------------------------------
- Beschreibung: Setzen Spaltenanzahl und Gutterwidth
+ Description: set column quantity and Gutterwidth
------------------------------------------------------------------------*/
-
-
-
void SwColMgr::SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth)
{
aFmtCol.Init(nCount, nGutterWidth, nWidth);
@@ -71,8 +65,6 @@ void SwColMgr::SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth)
aFmtCol.SetGutterWidth(nGutterWidth, nWidth);
}
-
-
sal_uInt16 SwColMgr::GetGutterWidth( sal_uInt16 nPos ) const
{
sal_uInt16 nRet;
@@ -80,25 +72,20 @@ sal_uInt16 SwColMgr::GetGutterWidth( sal_uInt16 nPos ) const
nRet = GetCount() > 1 ? aFmtCol.GetGutterWidth() : DEF_GUTTER_WIDTH;
else
{
- DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+ OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
const SwColumns& rCols = aFmtCol.GetColumns();
nRet = rCols.GetObject(nPos)->GetRight() + rCols.GetObject(nPos + 1)->GetLeft();
}
return nRet;
}
-/*-----------------22.10.96 14.28-------------------
-
---------------------------------------------------*/
-
-
void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, sal_uInt16 nPos )
{
if(nPos == USHRT_MAX)
aFmtCol.SetGutterWidth(nGutterWidth, nWidth);
else
{
- DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+ OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
SwColumns& rCols = aFmtCol.GetColumns();
sal_uInt16 nGutterWidth2 = nGutterWidth / 2;
rCols.GetObject(nPos)->SetRight(nGutterWidth2);
@@ -107,50 +94,38 @@ void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, sal_uInt16 nPos )
}
/*------------------------------------------------------------------------
- Beschreibung: Hoehe Trennlinie
+ Description: height seperation line
------------------------------------------------------------------------*/
-
-
-
short SwColMgr::GetLineHeightPercent() const
{
return (short)aFmtCol.GetLineHeight();
}
-
-
void SwColMgr::SetLineHeightPercent(short nPercent)
{
- ASSERT(nPercent <= 100, LineHeight darf nur bis 100 % gross sein);
+ OSL_ENSURE(nPercent <= 100, "line height may only be 100 \%");
aFmtCol.SetLineHeight((sal_uInt8)nPercent);
}
+
/*------------------------------------------------------------------------
- Beschreibung: Spaltenbreite
+ Description: column width
------------------------------------------------------------------------*/
-
-
-
sal_uInt16 SwColMgr::GetColWidth(sal_uInt16 nIdx) const
{
- ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+ OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
return aFmtCol.CalcPrtColWidth(nIdx, nWidth);
}
-
-
void SwColMgr::SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWd)
{
- ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+ OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
aFmtCol.GetColumns()[nIdx]->SetWishWidth(nWd);
}
/*--------------------------------------------------------------------
- Beschreibung: Groesse neu setzen
+ Description: newly set size
--------------------------------------------------------------------*/
-
-
-
void SwColMgr::SetActualWidth(sal_uInt16 nW)
{
nWidth = nW;
@@ -158,11 +133,8 @@ void SwColMgr::SetActualWidth(sal_uInt16 nW)
}
/*--------------------------------------------------------------------
- Beschreibung: ctor
+ Description: ctor
--------------------------------------------------------------------*/
-
-
-
SwColMgr::SwColMgr(const SfxItemSet& rSet, sal_uInt16 nActWidth) :
aFmtCol((const SwFmtCol&)rSet.Get(RES_COL)),
nWidth(nActWidth)
@@ -179,13 +151,15 @@ SwColMgr::SwColMgr(const SfxItemSet& rSet, sal_uInt16 nActWidth) :
::FitToActualSize(aFmtCol, nWidth);
}
+SwColMgr::~SwColMgr()
+{
+}
+void SwColMgr::SetLineWidthAndColor(::editeng::SvxBorderStyle eStyle, sal_uLong nLWidth, const Color& rCol)
+{
+ aFmtCol.SetLineStyle(eStyle);
+ aFmtCol.SetLineWidth(nLWidth);
+ aFmtCol.SetLineColor(rCol);
+}
-
-SwColMgr::~SwColMgr() {}
-
-
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 9859f4875b46..010b8e8407c5 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,11 @@
#include "column.hxx"
#include "hintids.hxx"
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
#include <svx/htmlmode.hxx>
+#include <svx/xtable.hxx>
+#include <svx/drawitem.hxx>
#include <editeng/borderline.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/lrspitem.hxx>
@@ -45,6 +50,7 @@
#include <sfx2/dispatch.hxx>
#include <vcl/msgbox.hxx>
#include <swmodule.hxx>
+#include <sal/macros.h>
#include <helpid.h>
#include "globals.hrc"
@@ -76,18 +82,9 @@
SV_IMPL_PTRARR( SwColumns, SwColumnPtr )
/*--------------------------------------------------------------------
- Beschreibung: Statische Daten
+ Description: static data
--------------------------------------------------------------------*/
-static const sal_uInt16 __FAR_DATA nLines[] = {
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_1,
- DEF_LINE_WIDTH_2,
- DEF_LINE_WIDTH_3,
- DEF_LINE_WIDTH_4
-};
-
-static const sal_uInt16 nLineCount = sizeof(nLines) / sizeof(nLines[0]);
static const sal_uInt16 nVisCols = 3;
inline sal_Bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
@@ -98,10 +95,6 @@ inline sal_Bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
SfxModalDialog(pParent, SW_RES(DLG_COLUMN)),
aOK(this, SW_RES(PB_OK)),
@@ -129,7 +122,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
nSelectionWidth = aRect.Width();
SfxItemSet* pColPgSet = 0;
- static sal_uInt16 __READONLY_DATA aSectIds[] = { RES_COL, RES_COL,
+ static sal_uInt16 const aSectIds[] = { RES_COL, RES_COL,
RES_FRM_SIZE, RES_FRM_SIZE,
RES_COLUMNBALANCE, RES_FRAMEDIR,
0 };
@@ -145,14 +138,14 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
pSectionSet->Put( pCurrSection->GetFmt()->GetAttrSet() );
pColPgSet = pSectionSet;
aApplyToLB.RemoveEntry( aApplyToLB.GetEntryPos(
- (void*)( 1 >= nFullSectCnt
+ (void*)(sal_IntPtr)( 1 >= nFullSectCnt
? LISTBOX_SECTIONS
: LISTBOX_SECTION )));
}
else
{
- aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTION ));
- aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTIONS ));
+ aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTION ));
+ aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTIONS ));
}
if( rWrtShell.HasSelection() && rWrtShell.IsInsRegionAvailable() &&
@@ -163,7 +156,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
pColPgSet = pSelectionSet;
}
else
- aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SELECTION ));
+ aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SELECTION ));
if( rWrtShell.GetFlyFrmFmt() )
{
@@ -207,14 +200,13 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
else
aApplyToLB.RemoveEntry( nPagePos );
-
- ASSERT( pColPgSet, "" );
- // TabPage erzeugen
+ OSL_ENSURE( pColPgSet, "" );
+ // create TabPage
SwColumnPage* pPage = (SwColumnPage*) SwColumnPage::Create( this,
*pColPgSet );
pTabPage = pPage;
- //Groesse anpassen
+ // adjust size
Size aPageSize(pTabPage->GetSizePixel());
Size aDlgSize(GetOutputSizePixel());
aDlgSize.Height() = aPageSize.Height();
@@ -233,10 +225,6 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
pTabPage->ActivateColumnControl();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwColumnDlg::~SwColumnDlg()
{
delete pTabPage;
@@ -245,9 +233,6 @@ SwColumnDlg::~SwColumnDlg()
delete pSelectionSet;
}
-/* -----------------26.05.99 11:40-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox)
{
SfxItemSet* pSet = 0;
@@ -310,12 +295,10 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox)
pTabPage->Reset(*pSet);
return 0;
}
-/* -----------------26.05.99 12:32-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG)
{
- //aktuelle Selektion auswerten
+ // evaluate current selection
SfxItemSet* pSet = 0;
switch(nOldSelection)
{
@@ -343,9 +326,9 @@ IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG)
if(pSelectionSet && SFX_ITEM_SET == pSelectionSet->GetItemState(RES_COL))
{
- //Bereich mit Spalten einfuegen
+ //insert region with columns
const SwFmtCol& rColItem = (const SwFmtCol&)pSelectionSet->Get(RES_COL);
- //nur, wenn es auch Spalten gibt!
+ //only if there actually are columns!
if(rColItem.GetNumCols() > 1)
rWrtShell.GetView().GetViewFrame()->GetDispatcher()->Execute(
FN_INSERT_REGION, SFX_CALLMODE_ASYNCHRON, *pSelectionSet );
@@ -367,7 +350,7 @@ IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG)
if(pPageSet && SFX_ITEM_SET == pPageSet->GetItemState(RES_COL) && bPageChanged)
{
- // aktuellen PageDescriptor ermitteln und damit den Set fuellen
+ // deterine current PageDescriptor and fill the Set with it
const sal_uInt16 nCurIdx = rWrtShell.GetCurPageDesc();
SwPageDesc aPageDesc(rWrtShell.GetPageDesc(nCurIdx));
SwFrmFmt &rFmt = aPageDesc.GetMaster();
@@ -381,7 +364,7 @@ IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG)
rWrtShell.StartAction();
rWrtShell.Push();
rWrtShell.SetFlyFrmAttr( aTmp );
- //die Rahmenselektion wieder aufheben
+ // undo the frame selction again
if(rWrtShell.IsFrmSelected())
{
rWrtShell.UnSelectFrm();
@@ -394,10 +377,6 @@ IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG)
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
#if OSL_DEBUG_LEVEL < 2
inline
#endif
@@ -409,27 +388,13 @@ sal_uInt16 GetMaxWidth( SwColMgr* pColMgr, sal_uInt16 nCols )
return nMax;
}
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
RES_COL, RES_COL,
0
};
-
DBG_NAME(columnhdl)
-
-
-sal_uInt16 lcl_LineWidthToPos(sal_uLong nWidth)
-{
- const sal_uInt16 nUShortWidth = (sal_uInt16)nWidth;
- for(sal_uInt16 i = 0; i < nLineCount; ++i)
- if(nUShortWidth == nLines[i])
- return i;
- return 0;
-}
-
-
-
void SwColumnPage::ResetColWidth()
{
if( nCols )
@@ -444,11 +409,8 @@ void SwColumnPage::ResetColWidth()
}
/*--------------------------------------------------------------------
- Beschreibung: Jetzt als TabPage
+ Description: Now as TabPage
--------------------------------------------------------------------*/
-
-
-
SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
: SfxTabPage(pParent, SW_RES(TP_COLUMN), rSet),
@@ -478,13 +440,15 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aFLLineType(this, SW_RES(FL_LINETYPE)),
aLineTypeLbl(this, SW_RES(FT_STYLE)),
aLineTypeDLB(this, SW_RES(LB_STYLE)),
+ aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
+ aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
+ aLineColorLbl(this, SW_RES(FT_COLOR)),
+ aLineColorDLB(this, SW_RES(LB_COLOR)),
aLineHeightLbl(this, SW_RES(FT_HEIGHT)),
aLineHeightEdit(this, SW_RES(ED_HEIGHT)),
aLinePosLbl(this, SW_RES(FT_POSITION)),
aLinePosDLB(this, SW_RES(LB_POSITION)),
- aVertFL(this, SW_RES(FL_VERT)),
- aPropertiesFL( this, SW_RES( FL_PROPERTIES )),
aTextDirectionFT( this, SW_RES( FT_TEXTDIRECTION )),
aTextDirectionLB( this, SW_RES( LB_TEXTDIRECTION )),
@@ -501,7 +465,7 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
bHtmlMode(sal_False),
bLockUpdate(sal_False)
{
- sal_uInt16 i;
+ long i;
FreeResource();
SetExchangeSupport();
@@ -526,7 +490,7 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aDefaultVS.SetSelectHdl(LINK(this, SwColumnPage, SetDefaultsHdl));
- // Controls fuer Zusaetzebereich beim MoreButton anmelden
+ // announce Controls for additional region at the MoreButton
Link aCLNrLk = LINK(this, SwColumnPage, ColModify);
aCLNrEdt.SetLoseFocusHdl(aCLNrLk);
aCLNrEdt.SetUpHdl(aCLNrLk);
@@ -559,28 +523,57 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aLk = LINK( this, SwColumnPage, UpdateColMgr );
aLineTypeDLB.SetSelectHdl( aLk );
+ aLineWidthEdit.SetModifyHdl( aLk );
+ aLineColorDLB.SetSelectHdl( aLk );
aLineHeightEdit.SetModifyHdl( aLk );
aLinePosDLB.SetSelectHdl( aLk );
- // Trennlinie
+ // Separator line
aLineTypeDLB.SetUnit( FUNIT_POINT );
aLineTypeDLB.SetSourceUnit( FUNIT_TWIP );
- for( i = 0; i < nLineCount; ++i )
- aLineTypeDLB.InsertEntry( 100 * nLines[ i ] );
-}
+ // Fill the line styles listbox
+ aLineTypeDLB.SetNone( SVX_RESSTR( RID_SVXSTR_NONE ) );
+ aLineTypeDLB.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::SOLID ), ::editeng::SOLID );
+ aLineTypeDLB.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DOTTED ), ::editeng::DOTTED );
+ aLineTypeDLB.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DASHED ), ::editeng::DASHED );
+
+ long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
+ aLineTypeDLB.SetWidth( nLineWidth );
+
+ // Fill the color listbox
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ const SfxPoolItem* pItem = NULL;
+ XColorTable* pColorTable = NULL;
+ if ( pDocSh )
+ {
+ pItem = pDocSh->GetItem( SID_COLOR_TABLE );
+ if ( pItem != NULL )
+ pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ }
+
+ if ( pColorTable )
+ {
+ aLineColorDLB.SetUpdateMode( sal_False );
+ for ( i = 0; i < pColorTable->Count(); ++i )
+ {
+ XColorEntry* pEntry = pColorTable->GetColor(i);
+ aLineColorDLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ }
+ aLineColorDLB.SetUpdateMode( sal_True );
+ }
+ aLineColorDLB.SelectEntryPos( 0 );
+}
SwColumnPage::~SwColumnPage()
{
delete pColMgr;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwColumnPage::SetPageWidth(long nPageWidth)
{
long nNewMaxWidth = static_cast< long >(aEd1.NormalizePercent(nPageWidth));
@@ -592,12 +585,6 @@ void SwColumnPage::SetPageWidth(long nPageWidth)
aEd3.SetMax(nNewMaxWidth, FUNIT_TWIP);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwColumnPage::Reset(const SfxItemSet &rSet)
{
sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
@@ -621,7 +608,7 @@ void SwColumnPage::Reset(const SfxItemSet &rSet)
if(bFrm)
{
- if(bFormat) // hier gibt es keine Size
+ if(bFormat) // there is no size here
pColMgr->SetActualWidth(FRAME_FORMAT_WIDTH);
else
{
@@ -643,7 +630,7 @@ void SwColumnPage::Reset(const SfxItemSet &rSet)
if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( RES_FRAMEDIR ) )
{
const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR);
- sal_uInt32 nVal = rItem.GetValue();
+ sal_uIntPtr nVal = rItem.GetValue();
sal_uInt16 nPos = aTextDirectionLB.GetEntryPos( (void*) nVal );
aTextDirectionLB.SelectEntryPos( nPos );
aTextDirectionLB.SaveValue();
@@ -654,29 +641,22 @@ void SwColumnPage::Reset(const SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: TabPage erzeugen
+ Description: create TabPage
--------------------------------------------------------------------*/
-
-
-
SfxTabPage* SwColumnPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwColumnPage(pParent, rSet);
}
/*--------------------------------------------------------------------
- Beschreibung: Attribute in den Set stopfen bei OK
+ Description: stuff attributes into the Set when OK
--------------------------------------------------------------------*/
-
-
-
sal_Bool SwColumnPage::FillItemSet(SfxItemSet &rSet)
{
if(aCLNrEdt.HasChildPathFocus())
aCLNrEdt.GetDownHdl().Call(&aCLNrEdt);
- // Im ItemSet setzen
- // Die aktuellen Einstellungen sind
- // schon vorhanden
+ // set in ItemSet setzen
+ // the current settings are already present
//
const SfxPoolItem* pOldItem;
const SwFmtCol& rCol = pColMgr->GetColumns();
@@ -700,18 +680,15 @@ sal_Bool SwColumnPage::FillItemSet(SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: ColumnManager updaten
+ Description: update ColumnManager
--------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
{
long nGutterWidth = pColMgr->GetGutterWidth();
if(nCols > 1)
{
- // Ermitteln, ob die schmalste Spalte zu schmal ist
- // fuer den eingestellten Spaltenabstand
+ // Determine whether the most narrow column is too narrow
+ // for the adjusted column gap
long nMin = nColWidth[0];
sal_uInt16 i;
@@ -722,8 +699,8 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
if(!bAutoWidth)
{
pColMgr->SetAutoWidth(sal_False);
- // falls der Benutzer nicht die Gesamtbreite vergeben hat,
- // den fehlenden Betrag auf die letzte Spalte addieren.
+ // when the user didn't allocate the whole width,
+ // add the missing amount to the last column.
long nSum = 0;
for(i = 0; i < nCols; ++i)
nSum += nColWidth[i];
@@ -747,16 +724,23 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
}
- // keins ist ausgeschaltet
+ // nothing is turned off
const sal_uInt16 nPos = aLineTypeDLB.GetSelectEntryPos();
sal_Bool bEnable = 0 != nPos;
aLineHeightEdit.Enable( bEnable );
aLineHeightLbl.Enable( bEnable );
+ long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
if( !bEnable )
pColMgr->SetNoLine();
else if( LISTBOX_ENTRY_NOTFOUND != nPos )
{
- pColMgr->SetLineWidthAndColor(nLines[nPos - 1], Color(COL_BLACK) );
+ pColMgr->SetLineWidthAndColor(
+ ::editeng::SvxBorderStyle( aLineTypeDLB.GetSelectEntryStyle( ) ),
+ nLineWidth,
+ aLineColorDLB.GetSelectEntryColor() );
pColMgr->SetAdjust( SwColLineAdj(
aLinePosDLB.GetSelectEntryPos() + 1) );
pColMgr->SetLineHeightPercent((short)aLineHeightEdit.GetValue());
@@ -764,6 +748,9 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
}
aLinePosLbl.Enable( bEnable );
aLinePosDLB.Enable( bEnable );
+
+ aLineTypeDLB.SetWidth( nLineWidth );
+ aLineTypeDLB.SetColor( aLineColorDLB.GetSelectEntryColor( ) );
}
else
{
@@ -771,13 +758,13 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
nCols = 0;
}
- //Maximalwerte setzen
+ //set maximum values
aCLNrEdt.SetMax(Max(1L,
Min(long(nMaxCols), long( pColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
aCLNrEdt.SetLast(aCLNrEdt.GetMax());
aCLNrEdt.Reformat();
- //Beispielfenster anregen
+ //prompt example window
if(!bLockUpdate)
{
if(bFrm)
@@ -793,11 +780,8 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
}
/*------------------------------------------------------------------------
- Beschreibung: Initialisierung
+ Description: Initialisation
------------------------------------------------------------------------*/
-
-
-
void SwColumnPage::Init()
{
aCLNrEdt.SetValue(nCols);
@@ -806,7 +790,7 @@ void SwColumnPage::Init()
aAutoWidthBox.Check( bAutoWidth );
sal_Int32 nColumnWidthSum = 0;
- // Setzen der Breiten
+ // set the widths
sal_uInt16 i;
for(i = 0; i < nCols; ++i)
{
@@ -826,17 +810,22 @@ void SwColumnPage::Init()
nColWidth[i] = nColumnWidthSum;
}
SwColLineAdj eAdj = pColMgr->GetAdjust();
- if( COLADJ_NONE == eAdj ) // der Dialog kennt kein NONE!
+ if( COLADJ_NONE == eAdj ) // the dialog doesn't know a NONE!
{
eAdj = COLADJ_TOP;
- //ohne Adjust auch kein Linientyp
+ //without Adjust no line type
aLineTypeDLB.SelectEntryPos( 0 );
aLineHeightEdit.SetValue( 100 );
}
else
{
- aLineTypeDLB.SelectEntryPos( lcl_LineWidthToPos(( pColMgr->GetLineWidth() )) + 1);
+ // Need to multiply by 100 because of the 2 decimals
+ aLineWidthEdit.SetValue( pColMgr->GetLineWidth() * 100, FUNIT_TWIP );
+ aLineColorDLB.SelectEntry( pColMgr->GetLineColor() );
+ aLineTypeDLB.SelectEntry( pColMgr->GetLineStyle() );
+ aLineTypeDLB.SetWidth( pColMgr->GetLineWidth( ) );
aLineHeightEdit.SetValue( pColMgr->GetLineHeightPercent() );
+
}
aLinePosDLB.SelectEntryPos( static_cast< sal_uInt16 >(eAdj - 1) );
}
@@ -850,25 +839,21 @@ void SwColumnPage::Init()
UpdateCols();
Update();
- // Maximale Spaltenzahl setzen
- // Werte kleiner als 1 sind nicht erlaubt
+ // set maximum number of columns
+ // values below 1 are not allowed
aCLNrEdt.SetMax(Max(1L,
Min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) )));
}
/*------------------------------------------------------------------------
- Beschreibung: Die Anzahl der Spalten hat sich veraendert -- hier werden
- die Controls fuer die Bearbeitung der Spalten entsprechend
- der Spaltenzahl en- oder disabled.
- Falls es mehr als nVisCols (= 3) Spalten gibt, werden
- alle Edit enabled und die Buttons fuer das Scrollen
- ebenfalls.
- Andernfalls werden die Edits jeweils fuer die entsprechenden
- Spaltenzahl enabled; eine Spalte kann nicht bearbeitet werden.
+ Description: The number of columns has changed -- here the controls for
+ editing of the columns are en- or disabled according to the
+ column number.
+ In case there are more than nVisCols (=3) all Edit are being
+ enabled and the buttons for scrolling too.
+ Otherwise Edits are being enabled according to the column
+ numbers; one column can not be edited.
------------------------------------------------------------------------*/
-
-
-
void SwColumnPage::UpdateCols()
{
sal_Bool bEnableBtns= sal_False;
@@ -882,7 +867,7 @@ void SwColumnPage::UpdateCols()
}
else if( bEdit )
{
- // hier gibt es absichtlich kaum noch breaks
+ // here are purposely hardly any breaks
switch(nCols)
{
case 3: bEnable3 = sal_True;
@@ -911,6 +896,10 @@ void SwColumnPage::UpdateCols()
aLineHeightLbl.Enable( bEnable );
aLineTypeDLB.Enable( bEnable );
aLineTypeLbl.Enable( bEnable );
+ aLineWidthLbl.Enable( bEnable );
+ aLineWidthEdit.Enable( bEnable );
+ aLineColorDLB.Enable( bEnable );
+ aLineColorLbl.Enable( bEnable );
aAutoWidthBox.Enable( bEnable && !bHtmlMode );
}
@@ -957,13 +946,10 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis )
}
/*------------------------------------------------------------------------
- Beschreibung: Handler, der bei einer Veraenderung der Spaltenzahl
- gerufen wird.
- Eine Aenderung der Spaltenzahl ueberschreibt eventuelle
- Breiteneinstellungen des Benutzers; alle Spalten sind
- gleich breit.
+ Description: Handler that is called at alteration of the column number.
+ An alteration of the column number overwrites potential
+ user's width settings; all columns are equally wide.
------------------------------------------------------------------------*/
-
IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF )
{
nCols = (sal_uInt16)aCLNrEdt.GetValue();
@@ -991,17 +977,13 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF )
}
/*------------------------------------------------------------------------
- Beschreibung: Modify- Handler fuer eine Aenderung der Spaltenbreite
- oder des Spaltenabstandes.
- Diese Aenderungen wirken sich erst zeitversetzt aus.
- Durch eine Aenderung der Spaltenbreite wird die automatische
- Berechnung der Spaltenbreite ausser Kraft gesetzt; erst
- eine Aenderung der Spaltenzahl kehrt wieder zu diesem
- Default zurueck.
+ Description: Modify handler for an alteration of the column width or
+ the column gap.
+ These changes take effect time-displaced. With an
+ alteration of the column width the automatic calculation
+ of the column width is overruled; only an alteration
+ of the column number leads back to that default.
------------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
{
long nActValue = static_cast< long >(pFld->DenormalizePercent(pFld->GetValue(FUNIT_TWIP)));
@@ -1010,7 +992,7 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
if(aAutoWidthBox.IsChecked())
{
sal_uInt16 nMaxGap = pColMgr->GetActualSize() - nCols * MINLAY;
- DBG_ASSERT(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
+ OSL_ENSURE(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
nMaxGap /= nCols - 1;
if(nActValue > nMaxGap)
{
@@ -1073,26 +1055,18 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwColumnPage, EdModify, PercentField *, pField )
{
pModifiedField = pField;
Timeout(0);
return 0;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Handler hinter der Checkbox fuer automatische Breite.
- Ist die Box gecheckt, koennen keine expliziten Werte
- fuer die Spaltenbreite eingegeben werden.
+ Description: Handler behind the Checkbox for automatic width.
+ When the box is checked no expicit values for the column
+ width can be entered.
------------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox )
{
long nDist = static_cast< long >(aDistEd1.DenormalizePercent(aDistEd1.GetValue(FUNIT_TWIP)));
@@ -1111,9 +1085,8 @@ IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox )
}
/*------------------------------------------------------------------------
- Beschreibung: Raufscrollen der Inhalte der Edits.
+ Description: scroll up the contents of the edits
------------------------------------------------------------------------*/
-
IMPL_LINK( SwColumnPage, Up, Button *, EMPTYARG )
{
if( nFirstVis )
@@ -1124,10 +1097,10 @@ IMPL_LINK( SwColumnPage, Up, Button *, EMPTYARG )
}
return 0;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Runterscrollen der Inhalte der Edits.
+ Description: scroll down the contents of the edits.
------------------------------------------------------------------------*/
-
IMPL_LINK( SwColumnPage, Down, Button *, EMPTYARG )
{
if( nFirstVis + nVisCols < nCols )
@@ -1138,31 +1111,29 @@ IMPL_LINK( SwColumnPage, Down, Button *, EMPTYARG )
}
return 0;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Relikt aus alten Zeiten - jetzt direkt ohne time
- * Timer- Handler; angetriggert durch eine Aenderung der
- Spaltenbreite oder des Spaltenabstandes.
+ Description: relict from ancient times - now directly without time
+ handler; triggered by an alteration of the column width
+ or the column gap.
------------------------------------------------------------------------*/
-
IMPL_LINK( SwColumnPage, Timeout, Timer *, EMPTYARG )
{
DBG_PROFSTART(columnhdl) ;
if(pModifiedField)
{
- // Finden der veraenderten Spalte
+ // find the changed column
sal_uInt16 nChanged = nFirstVis;
if(pModifiedField == &aEd2)
++nChanged;
else if(pModifiedField == &aEd3)
nChanged += 2;
- /*else if(pModifiedField == &aEd4)
- nChanged += 3;*/
long nNewWidth = (sal_uInt16)
pModifiedField->DenormalizePercent(pModifiedField->GetValue(FUNIT_TWIP));
long nDiff = nNewWidth - nColWidth[nChanged];
- // wenn es die letzte Spalte ist
+ // when it's the last column
if(nChanged == nCols - 1)
{
nColWidth[0] -= nDiff;
@@ -1189,12 +1160,10 @@ IMPL_LINK( SwColumnPage, Timeout, Timer *, EMPTYARG )
DBG_PROFSTOP(columnhdl) ;
return 0;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Aktualisierung der Anzeige
+ Description: Update the view
------------------------------------------------------------------------*/
-
-
-
void SwColumnPage::Update()
{
aBalanceColsCB.Enable(nCols > 1);
@@ -1226,11 +1195,8 @@ void SwColumnPage::Update()
}
/*--------------------------------------------------------------------
- Beschreibung: Update Bsp
+ Description: Update Bsp
--------------------------------------------------------------------*/
-
-
-
void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
{
if(!bFrm)
@@ -1269,7 +1235,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
long nDistance = rBox.GetDistance();
const sal_uInt16 nTotalWish = bFormat ? FRAME_FORMAT_WIDTH : sal_uInt16(rSize.GetWidth() - 2 * nDistance);
- // Maximalwerte der Spaltenbreiten setzen
+ // set maximum values of column width
SetPageWidth(nTotalWish);
if(pColMgr->GetActualSize() != nTotalWish)
@@ -1278,17 +1244,17 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
Init();
}
sal_Bool bPercent;
- // im Rahmenformat nur relative Angaben
+ // only relative data in frame format
if ( bFormat || (rSize.GetWidthPercent() && rSize.GetWidthPercent() != 0xff) )
{
- // Wert fuer 100% setzen
+ // set value for 100%
aEd1.SetRefValue(nTotalWish);
aEd2.SetRefValue(nTotalWish);
aEd3.SetRefValue(nTotalWish);
aDistEd1.SetRefValue(nTotalWish);
aDistEd2.SetRefValue(nTotalWish);
- // Auf %-Darstellung umschalten
+ // switch to %-view
bPercent = sal_True;
}
else
@@ -1305,12 +1271,6 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
Update();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
int SwColumnPage::DeactivatePage(SfxItemSet *_pSet)
{
if(_pSet)
@@ -1319,19 +1279,11 @@ int SwColumnPage::DeactivatePage(SfxItemSet *_pSet)
return sal_True;
}
-
-
sal_uInt16* SwColumnPage::GetRanges()
{
return aPageRg;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS )
{
sal_uInt16 nItem = pVS->GetSelectItemId();
@@ -1349,7 +1301,7 @@ IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS )
aAutoWidthBox.Check(sal_False);
aDistEd1.SetPrcntValue(0);
ColModify(0);
- // jetzt noch das Breitenverhaeltnisse auf 2 : 1 bzw. 1 : 2 stellen
+ // now set the width ratio to 2 : 1 or 1 : 2 respectively
sal_uInt16 nSmall = pColMgr->GetActualSize() / 3;
if(nItem == 4)
{
@@ -1368,49 +1320,20 @@ IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS )
return 0;
}
-/*-----------------25.10.96 11.41-------------------
-
---------------------------------------------------*/
-
-
void SwColumnPage::SetFrmMode(sal_Bool bMod)
{
bFrm = bMod;
}
-/* -----------------------------2002/06/19 13:08------------------------------
- ---------------------------------------------------------------------------*/
void SwColumnPage::SetInSection(sal_Bool bSet)
{
if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
return;
- aVertFL.Show(bSet);
- aPropertiesFL.Show(bSet);
aTextDirectionFT.Show(bSet);
aTextDirectionLB.Show(bSet);
- if(bSet)
- {
- //resize line type FixedLine
- Point aLtPos = aFLLineType.GetPosPixel();
- Point aPropPos = aPropertiesFL.GetPosPixel();
- Size aSz = aFLLineType.GetSizePixel();
- aSz.Width() = aPropPos.X() - aLtPos.X() - LogicToPixel(Size(8, 8), MAP_APPFONT).Width();
- aFLLineType.SetSizePixel(aSz);
- }
- else
- {
- Size aSz = aFLLineType.GetSizePixel();
- aSz.Width() = LogicToPixel(Size(248, 248), MAP_APPFONT).Width();
- aFLLineType.SetSizePixel(aSz);
- }
}
-/*-----------------07.03.97 08.33-------------------
-
---------------------------------------------------*/
-
-
void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt )
{
OutputDevice* pDev = rUDEvt.GetDevice();
@@ -1476,16 +1399,10 @@ void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt )
pDev->SetLineColor(aLineColor);
}
-/*-----------------07.03.97 08.48-------------------
-
---------------------------------------------------*/
-
ColumnValueSet::~ColumnValueSet()
{
}
-/* -----------------------------02.04.2002 16:01------------------------------
- ---------------------------------------------------------------------------*/
void ColumnValueSet::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
@@ -1496,3 +1413,4 @@ void ColumnValueSet::DataChanged( const DataChangedEvent& rDCEvt )
ValueSet::DataChanged( rDCEvt );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc
index e46697a8c618..9ad30e6673c0 100644
--- a/sw/source/ui/frmdlg/column.hrc
+++ b/sw/source/ui/frmdlg/column.hrc
@@ -75,10 +75,14 @@
#define PB_CANCEL 56
#define PB_OK 57
#define CB_BALANCECOLS 58
-#define FL_PROPERTIES 59
#define FT_TEXTDIRECTION 60
#define LB_TEXTDIRECTION 61
-#define FL_VERT 62
+
+#define FT_LINEWIDTH 63
+#define ED_LINEWIDTH 64
+#define FT_COLOR 65
+#define LB_COLOR 66
+
#define LISTBOX_SELECTION 0
#define LISTBOX_SECTION 1
#define LISTBOX_SECTIONS 2
diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src
index c5ba19c9a958..89962c3efcbd 100644
--- a/sw/source/ui/frmdlg/column.src
+++ b/sw/source/ui/frmdlg/column.src
@@ -85,7 +85,7 @@ TabPage TP_COLUMN
};
FixedText FT_COLUMN
{
- Pos = MAP_APPFONT ( 12 , 70 ) ;
+ Pos = MAP_APPFONT ( 12 , 86 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "Column";
@@ -99,28 +99,28 @@ TabPage TP_COLUMN
{
HelpID = "sw:ImageButton:TP_COLUMN:BTN_DOWN";
Disable = TRUE ;
- Pos = MAP_APPFONT ( 62 , 69 ) ;
+ Pos = MAP_APPFONT ( 62 , 85 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
TabStop = TRUE ;
SYMBOL = IMAGEBUTTON_ARROW_LEFT ;
};
FixedText FT_1
{
- Pos = MAP_APPFONT ( 100 , 71 ) ;
+ Pos = MAP_APPFONT ( 100 , 87 ) ;
Size = MAP_APPFONT ( 10 , 8 ) ;
Text = "~1" ;
Center = TRUE ;
};
FixedText FT_2
{
- Pos = MAP_APPFONT ( 150 , 71 ) ;
+ Pos = MAP_APPFONT ( 150 , 87 ) ;
Size = MAP_APPFONT ( 10 , 8 ) ;
Text = "~2" ;
Center = TRUE ;
};
FixedText FT_3
{
- Pos = MAP_APPFONT ( 200 , 71 ) ;
+ Pos = MAP_APPFONT ( 200 , 87 ) ;
Size = MAP_APPFONT ( 10 , 8 ) ;
Text = "~3" ;
Center = TRUE ;
@@ -129,14 +129,14 @@ TabPage TP_COLUMN
{
HelpID = "sw:ImageButton:TP_COLUMN:BTN_UP";
Disable = TRUE ;
- Pos = MAP_APPFONT ( 238 , 69 ) ;
+ Pos = MAP_APPFONT ( 238 , 85 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
TabStop = TRUE ;
SYMBOL = IMAGEBUTTON_ARROW_RIGHT ;
};
FixedText FT_WIDTH
{
- Pos = MAP_APPFONT ( 12 , 85 ) ;
+ Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "Width" ;
@@ -146,7 +146,7 @@ TabPage TP_COLUMN
HelpID = "sw:MetricField:TP_COLUMN:ED_1";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 87 , 83 ) ;
+ Pos = MAP_APPFONT ( 87 , 99 ) ;
Size = MAP_APPFONT ( 36 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -165,7 +165,7 @@ TabPage TP_COLUMN
HelpID = "sw:MetricField:TP_COLUMN:ED_2";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 137 , 83 ) ;
+ Pos = MAP_APPFONT ( 137 , 99 ) ;
Size = MAP_APPFONT ( 36 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -184,7 +184,7 @@ TabPage TP_COLUMN
HelpID = "sw:MetricField:TP_COLUMN:ED_3";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 187 , 83 ) ;
+ Pos = MAP_APPFONT ( 187 , 99 ) ;
Size = MAP_APPFONT ( 36 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -200,7 +200,7 @@ TabPage TP_COLUMN
};
FixedText FT_DIST
{
- Pos = MAP_APPFONT ( 12 , 101 ) ;
+ Pos = MAP_APPFONT ( 12 , 117 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "Spacing" ;
@@ -210,7 +210,7 @@ TabPage TP_COLUMN
HelpID = "sw:MetricField:TP_COLUMN:ED_DIST1";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 112 , 99 ) ;
+ Pos = MAP_APPFONT ( 112 , 115 ) ;
Size = MAP_APPFONT ( 36 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -229,7 +229,7 @@ TabPage TP_COLUMN
HelpID = "sw:MetricField:TP_COLUMN:ED_DIST2";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 162 , 99 ) ;
+ Pos = MAP_APPFONT ( 162 , 115 ) ;
Size = MAP_APPFONT ( 36 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -246,41 +246,76 @@ TabPage TP_COLUMN
CheckBox CB_AUTO_WIDTH
{
HelpID = "sw:CheckBox:TP_COLUMN:CB_AUTO_WIDTH";
- Pos = MAP_APPFONT ( 87 , 115 ) ;
+ Pos = MAP_APPFONT ( 87 , 131 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
Text [ en-US ] = "Auto~Width" ;
TabStop = TRUE ;
};
FixedLine FL_LAYOUT
{
- Pos = MAP_APPFONT ( 6 , 58 ) ;
+ Pos = MAP_APPFONT ( 6 , 74 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Width and spacing";
};
FixedText FT_STYLE
{
- Pos = MAP_APPFONT ( 12 , 140 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Line" ;
+ Pos = MAP_APPFONT ( 12 , 156 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
+ Text [ en-US ] = "St~yle" ;
Left = TRUE ;
};
ListBox LB_STYLE
{
HelpID = "sw:ListBox:TP_COLUMN:LB_STYLE";
- Pos = MAP_APPFONT ( 50 , 138 ) ;
- Size = MAP_APPFONT ( 60 , 66 ) ;
+ Pos = MAP_APPFONT ( 45 , 154 ) ;
+ Size = MAP_APPFONT ( 40 , 66 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "None" ; Default ; > ;
- };
+ };
+ FixedText FT_LINEWIDTH
+ {
+ Pos = MAP_APPFONT ( 12 , 172 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
+ Text [ en-US ] = "~Width" ;
+ Left = TRUE ;
+ };
+ MetricField ED_LINEWIDTH
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 45 , 170 ) ;
+ Size = MAP_APPFONT ( 40 , 12 ) ;
+ TabStop = TRUE ;
+ Spin = TRUE ;
+ Repeat = TRUE ;
+ First = 25 ;
+ Last = 900 ;
+ Minimum = 25 ;
+ Maximum = 900 ;
+ DecimalDigits = 2 ;
+ SpinSize = 25 ;
+ Unit = FUNIT_POINT ;
+ };
+ FixedText FT_COLOR
+ {
+ Pos = MAP_APPFONT ( 165 , 156 ) ;
+ Size = MAP_APPFONT ( 25 , 8 ) ;
+ Text [ en-US ] = "~Color" ;
+ Left = TRUE ;
+ };
+ ListBox LB_COLOR
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 193 , 154 ) ;
+ Size = MAP_APPFONT ( 60 , 68 ) ;
+ DropDown = TRUE ;
+ DDExtraWidth = TRUE ;
+ TabStop = TRUE ;
};
FixedText FT_HEIGHT
{
- Pos = MAP_APPFONT ( 12 , 156 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
+ Pos = MAP_APPFONT ( 91 , 156 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
Text [ en-US ] = "H~eight" ;
Left = TRUE ;
};
@@ -288,8 +323,8 @@ TabPage TP_COLUMN
{
HelpID = "sw:MetricField:TP_COLUMN:ED_HEIGHT";
Border = TRUE ;
- Pos = MAP_APPFONT ( 50 , 154 ) ;
- Size = MAP_APPFONT ( 60 , 12 ) ;
+ Pos = MAP_APPFONT ( 124 , 154 ) ;
+ Size = MAP_APPFONT ( 35 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
@@ -304,16 +339,16 @@ TabPage TP_COLUMN
};
FixedText FT_POSITION
{
- Pos = MAP_APPFONT ( 12 , 172 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
+ Pos = MAP_APPFONT ( 91 , 172 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
Left = TRUE ;
Text [ en-US ] = "~Position" ;
};
ListBox LB_POSITION
{
HelpID = "sw:ListBox:TP_COLUMN:LB_POSITION";
- Pos = MAP_APPFONT ( 50 , 170 ) ;
- Size = MAP_APPFONT ( 60 , 40 ) ;
+ Pos = MAP_APPFONT ( 124 , 170 ) ;
+ Size = MAP_APPFONT ( 35 , 40 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
StringList [ en-US ] =
@@ -325,28 +360,14 @@ TabPage TP_COLUMN
};
FixedLine FL_LINETYPE
{
- Pos = MAP_APPFONT ( 6 , 127 ) ;
+ Pos = MAP_APPFONT ( 6 , 143 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Separator line" ;
};
- FixedLine FL_VERT
- {
- Pos = MAP_APPFONT ( 116 , 138 ) ;
- Size = MAP_APPFONT ( 4 , 43 ) ;
- Hide = TRUE ;
- Vert = TRUE;
- };
- FixedLine FL_PROPERTIES
- {
- Pos = MAP_APPFONT ( 121 , 127 ) ;
- Size = MAP_APPFONT ( 133 , 8 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Properties";
- };
FixedText FT_TEXTDIRECTION
{
- Pos = MAP_APPFONT ( 127 , 138 ) ;
- Size = MAP_APPFONT ( 127 , 8 ) ;
+ Pos = MAP_APPFONT ( 12 , 60 ) ;
+ Size = MAP_APPFONT ( 60 , 8 ) ;
Hide = TRUE ;
Text [ en-US ] = "Text ~direction";
};
@@ -354,8 +375,8 @@ TabPage TP_COLUMN
{
HelpID = "sw:ListBox:TP_COLUMN:LB_TEXTDIRECTION";
Border = TRUE ;
- Pos = MAP_APPFONT ( 127 , 149 ) ;
- Size = MAP_APPFONT ( 127 , 50 ) ;
+ Pos = MAP_APPFONT ( 75 , 58 ) ;
+ Size = MAP_APPFONT ( 150 , 50 ) ;
DropDown = TRUE ;
Hide = TRUE ;
StringList [ en-US ] =
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 0a7863270034..3c9d6c8530d4 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <cption.hxx>
#include <fldmgr.hxx>
@@ -61,12 +60,8 @@
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
-#ifndef _FRMUI_HRC
#include <frmui.hrc>
-#endif
-#ifndef _CPTION_HRC
#include <cption.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
using namespace ::com::sun::star;
@@ -117,6 +112,8 @@ public:
String GetCharacterStyle() const;
};
+String SwCaptionDialog::our_aSepTextSave = String::CreateFromAscii(": "); // Caption separator text
+
SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
SvxStandardDialog( pParent, SW_RES(DLG_CAPTION) ),
@@ -287,6 +284,7 @@ SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
FreeResource();
CheckButtonWidth();
+ aSepEdit.SetText(our_aSepTextSave);
aTextEdit.GrabFocus();
DrawSample();
}
@@ -313,6 +311,7 @@ void SwCaptionDialog::Apply()
aOpt.CopyAttributes() = bCopyAttributes;
aOpt.SetCharacterStyle( sCharacterStyle );
rView.InsertCaption( &aOpt );
+ our_aSepTextSave = aSepEdit.GetText();
}
IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
@@ -346,8 +345,6 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, SelectHdl, ListBox *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwCaptionDialog, SelectHdl, ListBox *, EMPTYARG )
-
-
IMPL_LINK( SwCaptionDialog, ModifyHdl, Edit *, EMPTYARG )
{
SwWrtShell &rSh = rView.GetWrtShell();
@@ -384,7 +381,7 @@ void SwCaptionDialog::DrawSample()
String aStr;
String sCaption = aTextEdit.GetText();
- // Nummer
+ // number
String sFldTypeName = aCategoryBox.GetText();
sal_Bool bNone = sFldTypeName == sNone;
if( !bNone )
@@ -393,7 +390,7 @@ void SwCaptionDialog::DrawSample()
aFormatBox.GetSelectEntryPos() );
if( SVX_NUM_NUMBER_NONE != nNumFmt )
{
- // Kategorie
+ // category
//#i61007# order of captions
if( !bOrderNumberingFirst )
{
@@ -426,7 +423,6 @@ void SwCaptionDialog::DrawSample()
case SVX_NUM_CHARS_LOWER_LETTER_N: aStr += 'a'; break;
case SVX_NUM_ROMAN_UPPER: aStr += 'I'; break;
case SVX_NUM_ROMAN_LOWER: aStr += 'i'; break;
- //case ARABIC:
default: aStr += '1'; break;
}
//#i61007# order of captions
@@ -438,7 +434,7 @@ void SwCaptionDialog::DrawSample()
}
if( sCaption.Len() > 0 )
- {
+ {
aStr += aSepEdit.GetText();
}
}
@@ -466,7 +462,7 @@ void SwCaptionDialog::CheckButtonWidth()
&aOKButton, &aCancelButton, &aHelpButton, &aAutoCaptionButton, &aOptionButton
};
Button** pCurrent = pBtns;
- for ( sal_uInt32 i = 0; i < sizeof( pBtns ) / sizeof( pBtns[ 0 ] ); ++i, ++pCurrent )
+ for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS(pBtns); ++i, ++pCurrent )
{
aNewSize = (*pCurrent)->GetSizePixel();
aNewSize.Width() += nDelta;
@@ -483,8 +479,6 @@ SwCaptionDialog::~SwCaptionDialog()
{
delete pMgr;
}
-/* */
-
SwSequenceOptionDialog::SwSequenceOptionDialog( Window *pParent, SwView &rV,
const String& rSeqFldType )
@@ -553,7 +547,7 @@ void SwSequenceOptionDialog::Apply()
}
else if( aFldTypeName.Len() && nLvl < MAXLEVEL )
{
- // dann muessen wir das mal einfuegen
+ // then we have to insert that
SwSetExpFieldType aFldType( rSh.GetDoc(), aFldTypeName, nsSwGetSetExpType::GSE_SEQ );
aFldType.SetDelimiter( cDelim );
aFldType.SetOutlineLvl( nLvl );
@@ -566,9 +560,6 @@ void SwSequenceOptionDialog::Apply()
rSh.UpdateExpFlds();
}
-/*-- 24.08.2004 16:13:53---------------------------------------------------
-
- -----------------------------------------------------------------------*/
String SwSequenceOptionDialog::GetCharacterStyle() const
{
String sRet;
@@ -577,9 +568,6 @@ String SwSequenceOptionDialog::GetCharacterStyle() const
return sRet;
}
-/*-- 24.08.2004 16:14:00---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwSequenceOptionDialog::SetCharacterStyle(const String& rStyle)
{
aLbCharStyle.SelectEntryPos(0);
@@ -613,7 +601,8 @@ long SwCaptionDialog::CategoryBox::PreNotify( NotifyEvent& rNEvt )
nHandled = ComboBox::PreNotify( rNEvt );
return nHandled;
}
-/*-- 01.11.2007 10:45:51---------------------------------------------------
+
+/*-------------------------------------------------------------------------
//#i61007# order of captions
-----------------------------------------------------------------------*/
void lcl_MoveH( Window& rWin, sal_Int32 nMove )
@@ -622,6 +611,7 @@ void lcl_MoveH( Window& rWin, sal_Int32 nMove )
aPos.Y() += nMove;
rWin.SetPosPixel(aPos);
}
+
void SwCaptionDialog::ApplyCaptionOrder()
{
//have the settings changed?
@@ -650,3 +640,5 @@ void SwCaptionDialog::ApplyCaptionOrder()
SetSizePixel( aDlgSize );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/cption.src b/sw/source/ui/frmdlg/cption.src
index c93efab586f1..ea63227e8695 100644
--- a/sw/source/ui/frmdlg/cption.src
+++ b/sw/source/ui/frmdlg/cption.src
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
- // #include *****************************************************************
+
#include "helpid.h"
#include "frmui.hrc"
#include "cption.hrc"
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index f25d8186b83e..c7f5fc4e6e3f 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,14 +35,11 @@
#include <svx/dialogs.hrc>
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <sfx2/viewfrm.hxx>
#include <svx/htmlmode.hxx>
#include <fmtfsize.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <docsh.hxx>
#include <viewopt.hxx>
#include <frmdlg.hxx>
@@ -50,20 +48,15 @@
#include <column.hxx>
#include <macassgn.hxx>
-#ifndef _FRMUI_HRC
#include <frmui.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <svx/svxids.hrc>
#include <svx/flagsdef.hxx>
#include <svx/svxdlg.hxx>
/*--------------------------------------------------------------------
- Beschreibung: Der Traeger des Dialoges
+ Description: the dialog's carrier
--------------------------------------------------------------------*/
-
SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
Window* pParent,
const SfxItemSet& rCoreSet,
@@ -84,7 +77,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
sal_uInt16 nHtmlMode = ::GetHtmlMode(m_pWrtShell->GetView().GetDocShell());
m_bHTMLMode = static_cast< sal_Bool >(nHtmlMode & HTMLMODE_ON);
- // BspFont fuer beide Bsp-TabPages
+ // example font for both example TabPages
//
if(pStr)
{
@@ -108,7 +101,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
@@ -121,7 +114,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
if(0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS))
RemoveTabPage(TP_BORDER);
RemoveTabPage(TP_COLUMN);
- // kein break
+ // no break
case DLG_FRM_OLE:
RemoveTabPage(TP_FRM_URL);
RemoveTabPage(TP_MACRO_ASSIGN);
@@ -142,17 +135,10 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
SetCurPageId(nDefPage);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFrmDlg::~SwFrmDlg()
{
}
-
-
-
void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
@@ -219,3 +205,4 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index dd709b8243d4..26b6db52096b 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,18 +55,16 @@
#include <com/sun/star/text/RelOrientation.hpp>
using namespace ::com::sun::star;
-//using namespace text;
-static sal_uInt16 __FAR_DATA aFrmMgrRange[] = {
+static sal_uInt16 aFrmMgrRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
0};
/*--------------------------------------------------------------------
- Beschreibung: Rahmen-Attribute ueber Shell ermitteln
+ Description: determine frame attributes via Shell
--------------------------------------------------------------------*/
-
SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nType ) :
aSet( (SwAttrPool&)pSh->GetAttrPool(), aFrmMgrRange ),
pOwnSh( pSh ),
@@ -76,7 +75,7 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp
{
if ( bNewFrm )
{
- // Defaults einstellen:
+ // set defaults:
sal_uInt16 nId = 0;
switch ( nType )
{
@@ -113,11 +112,9 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, const SfxItemS
}
}
-
/*--------------------------------------------------------------------
- Beschreibung: Initialisieren
+ Description: Initialise
--------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::UpdateAttrMgr()
{
if ( !bNewFrm && pOwnSh->IsFrmSelected() )
@@ -142,13 +139,12 @@ void SwFlyFrmAttrMgr::_UpdateFlyFrm()
}
/*--------------------------------------------------------------------
- Beschreibung: Bestehenden Fly-Frame aendern
+ Description: change existing Fly-Frame
--------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::UpdateFlyFrm()
{
- ASSERT( pOwnSh->IsFrmSelected(),
- "Kein Rahmen selektiert oder keine Shell, Update nicht moeglich");
+ OSL_ENSURE( pOwnSh->IsFrmSelected(),
+ "no frame selected or no shell, update not possible");
if( pOwnSh->IsFrmSelected() )
{
@@ -176,16 +172,15 @@ void SwFlyFrmAttrMgr::UpdateFlyFrm()
}
/*--------------------------------------------------------------------
- Beschreibung: Rahmen einfuegen
+ Description: insert frame
--------------------------------------------------------------------*/
-
sal_Bool SwFlyFrmAttrMgr::InsertFlyFrm()
{
pOwnSh->StartAllAction();
sal_Bool bRet = 0 != pOwnSh->NewFlyFrm( aSet );
- // richtigen Mode an der Shell einschalten, Rahmen wurde aut. selektiert.
+ // turn on the right mode at the shell, frame got selected automatically.
if ( bRet )
{
_UpdateFlyFrm();
@@ -197,18 +192,16 @@ sal_Bool SwFlyFrmAttrMgr::InsertFlyFrm()
}
/*------------------------------------------------------------------------
- Beschreibung: Rahmen des Typs eAnchorType einfuegen. Position und
- Groesse werden explizit angegeben.
- Nicht erlaubte Werte des Aufzaehlungstypes werden
- korrigiert.
+ Description: Insert frames of type eAnchorType. Position and size are
+ being set explicitely.
+ Not-allowed values of the enumeration type get corrected.
------------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType,
const Point &rPos,
const Size &rSize,
sal_Bool bAbs )
{
- ASSERT( eAnchorType == FLY_AT_PAGE ||
+ OSL_ENSURE( eAnchorType == FLY_AT_PAGE ||
eAnchorType == FLY_AT_PARA ||
eAnchorType == FLY_AT_CHAR ||
eAnchorType == FLY_AT_FLY ||
@@ -225,9 +218,8 @@ void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType,
}
/*--------------------------------------------------------------------
- Beschreibung: Anker setzen
+ Description: set anchor
--------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::SetAnchor( RndStdIds eId )
{
sal_uInt16 nPhyPageNum, nVirtPageNum;
@@ -247,17 +239,16 @@ void SwFlyFrmAttrMgr::SetAnchor( RndStdIds eId )
}
/*------------------------------------------------------------------------
- Beschreibung: Setzen des Attributs fuer Spalten
+ Description: set the attribute for columns
------------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::SetCol( const SwFmtCol &rCol )
{
aSet.Put( rCol );
}
+
/*--------------------------------------------------------------------
- Beschreibung: Absolute Position setzen
+ Description: set absolute position
--------------------------------------------------------------------*/
-
void SwFlyFrmAttrMgr::SetAbsPos( const Point& rPoint )
{
bAbsPos = sal_True;
@@ -272,7 +263,7 @@ void SwFlyFrmAttrMgr::SetAbsPos( const Point& rPoint )
}
/*--------------------------------------------------------------------
- Beschreibung: Metriken auf Korrektheit pruefen
+ Description: check metrics for correctness
--------------------------------------------------------------------*/
void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
const SwPosition* pToCharCntntPos,
@@ -301,7 +292,6 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
// --> OD 2009-09-01 #mongolianlayout#
if ( bIsInVertical || bIsInVerticalL2R )
- // <--
{
Point aPos(aBoundRect.Pos());
long nTmp = aPos.X();
@@ -421,7 +411,7 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
rVal.nMaxVPos = aBoundRect.Height() - rVal.nHeight;
}
- // Maximale Breite Hoehe
+ // maximum width height
const SwTwips nH = ( rVal.nHoriOrient != text::HoriOrientation::NONE )
? aBoundRect.Left()
: rVal.nHPos;
@@ -500,7 +490,6 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
}
// --> OD 2009-09-01 #mongolianlayout#
if ( bIsInVertical || bIsInVerticalL2R )
- // <--
{
//restore width/height exchange
long nTmp = rVal.nWidth;
@@ -515,9 +504,8 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
}
/*--------------------------------------------------------------------
- Beschreibung: Korrektur fuer Umrandung
+ Description: correction for border
--------------------------------------------------------------------*/
-
SwTwips SwFlyFrmAttrMgr::CalcTopSpace()
{
const SvxShadowItem& rShadow = GetShadow();
@@ -546,9 +534,8 @@ SwTwips SwFlyFrmAttrMgr::CalcRightSpace()
return rShadow.CalcShadowSpace(SHADOW_RIGHT) + rBox.CalcLineSpace(BOX_LINE_RIGHT);
}
-
/*--------------------------------------------------------------------
- Beschreibung: Attribut aus dem Set loeschen
+ Description: erase attribute from the set
--------------------------------------------------------------------*/
void SwFlyFrmAttrMgr::DelAttr( sal_uInt16 nId )
{
@@ -557,7 +544,7 @@ void SwFlyFrmAttrMgr::DelAttr( sal_uInt16 nId )
void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
{
- ASSERT( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
+ OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
SvxLRSpaceItem aTmp( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
if( LONG_MAX != nLeft )
@@ -569,7 +556,7 @@ void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
void SwFlyFrmAttrMgr::SetULSpace( long nTop, long nBottom )
{
- ASSERT(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
+ OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
SvxULSpaceItem aTmp( (SvxULSpaceItem&)aSet.Get( RES_UL_SPACE ) );
if( LONG_MAX != nTop )
@@ -627,3 +614,5 @@ void SwFlyFrmAttrMgr::SetAttrSet(const SfxItemSet& rSet)
aSet.ClearItem();
aSet.Put( rSet );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 99ba59d9d852..b321d4951517 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,6 @@
#include <colmgr.hxx>
#include <grfatr.hxx>
#include <uiitems.hxx>
-// OD 19.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
#include <frmui.hrc>
@@ -113,36 +113,33 @@ struct StringIdPair_Impl
#define MAX_PERCENT_WIDTH 254L
#define MAX_PERCENT_HEIGHT 254L
-// OD 19.09.2003 #i18732# - change order of alignments
-#define LB_FRAME 0x00000001L // Textbereich des Absatzes
-#define LB_PRTAREA 0x00000002L // Textbereich des Absatzes + Einzuege
-#define LB_VERT_FRAME 0x00000004L // Vertikaler Textbereich des Absatzes
-#define LB_VERT_PRTAREA 0x00000008L // Vertikaler Textbereich des Absatzes + Einzuege
-#define LB_REL_FRM_LEFT 0x00000010L // Linker Absatzrand
-#define LB_REL_FRM_RIGHT 0x00000020L // Rechter Absatzrand
-
-#define LB_REL_PG_LEFT 0x00000040L // Linker Seitenrand
-#define LB_REL_PG_RIGHT 0x00000080L // Rechter Seitenrand
-#define LB_REL_PG_FRAME 0x00000100L // Gesamte Seite
-#define LB_REL_PG_PRTAREA 0x00000200L // Textbereich der Seite
-
-#define LB_FLY_REL_PG_LEFT 0x00000400L // Linker Rahmenrand
-#define LB_FLY_REL_PG_RIGHT 0x00000800L // Rechter Rahmenrand
-#define LB_FLY_REL_PG_FRAME 0x00001000L // Gesamte Rahmen
-#define LB_FLY_REL_PG_PRTAREA 0x00002000L // Rahmeninneres
-
-#define LB_REL_BASE 0x00010000L // Zeichenausrichtung Basis
-#define LB_REL_CHAR 0x00020000L // Zeichenausrichtung Zeichen
-#define LB_REL_ROW 0x00040000L // Zeichenausrichtung Zeile
-
-// OD 10.11.2003 #i22305#
+#define LB_FRAME 0x00000001L // text region of the paragraph
+#define LB_PRTAREA 0x00000002L // text region of the paragraph + indentions
+#define LB_VERT_FRAME 0x00000004L // vertical text region of the paragraph
+#define LB_VERT_PRTAREA 0x00000008L // vertival text region of the paragraph + indentions
+#define LB_REL_FRM_LEFT 0x00000010L // left paragraph edge
+#define LB_REL_FRM_RIGHT 0x00000020L // right paragraph edge
+
+#define LB_REL_PG_LEFT 0x00000040L // left page edge
+#define LB_REL_PG_RIGHT 0x00000080L // right page edge
+#define LB_REL_PG_FRAME 0x00000100L // whole page
+#define LB_REL_PG_PRTAREA 0x00000200L // text region of the page
+
+#define LB_FLY_REL_PG_LEFT 0x00000400L // left frame edge
+#define LB_FLY_REL_PG_RIGHT 0x00000800L // right frame edge
+#define LB_FLY_REL_PG_FRAME 0x00001000L // whole frame
+#define LB_FLY_REL_PG_PRTAREA 0x00002000L // inside of the frame
+
+#define LB_REL_BASE 0x00010000L // character alignment Base
+#define LB_REL_CHAR 0x00020000L // character alignment Character
+#define LB_REL_ROW 0x00040000L // character alignment Row
+
#define LB_FLY_VERT_FRAME 0x00100000L // vertical entire frame
#define LB_FLY_VERT_PRTAREA 0x00200000L // vertical frame text area
-// OD 11.11.2003 #i22341#
#define LB_VERT_LINE 0x00400000L // vertical text line
-static RelationMap __FAR_DATA aRelationMap[] =
+static RelationMap aRelationMap[] =
{
{SwFPos::FRAME, SwFPos::FRAME, LB_FRAME, text::RelOrientation::FRAME},
{SwFPos::PRTAREA, SwFPos::PRTAREA, LB_PRTAREA, text::RelOrientation::PRINT_AREA},
@@ -162,15 +159,13 @@ static RelationMap __FAR_DATA aRelationMap[] =
{SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB_VERT_FRAME, text::RelOrientation::FRAME},
{SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB_VERT_PRTAREA, text::RelOrientation::PRINT_AREA},
- // OD 10.11.2003 #i22305#
{SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_VERT_FRAME, text::RelOrientation::FRAME},
{SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_VERT_PRTAREA, text::RelOrientation::PRINT_AREA},
- // OD 11.11.2003 #i22341#
{SwFPos::REL_LINE, SwFPos::REL_LINE, LB_VERT_LINE, text::RelOrientation::TEXT_LINE}
};
-static RelationMap __FAR_DATA aAsCharRelationMap[] =
+static RelationMap aAsCharRelationMap[] =
{
{SwFPos::REL_BASE, SwFPos::REL_BASE, LB_REL_BASE, text::RelOrientation::FRAME},
{SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, text::RelOrientation::FRAME},
@@ -178,13 +173,12 @@ static RelationMap __FAR_DATA aAsCharRelationMap[] =
};
/*--------------------------------------------------------------------
- Beschreibung: Seite verankert
+ Description: site anchored
--------------------------------------------------------------------*/
-
#define HORI_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_PG_LEFT| \
LB_REL_PG_RIGHT)
-static FrmMap __FAR_DATA aHPageMap[] =
+static FrmMap aHPageMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PAGE_REL},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PAGE_REL},
@@ -192,14 +186,14 @@ static FrmMap __FAR_DATA aHPageMap[] =
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_PAGE_REL}
};
-static FrmMap __FAR_DATA aHPageHtmlMap[] =
+static FrmMap aHPageHtmlMap[] =
{
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME}
};
#define VERT_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-static FrmMap __FAR_DATA aVPageMap[] =
+static FrmMap aVPageMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PAGE_REL},
{SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PAGE_REL},
@@ -207,19 +201,18 @@ static FrmMap __FAR_DATA aVPageMap[] =
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PAGE_REL}
};
-static FrmMap __FAR_DATA aVPageHtmlMap[] =
+static FrmMap aVPageHtmlMap[] =
{
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_REL_PG_FRAME}
};
/*--------------------------------------------------------------------
- Beschreibung: Rahmen verankert
+ Description: frame anchored
--------------------------------------------------------------------*/
-
#define HORI_FRAME_REL (LB_FLY_REL_PG_FRAME|LB_FLY_REL_PG_PRTAREA| \
LB_FLY_REL_PG_LEFT|LB_FLY_REL_PG_RIGHT)
-static FrmMap __FAR_DATA aHFrameMap[] =
+static FrmMap aHFrameMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_FRAME_REL},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_FRAME_REL},
@@ -227,17 +220,16 @@ static FrmMap __FAR_DATA aHFrameMap[] =
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_FRAME_REL}
};
-static FrmMap __FAR_DATA aHFlyHtmlMap[] =
+static FrmMap aHFlyHtmlMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_FLY_REL_PG_FRAME},
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_FLY_REL_PG_FRAME}
};
-// OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects
-// OD 10.11.2003 #i22305#
+// own vertical alignment map for to frame anchored objects
#define VERT_FRAME_REL (LB_FLY_VERT_FRAME|LB_FLY_VERT_PRTAREA)
-static FrmMap __FAR_DATA aVFrameMap[] =
+static FrmMap aVFrameMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_FRAME_REL},
{SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_FRAME_REL},
@@ -245,22 +237,20 @@ static FrmMap __FAR_DATA aVFrameMap[] =
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_FRAME_REL}
};
-static FrmMap __FAR_DATA aVFlyHtmlMap[] =
+static FrmMap aVFlyHtmlMap[] =
{
- // OD 10.11.2003 #i22305#
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_FLY_VERT_FRAME},
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_FLY_VERT_FRAME}
};
/*--------------------------------------------------------------------
- Beschreibung: Absatz verankert
+ Description: paragraph anchored
--------------------------------------------------------------------*/
-
#define HORI_PARA_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
LB_REL_FRM_RIGHT)
-static FrmMap __FAR_DATA aHParaMap[] =
+static FrmMap aHParaMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PARA_REL},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PARA_REL},
@@ -270,23 +260,23 @@ static FrmMap __FAR_DATA aHParaMap[] =
#define HTML_HORI_PARA_REL (LB_FRAME|LB_PRTAREA)
-static FrmMap __FAR_DATA aHParaHtmlMap[] =
+static FrmMap aHParaHtmlMap[] =
{
{SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL},
{SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
};
-static FrmMap __FAR_DATA aHParaHtmlAbsMap[] =
+static FrmMap aHParaHtmlAbsMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
};
-// OD 19.09.2003 #i18732# - allow vertical alignment at page areas
+// allow vertical alignment at page areas
#define VERT_PARA_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-static FrmMap __FAR_DATA aVParaMap[] =
+static FrmMap aVParaMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PARA_REL},
{SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PARA_REL},
@@ -294,20 +284,19 @@ static FrmMap __FAR_DATA aVParaMap[] =
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PARA_REL}
};
-static FrmMap __FAR_DATA aVParaHtmlMap[] =
+static FrmMap aVParaHtmlMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_VERT_PRTAREA}
};
/*--------------------------------------------------------------------
- Beschreibung: Relativ zum Zeichen verankert
+ Description: anchored relative to the character
--------------------------------------------------------------------*/
-
#define HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
LB_REL_FRM_RIGHT|LB_REL_CHAR)
-static FrmMap __FAR_DATA aHCharMap[] =
+static FrmMap aHCharMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_CHAR_REL},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_CHAR_REL},
@@ -317,27 +306,25 @@ static FrmMap __FAR_DATA aHCharMap[] =
#define HTML_HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_CHAR)
-static FrmMap __FAR_DATA aHCharHtmlMap[] =
+static FrmMap aHCharHtmlMap[] =
{
{SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_CHAR_REL},
{SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_CHAR_REL}
};
-static FrmMap __FAR_DATA aHCharHtmlAbsMap[] =
+static FrmMap aHCharHtmlAbsMap[] =
{
{SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_PRTAREA|LB_REL_CHAR},
{SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, LB_PRTAREA},
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME}
};
-// OD 19.09.2003 #i18732# - allow vertical alignment at page areas
-// OD 12.11.2003 #i22341# - handle <LB_REL_CHAR> on its own
+// allow vertical alignment at page areas
#define VERT_CHAR_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-static FrmMap __FAR_DATA aVCharMap[] =
+static FrmMap aVCharMap[] =
{
- // OD 11.11.2003 #i22341#
// introduce mappings for new vertical alignment at top of line <LB_VERT_LINE>
// and correct mapping for vertical alignment at character for position <FROM_BOTTOM>
// Note: Because of these adjustments the map becomes ambigous in its values
@@ -355,22 +342,21 @@ static FrmMap __FAR_DATA aVCharMap[] =
{SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_VERT_LINE}
};
-
-static FrmMap __FAR_DATA aVCharHtmlMap[] =
+static FrmMap aVCharHtmlMap[] =
{
{SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
};
-static FrmMap __FAR_DATA aVCharHtmlAbsMap[] =
+static FrmMap aVCharHtmlAbsMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_CHAR},
{SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
};
+
/*--------------------------------------------------------------------
- Beschreibung: Als Zeichen verankert
+ Description: anchored as character
--------------------------------------------------------------------*/
-
-static FrmMap __FAR_DATA aVAsCharMap[] =
+static FrmMap aVAsCharMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE},
{SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, LB_REL_BASE},
@@ -387,7 +373,7 @@ static FrmMap __FAR_DATA aVAsCharMap[] =
{SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB_REL_BASE}
};
-static FrmMap __FAR_DATA aVAsCharHtmlMap[] =
+static FrmMap aVAsCharHtmlMap[] =
{
{SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE},
{SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB_REL_BASE},
@@ -399,14 +385,14 @@ static FrmMap __FAR_DATA aVAsCharHtmlMap[] =
{SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_REL_ROW}
};
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
RES_FRM_SIZE, RES_FRM_SIZE,
RES_VERT_ORIENT, RES_ANCHOR,
RES_COL, RES_COL,
RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW,
0
};
-static sal_uInt16 __FAR_DATA aAddPgRg[] = {
+static sal_uInt16 aAddPgRg[] = {
RES_PROTECT, RES_PROTECT,
RES_PRINT, RES_PRINT,
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
@@ -414,10 +400,6 @@ static sal_uInt16 __FAR_DATA aAddPgRg[] = {
0
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
size_t lcl_GetFrmMapCount( const FrmMap* pMap)
{
if ( pMap )
@@ -443,7 +425,6 @@ size_t lcl_GetFrmMapCount( const FrmMap* pMap)
return sizeof(aHParaMap) / aSizeOf;
if ( pMap == aHFrameMap )
return sizeof(aHFrameMap) / aSizeOf;
- // OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects
if ( pMap == aVFrameMap )
return sizeof(aVFrameMap) / aSizeOf;
if ( pMap == aHCharMap )
@@ -468,38 +449,33 @@ size_t lcl_GetFrmMapCount( const FrmMap* pMap)
}
return 0;
}
-/* -----------------------------08.08.2002 14:45------------------------------
- ---------------------------------------------------------------------------*/
void lcl_InsertVectors(ListBox& rBox,
const ::std::vector< String >& rPrev, const ::std::vector< String >& rThis,
const ::std::vector< String >& rNext, const ::std::vector< String >& rRemain)
{
::std::vector< String >::const_iterator aIt;
sal_uInt16 nEntry = 0;
- for(aIt = rPrev.begin(); aIt != rPrev.end(); aIt++)
+ for(aIt = rPrev.begin(); aIt != rPrev.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
- for(aIt = rThis.begin(); aIt != rThis.end(); aIt++)
+ for(aIt = rThis.begin(); aIt != rThis.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
- for(aIt = rNext.begin(); aIt != rNext.end(); aIt++)
+ for(aIt = rNext.begin(); aIt != rNext.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
rBox.SetSeparatorPos(nEntry);
//now insert all strings sorted
sal_uInt16 nStartPos = rBox.GetEntryCount();
- for(aIt = rPrev.begin(); aIt != rPrev.end(); aIt++)
+ for(aIt = rPrev.begin(); aIt != rPrev.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rThis.begin(); aIt != rThis.end(); aIt++)
+ for(aIt = rThis.begin(); aIt != rThis.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rNext.begin(); aIt != rNext.end(); aIt++)
+ for(aIt = rNext.begin(); aIt != rNext.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rRemain.begin(); aIt != rRemain.end(); aIt++)
+ for(aIt = rRemain.begin(); aIt != rRemain.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
}
-/* -----------------------------20.08.2002 16:12------------------------------
-
- ---------------------------------------------------------------------------*/
// --> OD 2009-08-31 #mongolianlayout#
// add input parameter
SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bVerticalL2R, sal_Bool bRTL)
@@ -524,7 +500,6 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
eStringId = SwFPos::FROMLEFT;
return eStringId;
}
- // <--
if ( bVertical )
{
//exchange horizontal strings with vertical strings and vice versa
@@ -562,7 +537,6 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
{SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
{SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
};
- // <--
sal_uInt16 nIndex;
for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
@@ -592,13 +566,12 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
break;
}
}
- // <--
}
}
return eStringId;
}
-// OD 12.11.2003 #i22341# - helper method in order to determine all possible
+// helper method in order to determine all possible
// listbox relations in a relation map for a given relation
sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel )
{
@@ -616,7 +589,7 @@ sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel )
return nLBRelations;
}
-// OD 14.11.2003 #i22341# - helper method on order to determine all possible
+// helper method on order to determine all possible
// listbox relations in a relation map for a given string ID
sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap,
const SvxSwFramePosString::StringId _eStrId,
@@ -638,9 +611,8 @@ sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap,
}
/*--------------------------------------------------------------------
- Beschreibung: StandardRahmenTabPage
+ Description: standard frame TabPage
--------------------------------------------------------------------*/
-
namespace
{
void HandleAutoCB( sal_Bool _bChecked, FixedText& _rFT_man, FixedText& _rFT_auto )
@@ -650,7 +622,6 @@ namespace
}
}
-
SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage (pParent, SW_RES(TP_FRM_STD), rSet),
@@ -690,7 +661,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aAtVertPosED (this, SW_RES(ED_AT_VERT_POS)),
aVertRelationFT (this, SW_RES(FT_VERT_RELATION)),
aVertRelationLB (this, SW_RES(LB_VERT_RELATION)),
- // OD 19.09.2003 #i18732# - new checkbox
aFollowTextFlowCB(this, SW_RES(CB_FOLLOWTEXTFLOW)),
aExampleWN (this, SW_RES(WN_BSP)),
@@ -701,12 +671,9 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
bNew(sal_True),
bNoModifyHdl(sal_True),
// --> OD 2009-08-31 #mongolianlayout# - no used
-// bVerticalChanged(FALSE),
- // <--
+// bVerticalChanged(sal_False),
bIsVerticalFrame(sal_False),
- // --> OD 2009-08-31 #mongolianlayou#
bIsVerticalL2R(sal_False),
- // <--
bIsInRightToLeft(sal_False),
bHtmlMode(sal_False),
nHtmlMode(0),
@@ -714,7 +681,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
nUpperBorder(0),
nLowerBorder(0),
fWidthHeightRatio(1.0),
- // OD 12.11.2003 #i22341#
mpToCharCntntPos( NULL ),
nOldH(text::HoriOrientation::CENTER),
@@ -737,7 +703,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aHeightED. SetLoseFocusHdl( aLk );
aAtHorzPosED.SetLoseFocusHdl( aLk );
aAtVertPosED.SetLoseFocusHdl( aLk );
- // OD 25.09.2003 #i18732# - click handler for new checkbox
aFollowTextFlowCB.SetClickHdl( aLk );
aLk = LINK(this, SwFrmPage, ModifyHdl);
@@ -770,9 +735,8 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
}
/*--------------------------------------------------------------------
- Beschreibung: Dtor
+ Description: Dtor
--------------------------------------------------------------------*/
-
SwFrmPage::~SwFrmPage()
{
}
@@ -794,7 +758,7 @@ namespace
void SwFrmPage::EnableGraficMode( void )
{
- // #i39692# mustn't be called more than once
+ // i#39692 - mustn't be called more than once
if(!aRealSizeBT.IsVisible())
{
long nOffset1 = aRelWidthCB.GetPosPixel().Y() - aAutoWidthCB.GetPosPixel().Y();
@@ -833,7 +797,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
SetMetric( aAtVertPosED, aMetric );
const SfxPoolItem* pItem = NULL;
-
const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR);
if (SFX_ITEM_SET == rSet.GetItemState(FN_OLE_IS_MATH, sal_False, &pItem))
@@ -845,7 +808,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
if (bFormat)
{
- // Bei Formaten keine Ankerbearbeitung
+ // at formats no anchor editing
aAnchorAtPageRB.Enable( sal_False );
aAnchorAtParaRB.Enable( sal_False );
aAnchorAtCharRB.Enable( sal_False );
@@ -861,7 +824,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
// --> OD 2009-08-31 #mongolianlayout#
// if ( !bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft) )
if ( pSh->IsFrmVertical( sal_True, bIsInRightToLeft, bIsVerticalL2R ) )
- // <--
{
String sHLabel = aHorizontalFT.GetText();
aHorizontalFT.SetText(aVerticalFT.GetText());
@@ -872,8 +834,8 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE )
{
- ASSERT(pSh , "shell not found");
- //OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften
+ OSL_ENSURE(pSh , "shell not found");
+ //OS: only for the variant Insert/Graphic/Properties
if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, sal_False, &pItem))
aGrfSize = ((const SvxSizeItem*)pItem)->GetSize();
else
@@ -884,8 +846,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
aRealSizeBT.SetClickHdl(LINK(this, SwFrmPage, RealSizeHdl));
EnableGraficMode();
}
-// else
-// aTypeFL.SetSizePixel(Size(aTypeFL.GetSizePixel().Width(), aSizeFL.GetSizePixel().Height()));
if ( nDlgType == DLG_FRM_GRF )
aFixedRatioCB.Check( sal_False );
@@ -899,11 +859,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
}
else
{
-// aTypeFL.SetSizePixel(Size(aTypeFL.GetSizePixel().Width(), aSizeFL.GetSizePixel().Height()));
aGrfSize = ((const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE)).GetSize();
}
- //Prozenteingabe ermoeglichen.
+ // entering procent value made possible
aWidthED. SetBaseValue( aWidthED.Normalize(aGrfSize.Width()), FUNIT_TWIP );
aHeightED.SetBaseValue( aHeightED.Normalize(aGrfSize.Height()), FUNIT_TWIP );
//the available space is not yet known so the RefValue has to be calculated from size and relative size values
@@ -925,7 +884,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
aHeightED.SetRefValue( nSpace );
}
- // Allgemeiner Initialisierungteil
+ // general initialisation part
switch(rAnchor.GetAnchorId())
{
case FLY_AT_PAGE: aAnchorAtPageRB.Check(); break;
@@ -936,11 +895,11 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
default:; //prevent warning
}
- // OD 12.11.2003 #i22341# - determine content position of character
+ // i#22341 - determine content position of character
// Note: content position can be NULL
mpToCharCntntPos = rAnchor.GetCntntAnchor();
- // OD 19.09.2003 #i18732# - init checkbox value
+ // i#18732 - init checkbox value
{
const bool bFollowTextFlow =
static_cast<const SwFmtFollowTextFlow&>(rSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue();
@@ -969,16 +928,16 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
aMirrorPagesCB.Show(sal_False);
if(nDlgType == DLG_FRM_STD)
aFixedRatioCB.Enable(sal_False);
- // OD 19.09.2003 #i18732# - hide checkbox in HTML mode
+ // i#18732 hide checkbox in HTML mode
aFollowTextFlowCB.Show(sal_False);
}
else
{
- // OD 06.11.2003 #i18732# correct enable/disable of check box 'Mirror on..'
+ // enable/disable of check box 'Mirror on..'
aMirrorPagesCB.Enable(!aAnchorAsCharRB.IsChecked());
- // OD 06.11.2003 #i18732# - enable/disable check box 'Follow text flow'.
- // OD 10.11.2003 #i22305# - enable check box 'Follow text
+ // enable/disable check box 'Follow text flow'.
+ // enable check box 'Follow text
// flow' also for anchor type to-frame.
aFollowTextFlowCB.Enable( aAnchorAtParaRB.IsChecked() ||
aAnchorAtCharRB.IsChecked() ||
@@ -988,14 +947,13 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
Init( rSet, sal_True );
aAtVertPosED.SaveValue();
aAtHorzPosED.SaveValue();
- // OD 19.09.2003 #i18732#
aFollowTextFlowCB.SaveValue();
bNoModifyHdl = sal_False;
//lock PercentFields
aWidthED.LockAutoCalculation(sal_True);
aHeightED.LockAutoCalculation(sal_True);
- RangeModifyHdl(&aWidthED); // Alle Maximalwerte initial setzen
+ RangeModifyHdl(&aWidthED); // set all maximum values initially
aHeightED.LockAutoCalculation(sal_False);
aWidthED.LockAutoCalculation(sal_False);
@@ -1007,17 +965,15 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
}
-
/*--------------------------------------------------------------------
- Beschreibung: Attribute in den Set stopfen bei OK
+ Description: stuff attributes into the set when OK
--------------------------------------------------------------------*/
-
sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bRet = sal_False;
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
: ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
- ASSERT( pSh , "shell not found");
+ OSL_ENSURE( pSh , "shell not found");
const SfxItemSet& rOldSet = GetItemSet();
const SfxPoolItem* pOldItem = 0;
@@ -1073,7 +1029,7 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
if ( pVMap )
{
- // Ausrichtung Vertikal
+ // alignment vertical
SwFmtVertOrient aVertOrient( (const SwFmtVertOrient&)
rOldSet.Get(RES_VERT_ORIENT) );
@@ -1092,8 +1048,8 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
if ( eVOri == text::VertOrientation::NONE &&
( bNew || (bAtVertPosModified || bMod) || nOldV != eVOri) )
{
- // Vertikale Position
- // fuer zeichengebundene Rahmen Offset umrechenen
+ // vertival position
+ // recalculate offset for character bound frames
SwTwips nY = static_cast< SwTwips >(aAtVertPosED.Denormalize(aAtVertPosED.GetValue(FUNIT_TWIP)));
if (eAnchorId == FLY_AS_CHAR)
{
@@ -1118,20 +1074,14 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
}
}
- //Size setzen
- //Neuer Sonderfall: Ist die Groesse von pMgr(0, 0), so werden die
- //Eigenschaften fuer eine Grafik festgelegt, die noch gar nicht geladen
- //ist. Dann wird hier kein SetSize() gemacht, wenn die
- //Groesseneinstellungen vom Anwender nicht veraendert wurden.
+ // set size
+ // new exception: when the size of pMgr(, 0), then the properties
+ // for a graphic that isn't even loaded, are set. Then no SetSize
+ // is done here when the size settings were not changed by the
+ // user.
const SwFmtFrmSize& rOldSize = (const SwFmtFrmSize& )rOldSet.Get(RES_FRM_SIZE);
SwFmtFrmSize aSz( rOldSize );
-/* // Folgende Zeilen nur zum debuggen:
- sal_Bool bModified = aWidthED.IsValueModified();
- sal_uInt16 nOldWidth = rOldSize.GetWidth ();
- sal_uInt16 nWidth = aWidthED .GetValue();
- sal_uInt16 nMinWidth = aWidthED .GetMin();*/
-
sal_Bool bValueModified = (aWidthED.IsValueModified() || aHeightED.IsValueModified());
sal_Bool bCheckChanged = (aRelWidthCB.GetSavedValue() != aRelWidthCB.IsChecked()
|| aRelHeightCB.GetSavedValue() != aRelHeightCB.IsChecked());
@@ -1191,12 +1141,11 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
(aSz.GetWidth() > 0 || aSz.GetWidthPercent() > 0) &&
(aSz.GetHeight() > 0 || aSz.GetHeightPercent() > 0)))
{
- if (aSz.GetHeightSizeType() == ATT_VAR_SIZE) // VAR_SIZE gibts nicht bei Rahmen
- aSz.SetHeightSizeType(ATT_MIN_SIZE); // Bug #45776 (Vorlagen ohne Breite/Hoehe)
+ if (aSz.GetHeightSizeType() == ATT_VAR_SIZE) // there is no VAR_SIZE in frames
+ aSz.SetHeightSizeType(ATT_MIN_SIZE);
bRet |= 0 != rSet.Put( aSz );
}
- // OD 19.09.2003 #i18732#
if(aFollowTextFlowCB.IsChecked() != aFollowTextFlowCB.GetSavedValue())
{
bRet |= 0 != rSet.Put(SwFmtFollowTextFlow(aFollowTextFlowCB.IsChecked()));
@@ -1205,9 +1154,8 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Horizontale und vertikale Pos initialisieren
+ Description: initialise horizonal and vertical Pos
--------------------------------------------------------------------*/
-
void SwFrmPage::InitPos(RndStdIds eId,
sal_uInt16 nH,
sal_uInt16 nHRel,
@@ -1244,7 +1192,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
}
else if ( eId == FLY_AT_FLY )
{
- // OD 19.09.2003 #i18732# - own vertical alignment map for to frame
+ // own vertical alignment map for to frame
// anchored objects.
pVMap = bHtmlMode ? aVFlyHtmlMap : aVFrameMap;
pHMap = bHtmlMode ? aHFlyHtmlMap : aHFrameMap;
@@ -1284,28 +1232,25 @@ void SwFrmPage::InitPos(RndStdIds eId,
aHorizontalDLB.Enable( bEnable );
aHorizontalFT.Enable( bEnable );
- // aktuelle Pos selektieren
- // Horizontal
+ // select current Pos
+ // horizontal
if ( nH == USHRT_MAX )
{
nH = nOldH;
nHRel = nOldHRel;
}
- // OD 12.11.2003 #i22341# - pass <nHRel> as 3rd parameter to method <FillPosLB>
sal_uInt16 nMapPos = FillPosLB(pHMap, nH, nHRel, aHorizontalDLB);
FillRelLB(pHMap, nMapPos, nH, nHRel, aHoriRelationLB, aHoriRelationFT);
- // Vertikal
+ // vertical
if ( nV == USHRT_MAX )
{
nV = nOldV;
nVRel = nOldVRel;
}
- // OD 12.11.2003 #i22341# - pass <nVRel> as 3rd parameter to method <FillPosLB>
nMapPos = FillPosLB(pVMap, nV, nVRel, aVerticalDLB);
FillRelLB(pVMap, nMapPos, nV, nVRel, aVertRelationLB, aVertRelationFT);
- // Edits init
bEnable = nH == text::HoriOrientation::NONE && eId != FLY_AS_CHAR;
if (!bEnable)
{
@@ -1345,10 +1290,6 @@ void SwFrmPage::InitPos(RndStdIds eId,
UpdateExample();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
const sal_uInt16 _nAlign,
const sal_uInt16 _nRel,
@@ -1359,18 +1300,17 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
_rLB.Clear();
- // OD 12.11.2003 #i22341# - determine all possible listbox relations for
+ // i#22341 determine all possible listbox relations for
// given relation for map <aVCharMap>
const sal_uLong nLBRelations = (_pMap != aVCharMap)
? 0L
: ::lcl_GetLBRelationsForRelations( _nRel );
- // Listbox fuellen
+ // fill Listbox
size_t nCount = ::lcl_GetFrmMapCount(_pMap);
for (size_t i = 0; _pMap && i < nCount; ++i)
{
-// #61359# Warum nicht von links/von innen bzw. von oben?
-// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
+// Why not from the left/from inside or from above?
{
SvxSwFramePosString::StringId eStrId = aMirrorPagesCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
// --> OD 2009-08-31 #mongolianlayout#
@@ -1378,14 +1318,13 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry(aFramePosString.GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
- // bei zeichengebundenen Rahmen keine doppelten Eintraege einfuegen
+ // don't insert entries when frames are character bound
_rLB.InsertEntry(sEntry);
}
- // OD 12.11.2003 #i22341# - add condition to handle map <aVCharMap>
+ // i#22341 - add condition to handle map <aVCharMap>
// that is ambigous in the alignment.
if ( _pMap[i].nAlign == _nAlign &&
( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
@@ -1407,9 +1346,6 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
return GetMapPos(_pMap, _rLB);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
const sal_uInt16 _nLBSelPos,
const sal_uInt16 _nAlign,
@@ -1448,7 +1384,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry = aFramePosString.GetString(sStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]);
@@ -1470,7 +1405,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
for (sal_uInt16 i = 0; i < _rLB.GetEntryCount(); i++)
{
RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(i);
- if (pEntry->nLBRelation == LB_REL_CHAR) // Default
+ if (pEntry->nLBRelation == LB_REL_CHAR) // default
{
_rLB.SelectEntryPos(i);
break;
@@ -1483,7 +1418,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
sal_uInt16 nRelCount = sizeof(aRelationMap) / sizeof(RelationMap);
- // OD 14.11.2003 #i22341# - special handling for map <aVCharMap>,
+ // special handling for map <aVCharMap>,
// because its ambigous in its <eStrId>/<eMirrorStrId>.
if ( _pMap == aVCharMap )
{
@@ -1514,7 +1449,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry = aFramePosString.GetString(eStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aRelationMap[nRelPos]);
@@ -1528,7 +1462,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
_rLB.SelectEntry(sSelEntry);
else
{
- // Warscheinlich Ankerwechsel. Daher aehnliche Relation suchen
+ // Probably anchor switch. So look for similar relation
switch (_nRel)
{
case text::RelOrientation::FRAME: _nRel = text::RelOrientation::PAGE_FRAME; break;
@@ -1575,10 +1509,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
return nLBRelations;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB)
{
short nRel = 0;
@@ -1593,16 +1523,12 @@ short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB)
return nRel;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos,
ListBox &/*rAlignLB*/, ListBox &rRelationLB)
{
short nAlign = 0;
- // OD 14.11.2003 #i22341# - special handling also for map <aVCharMap>,
+ // i#22341 special handling also for map <aVCharMap>,
// because it contains ambigous items for alignment
if ( pMap == aVAsCharHtmlMap || pMap == aVAsCharMap ||
pMap == aVCharMap )
@@ -1633,10 +1559,6 @@ short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos,
return nAlign;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB )
{
sal_uInt16 nMapPos = 0;
@@ -1670,10 +1592,6 @@ sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB )
return nMapPos;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
RndStdIds SwFrmPage::GetAnchor()
{
RndStdIds nRet = FLY_AT_PAGE;
@@ -1697,9 +1615,8 @@ RndStdIds SwFrmPage::GetAnchor()
}
/*--------------------------------------------------------------------
- Beschreibung: Bsp - Update
+ Description: Bsp - Update
--------------------------------------------------------------------*/
-
void SwFrmPage::ActivatePage(const SfxItemSet& rSet)
{
bNoModifyHdl = sal_True;
@@ -1708,7 +1625,7 @@ void SwFrmPage::ActivatePage(const SfxItemSet& rSet)
//lock PercentFields
aWidthED.LockAutoCalculation(sal_True);
aHeightED.LockAutoCalculation(sal_True);
- RangeModifyHdl(&aWidthED); // Alle Maximalwerte initial setzen
+ RangeModifyHdl(&aWidthED); // set all maximum values initially
aHeightED.LockAutoCalculation(sal_False);
aWidthED.LockAutoCalculation(sal_False);
aFollowTextFlowCB.SaveValue();
@@ -1720,9 +1637,8 @@ int SwFrmPage::DeactivatePage(SfxItemSet * _pSet)
{
FillItemSet( *_pSet );
- //FillItemSet setzt den Anker nicht in den Set, wenn er mit dem
- //Original uebereinstimmt. Fuer die anderen Pages brauchen wir aber
- //den aktuellen Anker.
+ //FillItemSet doesn't set the anchor into the set when it matches
+ //the original. But for the other pages we need the current anchor.
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
: ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
RndStdIds eAnchorId = (RndStdIds)GetAnchor();
@@ -1734,9 +1650,8 @@ int SwFrmPage::DeactivatePage(SfxItemSet * _pSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Links/rechts mit Innen/aussen tauschen
+ Description: swap left/right with inside/outside
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFrmPage, MirrorHdl, CheckBox *, EMPTYARG )
{
RndStdIds eId = GetAnchor();
@@ -1745,10 +1660,6 @@ IMPL_LINK( SwFrmPage, MirrorHdl, CheckBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
{
if (pBtn == &aRelWidthCB)
@@ -1764,8 +1675,8 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
aHeightED.MetricField::SetMax(MAX_PERCENT_HEIGHT);
}
- if (pBtn) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde
- RangeModifyHdl(&aWidthED); // Werte wieder korrigieren
+ if (pBtn) // only when Handler was called by change of the controller
+ RangeModifyHdl(&aWidthED); // correct the values again
if (pBtn == &aRelWidthCB)
ModifyHdl(&aWidthED);
@@ -1776,9 +1687,8 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
}
/*--------------------------------------------------------------------
- Beschreibung: Bereichspruefung
+ Description: range check
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
{
if (bNoModifyHdl)
@@ -1786,7 +1696,7 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
:((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
- ASSERT(pSh , "shell not found");
+ OSL_ENSURE(pSh , "shell not found");
SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() );
SvxSwFrameValidation aVal;
@@ -1794,12 +1704,11 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
aVal.bAutoHeight = aAutoHeightCB.IsChecked();
aVal.bAutoWidth = aAutoWidthCB.IsChecked();
aVal.bMirror = aMirrorPagesCB.IsChecked();
- // OD 18.09.2003 #i18732#
aVal.bFollowTextFlow = aFollowTextFlowCB.IsChecked();
if ( pHMap )
{
- // Ausrichtung Horizontal
+ // alignment horizonal
sal_uInt16 nMapPos = GetMapPos(pHMap, aHorizontalDLB);
short nAlign = GetAlignment(pHMap, nMapPos, aHorizontalDLB, aHoriRelationLB);
short nRel = GetRelation(pHMap, aHoriRelationLB);
@@ -1812,7 +1721,7 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
if ( pVMap )
{
- // Ausrichtung Vertikal
+ // alignment vertical
sal_uInt16 nMapPos = GetMapPos(pVMap, aVerticalDLB);
short nAlign = GetAlignment(pVMap, nMapPos, aVerticalDLB, aVertRelationLB);
short nRel = GetRelation(pVMap, aVertRelationLB);
@@ -1831,21 +1740,21 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
aVal.nHPos = nAtHorzPosVal;
aVal.nVPos = nAtVertPosVal;
- aMgr.ValidateMetrics(aVal, mpToCharCntntPos, sal_True); // Einmal, um Referenzwerte fuer prozentuale Werte zu erhalten
+ aMgr.ValidateMetrics(aVal, mpToCharCntntPos, sal_True); // one time, to get reference values for percental values
- // Referenzwerte fuer fuer Prozentwerte setzen (100%) ...
+ // set reference values for percental values (100%) ...
aWidthED.SetRefValue(aVal.aPercentSize.Width());
aHeightED.SetRefValue(aVal.aPercentSize.Height());
- // ... und damit Breite und Hoehe korrekt umrechnen
+ // ... and correctly convert width and height with it
SwTwips nWidth = static_cast< SwTwips >(aWidthED. DenormalizePercent(aWidthED.GetValue(FUNIT_TWIP)));
SwTwips nHeight = static_cast< SwTwips >(aHeightED.DenormalizePercent(aHeightED.GetValue(FUNIT_TWIP)));
aVal.nWidth = nWidth;
aVal.nHeight = nHeight;
- aMgr.ValidateMetrics(aVal, mpToCharCntntPos); // Nochmal um mit korrekter Breite und Hoehe alle restlichen Werte zu ermitteln
+ aMgr.ValidateMetrics(aVal, mpToCharCntntPos); // one more time, to determine all remaining values with correct width and height.
- // alle Spalten muessen passen
+ // all columns have to be correct
if(GetTabDialog()->GetExampleSet() &&
SFX_ITEM_DEFAULT <= GetTabDialog()->GetExampleSet()->GetItemState(RES_COL))
{
@@ -1858,14 +1767,14 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
rCol.GetColumns()[i]->GetRight() +
MINFLY;
}
- aVal.nMinWidth -= MINFLY;//einen hatten wir schon mit drin!
+ aVal.nMinWidth -= MINFLY;//one was already in there!
}
}
nWidth = aVal.nWidth;
nHeight = aVal.nHeight;
- // Mindestbreite auch fuer Vorlage
+ // minimum range also for template
aHeightED.SetMin(aHeightED.NormalizePercent(aVal.nMinHeight), FUNIT_TWIP);
aWidthED. SetMin(aWidthED.NormalizePercent(aVal.nMinWidth), FUNIT_TWIP);
@@ -1911,9 +1820,9 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG )
{
aMirrorPagesCB.Enable(!aAnchorAsCharRB.IsChecked());
- // OD 06.11.2003 #i18732# - enable check box 'Follow text flow' for anchor
+ // i#18732 - enable check box 'Follow text flow' for anchor
// type to-paragraph' and to-character
- // OD 10.11.2003 #i22305# - enable check box 'Follow text
+ // i#22305 - enable check box 'Follow text
// flow' also for anchor type to-frame.
aFollowTextFlowCB.Enable( aAnchorAtParaRB.IsChecked() ||
aAnchorAtCharRB.IsChecked() ||
@@ -1936,10 +1845,6 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
{
sal_Bool bHori = pLB == &aHorizontalDLB;
@@ -1963,7 +1868,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
aAtVertPosFT.Enable( bEnable );
}
- if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde
+ if (pLB) // only when Handler was called by changing of the controller
RangeModifyHdl( 0 );
sal_uInt16 nRel = 0;
@@ -1985,15 +1890,15 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
else
bAtVertPosModified = sal_True;
- // Sonderbehandlung fuer HTML-Mode mit horz-vert-Abhaengigkeiten
+ // special treatment for HTML-Mode with horizonal-vertical-dependencies
if(bHtmlMode && nHtmlMode&HTMLMODE_SOME_ABS_POS &&
(FLY_AT_CHAR == GetAnchor()))
{
sal_Bool bSet = sal_False;
if(bHori)
{
- // rechts ist nur unterhalb erlaubt - von links nur oben
- // von links am Zeichen -> unterhalb
+ // right is allowed only above - from the left only above
+ // from the left at character -> below
if((text::HoriOrientation::LEFT == nAlign || text::HoriOrientation::RIGHT == nAlign) &&
0 == aVerticalDLB.GetSelectEntryPos())
{
@@ -2045,9 +1950,8 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
}
/*--------------------------------------------------------------------
- Beschreibung: Horizontale Pos
+ Description: horizonal Pos
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
{
sal_Bool bHori = pLB == &aHoriRelationLB;
@@ -2074,13 +1978,12 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
}
}
}
- if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde
+ if (pLB) // Only when Handler was called by changing of the controller
RangeModifyHdl(0);
return 0;
}
-
IMPL_LINK_INLINE_START( SwFrmPage, RealSizeHdl, Button *, EMPTYARG )
{
aWidthED.SetUserValue( aWidthED. NormalizePercent(aGrfSize.Width() ), FUNIT_TWIP);
@@ -2091,7 +1994,6 @@ IMPL_LINK_INLINE_START( SwFrmPage, RealSizeHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwFrmPage, RealSizeHdl, Button *, EMPTYARG )
-
IMPL_LINK( SwFrmPage, AutoWidthClickHdl, void*, EMPTYARG )
{
if( !IsInGraficMode() )
@@ -2128,10 +2030,6 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFrmPage::UpdateExample()
{
sal_uInt16 nPos = aHorizontalDLB.GetSelectEntryPos();
@@ -2156,7 +2054,7 @@ void SwFrmPage::UpdateExample()
aExampleWN.SetVertRel(nRel);
}
- // Size
+ // size
long nXPos = static_cast< long >(aAtHorzPosED.Denormalize(aAtHorzPosED.GetValue(FUNIT_TWIP)));
long nYPos = static_cast< long >(aAtVertPosED.Denormalize(aAtVertPosED.GetValue(FUNIT_TWIP)));
aExampleWN.SetRelPos(Point(nXPos, nYPos));
@@ -2171,7 +2069,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
{
SwWrtShell* pSh = ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
- // Size
+ // size
const sal_Bool bSizeFixed = pSh->IsSelObjProtected( FLYPROTECT_FIXED );
aWidthED .Enable( !bSizeFixed );
@@ -2226,8 +2124,8 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
{
if(!bReset)
{
- // Wert wurde von Umlauf-Tabpage geaendert und muss
- // mit Modify-Flag gesetzt werden
+ // value was changed by circulation-Tabpage and
+ // has to be set with Modify-Flag
aWidthED.SetUserValue(nWidth, FUNIT_TWIP);
}
else
@@ -2238,8 +2136,8 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
{
if (!bReset)
{
- // Wert wurde von Umlauf-Tabpage geaendert und muss
- // mit Modify-Flag gesetzt werden
+ // values was changed by circulation-Tabpage and
+ // has to be set with Modify-Flag
aHeightED.SetUserValue(nHeight, FUNIT_TWIP);
}
else
@@ -2273,7 +2171,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
else
aAutoHeightCB.Hide();
- // Umlauf-Abstand fuer zeichengebundene Rahmen organisieren
+ // organise circulation-gap for character bound frames
const SvxULSpaceItem &rUL = (const SvxULSpaceItem &)rSet.Get(RES_UL_SPACE);
nUpperBorder = rUL.GetUpper();
nLowerBorder = rUL.GetLower();
@@ -2284,7 +2182,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
aFixedRatioCB.SaveValue();
}
- // Spalten
+ // columns
SwFmtCol aCol( (const SwFmtCol&)rSet.Get(RES_COL) );
::FitToActualSize( aCol, (sal_uInt16)rSize.GetWidth() );
@@ -2325,8 +2223,8 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
rVert.GetPos());
}
- // Transparent fuers Bsp
- // Umlauf fuers Bsp
+ // transparent for example
+ // circulation for example
const SwFmtSurround& rSurround = (const SwFmtSurround&)rSet.Get(RES_SURROUND);
aExampleWN.SetWrap ( static_cast< sal_uInt16 >(rSurround.GetSurround()) );
@@ -2336,8 +2234,8 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
aExampleWN.SetTransparent(!rOpaque.GetValue());
}
- // ggf auf Prozent umschalten
- RangeModifyHdl(&aWidthED); // Referenzwerte setzen (fuer 100%)
+ // switch to percent if applicable
+ RangeModifyHdl(&aWidthED); // set reference values (for 100%)
if (rSize.GetWidthPercent() == 0xff || rSize.GetHeightPercent() == 0xff)
aFixedRatioCB.Check(sal_True);
@@ -2363,9 +2261,7 @@ sal_uInt16* SwFrmPage::GetRanges()
{
return aPageRg;
}
-/* -----------------------------03.11.00 10:52--------------------------------
- ---------------------------------------------------------------------------*/
void SwFrmPage::SetFormatUsed(sal_Bool bFmt)
{
bFormat = bFmt;
@@ -2378,12 +2274,6 @@ void SwFrmPage::SetFormatUsed(sal_Bool bFmt)
aAnchorAtFrameRB.Hide();
aTypeFL.Hide();
aTypeSepFL.Hide();
-
-// Point aSizePos = aSizeFL.GetPosPixel();
-// Size aSizeSize = aSizeFL.GetSizePixel();
-// aSizeSize.Width() = aTypeFL.GetPosPixel().X() +
-// aTypeFL.GetSizePixel().Width() - aSizePos.X();
-// aSizeFL.SetSizePixel(aSizeSize);
}
}
@@ -2400,10 +2290,6 @@ void SwFrmPage::EnableVerticalPositioning( bool bEnable )
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage( pParent, SW_RES(TP_GRF_EXT), rSet ),
aMirrorFL (this, SW_RES( FL_MIRROR )),
@@ -2412,7 +2298,7 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) :
aAllPagesRB (this, SW_RES( RB_MIRROR_ALL_PAGES )),
aLeftPagesRB (this, SW_RES( RB_MIRROR_LEFT_PAGES )),
aRightPagesRB (this, SW_RES( RB_MIRROR_RIGHT_PAGES )),
- aBmpWin (this, WN_BMP, Graphic(), BitmapEx(SW_RES(BMP_EXAMPLE)), BitmapEx(SW_RES(BMP_EXAMPLE_HC)) ),
+ aBmpWin (this, WN_BMP, Graphic(), BitmapEx(SW_RES(BMP_EXAMPLE))),
aConnectFL (this, SW_RES( FL_CONNECT )),
aConnectFT (this, SW_RES( FT_CONNECT )),
aConnectED (this, SW_RES( ED_CONNECT )),
@@ -2429,28 +2315,16 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) :
aBrowseBT.SetClickHdl ( LINK(this, SwGrfExtPage, BrowseHdl));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwGrfExtPage::~SwGrfExtPage()
{
delete pGrfDlg;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxTabPage* SwGrfExtPage::Create( Window *pParent, const SfxItemSet &rSet )
{
return new SwGrfExtPage( pParent, rSet );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwGrfExtPage::Reset(const SfxItemSet &rSet)
{
const SfxPoolItem* pItem;
@@ -2467,10 +2341,6 @@ void SwGrfExtPage::Reset(const SfxItemSet &rSet)
ActivatePage(rSet);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet)
{
const SvxProtectItem& rProt = (const SvxProtectItem& )rSet.Get(RES_PROTECT);
@@ -2509,14 +2379,14 @@ void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet)
switch (nPos)
{
- case 1: // Auf linken bzw geraden Seiten spiegeln
+ case 1: // mirror at left / even pages
aLeftPagesRB.Check();
aMirrorHorzBox.Check(sal_True);
break;
- case 2: // Auf allen Seiten spiegeln
+ case 2: // mirror on all pages
aAllPagesRB.Check();
break;
- case 3: // Auf rechten bzw ungeraden Seiten spiegeln
+ case 3: // mirror on right / odd pages
aRightPagesRB.Check();
break;
default:
@@ -2556,10 +2426,6 @@ void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet)
aBmpWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwGrfExtPage::FillItemSet( SfxItemSet &rSet )
{
sal_Bool bModified = sal_False;
@@ -2598,9 +2464,6 @@ sal_Bool SwGrfExtPage::FillItemSet( SfxItemSet &rSet )
}
return bModified;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
int SwGrfExtPage::DeactivatePage(SfxItemSet *_pSet)
{
@@ -2609,10 +2472,6 @@ int SwGrfExtPage::DeactivatePage(SfxItemSet *_pSet)
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
{
if(!pGrfDlg)
@@ -2628,7 +2487,7 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
xCtrlAcc->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aVal);
if ( pGrfDlg->Execute() == ERRCODE_NONE )
- { // ausgewaehlten Filter merken
+ { // remember selected filter
aFilterName = pGrfDlg->GetCurrentFilter();
aNewGrfName = INetURLObject::decode( pGrfDlg->GetPath(),
INET_HEX_ESCAPE,
@@ -2636,9 +2495,8 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
RTL_TEXTENCODING_UTF8 );
aConnectED.SetModifyFlag();
aConnectED.SetText( aNewGrfName );
- //Spiegeln zuruecksetzen, da u. U. eine Bitmap
- //gegen eine andere Art von Grafik ausgetauscht worden ist,
- //die nicht gespiegelt werden kann.
+ //reset mirrors because maybe a Bitmap was swapped with
+ //another type of graphic that cannot be mirrored.
aMirrorVertBox.Check(sal_False);
aMirrorHorzBox.Check(sal_False);
aAllPagesRB .Enable(sal_False);
@@ -2661,9 +2519,6 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
IMPL_LINK( SwGrfExtPage, MirrorHdl, CheckBox *, EMPTYARG )
{
@@ -2683,15 +2538,13 @@ IMPL_LINK( SwGrfExtPage, MirrorHdl, CheckBox *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: BeispielWindow
+ Description: example window
--------------------------------------------------------------------*/
-
BmpWindow::BmpWindow( Window* pPar, sal_uInt16 nId,
- const Graphic& rGraphic, const BitmapEx& rBmp, const BitmapEx& rBmpHC ) :
+ const Graphic& rGraphic, const BitmapEx& rBmp ) :
Window(pPar, SW_RES(nId)),
aGraphic(rGraphic),
aBmp(rBmp),
- aBmpHC(rBmpHC),
bHorz(sal_False),
bVert(sal_False),
bGraphic(sal_False),
@@ -2738,8 +2591,7 @@ void BmpWindow::Paint( const Rectangle& )
aGraphic.Draw( this, aPntPos, aPntSz );
else
{
- bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- DrawBitmapEx( aPntPos, aPntSz, bHC ? aBmpHC : aBmp );
+ DrawBitmapEx( aPntPos, aPntSz, aBmp );
}
}
@@ -2756,10 +2608,8 @@ void BmpWindow::SetGraphic(const Graphic& rGrf)
}
/***************************************************************************
- Beschreibung: URL und ImageMap an Rahmen einstellen
+ Description: set URL and ImageMap at frames
***************************************************************************/
-
-
SwFrmURLPage::SwFrmURLPage( Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage(pParent, SW_RES(TP_FRM_URL), rSet),
aHyperLinkFL (this, SW_RES( FL_HYPERLINK )),
@@ -2779,18 +2629,10 @@ SwFrmURLPage::SwFrmURLPage( Window *pParent, const SfxItemSet &rSet ) :
aSearchPB.SetClickHdl(LINK(this, SwFrmURLPage, InsertFileHdl));
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
SwFrmURLPage::~SwFrmURLPage()
{
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
void SwFrmURLPage::Reset( const SfxItemSet &rSet )
{
const SfxPoolItem* pItem;
@@ -2798,17 +2640,16 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet )
{
TargetList* pList = new TargetList;
((const SfxFrameItem*)pItem)->GetFrame()->GetTargetList(*pList);
- sal_uInt16 nCount = (sal_uInt16)pList->Count();
- if( nCount )
+ if( !pList->empty() )
{
- sal_uInt16 i;
- for ( i = 0; i < nCount; i++ )
+ size_t nCount = pList->size();
+ for ( size_t i = 0; i < nCount; i++ )
{
- aFrameCB.InsertEntry(*pList->GetObject(i));
+ aFrameCB.InsertEntry( *pList->at( i ) );
}
- for ( i = nCount; i; i-- )
+ for ( size_t i = nCount; i; )
{
- delete pList->GetObject( i - 1 );
+ delete pList->at( --i );
}
}
delete pList;
@@ -2837,12 +2678,6 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet )
aClientCB.SaveValue();
}
-
-
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bModified = sal_False;
@@ -2882,19 +2717,11 @@ sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet)
return bModified;
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
SfxTabPage* SwFrmURLPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwFrmURLPage( pParent, rSet );
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
IMPL_LINK( SwFrmURLPage, InsertFileHdl, PushButton *, EMPTYARG )
{
FileDialogHelper aDlgHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
@@ -2918,9 +2745,6 @@ IMPL_LINK( SwFrmURLPage, InsertFileHdl, PushButton *, EMPTYARG )
return 0;
}
-/* -----------------------------03.11.00 10:56--------------------------------
-
- ---------------------------------------------------------------------------*/
void lcl_Move(Window& rWin, sal_Int32 nDiff)
{
Point aPos(rWin.GetPosPixel());
@@ -2928,10 +2752,6 @@ void lcl_Move(Window& rWin, sal_Int32 nDiff)
rWin.SetPosPixel(aPos);
}
-/*-----------------13.11.96 13.15-------------------
-
---------------------------------------------------*/
-
SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage(pParent, SW_RES(TP_FRM_ADD), rSet),
@@ -2967,27 +2787,15 @@ SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
}
-/*-----------------13.11.96 13.15-------------------
-
---------------------------------------------------*/
-
SwFrmAddPage::~SwFrmAddPage()
{
}
-/*-----------------13.11.96 13.15-------------------
-
---------------------------------------------------*/
-
SfxTabPage* SwFrmAddPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwFrmAddPage(pParent, rSet);
}
-/*-----------------13.11.96 13.14-------------------
-
---------------------------------------------------*/
-
void SwFrmAddPage::Reset(const SfxItemSet &rSet )
{
const SfxPoolItem* pItem;
@@ -3017,15 +2825,15 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
if(!bFormat)
{
- // Grafik einfuegen - Eigenschaften
- // bNew ist nicht gesetzt, deswegen ueber Selektion erkennen
+ // insert graphic - properties
+ // bNew is not set, so recognise by selection
String aTmpName1;
if(SFX_ITEM_SET == rSet.GetItemState(FN_SET_FRM_NAME, sal_False, &pItem))
{
aTmpName1 = ((const SfxStringItem*)pItem)->GetValue();
}
- DBG_ASSERT(pWrtSh, "keine Shell?");
+ OSL_ENSURE(pWrtSh, "keine Shell?");
if( bNew || !aTmpName1.Len() )
switch( nDlgType )
@@ -3126,7 +2934,6 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
aThisPageFrames.erase(aThisPageFrames.begin(), aThisPageFrames.end());
aRemainFrames.erase(aRemainFrames.begin(), aRemainFrames.end());
-
pWrtSh->GetConnectableFrmFmts(*pFmt, sPrevChain, sal_True,
aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames );
lcl_InsertVectors(aNextLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames);
@@ -3152,7 +2959,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
const SwFmtEditInReadonly& rEdit = (const SwFmtEditInReadonly& )rSet.Get(RES_EDIT_IN_READONLY);
aEditInReadonlyCB.Check(rEdit.GetValue()); aEditInReadonlyCB.SaveValue();
- // drucken
+ // print
const SvxPrintItem& rPrt = (const SvxPrintItem&)rSet.Get(RES_PRINT);
aPrintFrameCB.Check(rPrt.GetValue()); aPrintFrameCB.SaveValue();
@@ -3186,10 +2993,6 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
}
}
-/*-----------------13.11.96 13.20-------------------
-
---------------------------------------------------*/
-
sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bRet = sal_False;
@@ -3252,19 +3055,11 @@ sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet)
return bRet;
}
-/*-----------------13.11.96 15.05-------------------
-
---------------------------------------------------*/
-
sal_uInt16* SwFrmAddPage::GetRanges()
{
return aAddPgRg;
}
-/*-----------------13.11.96 16.12-------------------
-
---------------------------------------------------*/
-
IMPL_LINK(SwFrmAddPage, EditModifyHdl, Edit*, EMPTYARG)
{
sal_Bool bEnable = 0 != aNameED.GetText().Len();
@@ -3273,7 +3068,7 @@ IMPL_LINK(SwFrmAddPage, EditModifyHdl, Edit*, EMPTYARG)
return 0;
}
-//-----------------------------------------------------------------------------
+
void SwFrmAddPage::SetFormatUsed(sal_Bool bFmt)
{
bFormat = bFmt;
@@ -3308,9 +3103,7 @@ void SwFrmAddPage::SetFormatUsed(sal_Bool bFmt)
lcl_Move(*aWindows[nIdx++], nDiff);
}
}
-/* -----------------------------08.08.2002 16:24------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox)
{
String sCurrentPrevChain, sCurrentNextChain;
@@ -3343,3 +3136,5 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox)
}
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/frmpage.hrc b/sw/source/ui/frmdlg/frmpage.hrc
index 044d2fdd4e05..ed58d821f032 100644
--- a/sw/source/ui/frmdlg/frmpage.hrc
+++ b/sw/source/ui/frmdlg/frmpage.hrc
@@ -105,7 +105,6 @@
#define ED_URL 59
#define BMP_EXAMPLE 62
-#define BMP_EXAMPLE_HC 63
#define RB_MIRROR_ALL_PAGES 64
#define RB_MIRROR_LEFT_PAGES 65
#define RB_MIRROR_RIGHT_PAGES 66
diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src
index 782607000386..f813471c5b76 100644
--- a/sw/source/ui/frmdlg/frmpage.src
+++ b/sw/source/ui/frmdlg/frmpage.src
@@ -543,10 +543,6 @@ TabPage TP_GRF_EXT
{
File = "dog.bmp" ;
};
- Bitmap BMP_EXAMPLE_HC
- {
- File = "dog_h.bmp" ;
- };
FixedLine FL_CONNECT
{
Pos = MAP_APPFONT ( 6 , 87 ) ;
diff --git a/sw/source/ui/frmdlg/frmui.src b/sw/source/ui/frmdlg/frmui.src
index 5e3abb1286e4..a52b7341d776 100644
--- a/sw/source/ui/frmdlg/frmui.src
+++ b/sw/source/ui/frmdlg/frmui.src
@@ -27,7 +27,7 @@
#include "frmui.hrc"
/*-----------------------------------------------------------------------
- Beschreibung: V-Align
+ Description: V-Align
-----------------------------------------------------------------------*/
String STR_TOP
{
@@ -46,7 +46,7 @@ String STR_CENTER_HORI
Text [ en-US ] = "~Center" ;
};
/*-----------------------------------------------------------------------
- Beschreibung: V-Rel
+ Description: V-Rel
-----------------------------------------------------------------------*/
String STR_TOPPRT
{
@@ -54,13 +54,13 @@ String STR_TOPPRT
};
/*-----------------------------------------------------------------------
- Beschreibung: H-Rel
+ Description: H-Rel
-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------
- Beschreibung: V-Rel Zeichenausrichtungen
+ Description: V-Rel character alignment
-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------
- Beschreibung: Zeichenausrichtungen fuer frmsh.cxx - Kontextmenue
+ Description: character alignment for frmsh.cxx - context menu
-----------------------------------------------------------------------*/
String STR_TOP_BASE
{
@@ -100,7 +100,6 @@ String STR_CHAR_CENTER
};
String STR_OLE_INSERT
{
- /* ### ACHTUNG: Neuer Text in Resource? Objekt einfügen : Objekt einf³gen */
Text [ en-US ] = "Insert object" ;
};
String STR_OLE_EDIT
@@ -127,7 +126,6 @@ InfoBox MSG_COLUMN_ERR_BOUNDWIDTH
{
BUTTONS = WB_OK ;
DEFBUTTON = WB_DEF_OK ;
- /* ### ACHTUNG: Neuer Text in Resource? Der Spaltenabstand ist zu groß für die Spaltenbreite. : Der Spaltenabstand ist zu gro˜ f³r die Spaltenbreite. */
Message [ en-US ] = "Column spacing exceeds the column width." ;
};
diff --git a/sw/source/ui/frmdlg/pattern.cxx b/sw/source/ui/frmdlg/pattern.cxx
index 9b2de83e8f59..d59d6778f919 100644
--- a/sw/source/ui/frmdlg/pattern.cxx
+++ b/sw/source/ui/frmdlg/pattern.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,7 @@ SwBackgroundDlg::SwBackgroundDlg(Window* pParent, const SfxItemSet& rSet) :
{
SetText(SW_RESSTR(STR_FRMUI_PATTERN));
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
if ( fnCreatePage )
{
@@ -73,3 +74,4 @@ SwBackgroundDlg::~SwBackgroundDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
index 8a7ddfd6b5f9..5f25a0cbcca6 100644
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,9 +55,9 @@ SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType) :
{
SetText(SW_RESSTR(STR_FRMUI_BORDER));
- // TabPage erzeugen
+ // create TabPage
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER );
if ( fnCreatePage )
{
@@ -77,3 +78,4 @@ SwBorderDlg::~SwBorderDlg()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index fc988a3ab0e6..75b99eb17c70 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
#include <editeng/opaqitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
-// OD 18.09.2003 #i18732#
+// #i18732#
#include <fmtfollowtextflow.hxx>
#include <svx/swframevalidation.hxx>
@@ -60,31 +61,19 @@
using namespace ::com::sun::star;
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-static sal_uInt16 __FAR_DATA aWrapPageRg[] = {
+static sal_uInt16 aWrapPageRg[] = {
RES_LR_SPACE, RES_UL_SPACE,
RES_PROTECT, RES_SURROUND,
RES_PRINT, RES_PRINT,
0
};
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode) :
SfxSingleTabDialog(pParent, rSet, 0),
pWrtShell(pSh)
{
- // TabPage erzeugen
+ // create TabPage
SwWrapTabPage* pNewPage = (SwWrapTabPage*) SwWrapTabPage::Create(this, rSet);
pNewPage->SetFormatUsed(sal_False, bDrawMode);
pNewPage->SetShell(pWrtShell);
@@ -94,18 +83,10 @@ SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Boo
SetText(sTitle);
}
-
-
SwWrapDlg::~SwWrapDlg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_FRM_WRAP), rSet),
@@ -135,7 +116,6 @@ SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) :
aWrapOutsideCB (this, SW_RES(CB_ONLYOUTSIDE)),
aWrapIL (SW_RES(IL_WRAP)),
- aWrapILH (SW_RES(ILH_WRAP)),
nAnchorId(FLY_AT_PARA),
nHtmlMode(0),
@@ -187,27 +167,18 @@ SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) :
aWrapOutlineCB.SetClickHdl(LINK(this, SwWrapTabPage, ContourHdl));
}
-
-
SwWrapTabPage::~SwWrapTabPage()
{
}
-
-
SfxTabPage* SwWrapTabPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwWrapTabPage(pParent, rSet);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwWrapTabPage::Reset(const SfxItemSet &rSet)
{
- //Contour fuer Draw, Grafik und OLE (Einfuegen/Grafik/Eigenschaften fehlt noch!)
+ // contour for Draw, Graphic and OLE (Insert/Graphic/Properties still missing!)
if( bDrawMode )
{
aWrapOutlineCB.Show();
@@ -313,9 +284,9 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet)
{
pBtn->Check();
WrapTypeHdl(pBtn);
- // Hier wird fuer Zeichenobjekte, die im Moment auf Durchlauf stehen,
- // schon mal der Default "Kontur an" vorbereitet, falls man spaeter auf
- // irgendeinen Umlauf umschaltet.
+ // For character objects that currently are in passage, the default
+ // "contour on" is prepared here, in case we switch to any other
+ // passage later.
if (bDrawMode && !aWrapOutlineCB.IsEnabled())
aWrapOutlineCB.Check();
}
@@ -324,7 +295,7 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet)
const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rSet.Get(RES_UL_SPACE);
const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rSet.Get(RES_LR_SPACE);
- // Abstand zum Text
+ // gap to text
aLeftMarginED.SetValue(aLeftMarginED.Normalize(rLR.GetLeft()), FUNIT_TWIP);
aRightMarginED.SetValue(aRightMarginED.Normalize(rLR.GetRight()), FUNIT_TWIP);
aTopMarginED.SetValue(aTopMarginED.Normalize(rUL.GetUpper()), FUNIT_TWIP);
@@ -335,11 +306,8 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Attribute in den Set stopfen bei OK
+ Description: stuff attributes into the set when OK
--------------------------------------------------------------------*/
-
-
-
sal_Bool SwWrapTabPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bModified = sal_False;
@@ -443,14 +411,11 @@ sal_Bool SwWrapTabPage::FillItemSet(SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Bsp - Update
+ Description: example update
--------------------------------------------------------------------*/
-
-
-
void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
{
- // Anchor
+ // anchor
const SwFmtAnchor &rAnch = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR);
nAnchorId = rAnch.GetAnchorId();
sal_Bool bEnable = (nAnchorId != FLY_AS_CHAR);
@@ -461,11 +426,11 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() );
SvxSwFrameValidation aVal;
- // Size
+ // size
const SwFmtFrmSize& rFrmSize = (const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE);
Size aSize = rFrmSize.GetSize();
- // Rand
+ // margin
const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rSet.Get(RES_UL_SPACE);
const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rSet.Get(RES_LR_SPACE);
nOldLeftMargin = static_cast< sal_uInt16 >(rLR.GetLeft());
@@ -473,7 +438,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
nOldUpperMargin = static_cast< sal_uInt16 >(rUL.GetUpper());
nOldLowerMargin = static_cast< sal_uInt16 >(rUL.GetLower());
- // Position
+ // position
const SwFmtHoriOrient& rHori = (const SwFmtHoriOrient&)rSet.Get(RES_HORI_ORIENT);
const SwFmtVertOrient& rVert = (const SwFmtVertOrient&)rSet.Get(RES_VERT_ORIENT);
@@ -481,7 +446,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
aVal.bAutoHeight = rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE;
aVal.bAutoWidth = rFrmSize.GetWidthSizeType() == ATT_MIN_SIZE;
aVal.bMirror = rHori.IsPosToggle();
- // OD 18.09.2003 #i18732#
+ // #i18732#
aVal.bFollowTextFlow =
static_cast<const SwFmtFollowTextFlow&>(rSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue();
@@ -531,7 +496,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
if (aVal.nVPos <= aVal.nMaxHeight)
nTop = aVal.nMaxVPos - aVal.nHeight;
else
- nTop = nBottom = 0; // Kein Umlauf
+ nTop = nBottom = 0; // no passage
}
else
nTop = aVal.nMaxVPos - aVal.nHeight - aVal.nVPos;
@@ -642,8 +607,6 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
ContourHdl(0);
}
-
-
int SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet)
{
if(_pSet)
@@ -653,11 +616,8 @@ int SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Bereichspruefung
+ Description: range check
--------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit )
{
if(bHtmlMode && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS))
@@ -686,21 +646,20 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit )
else if (pEdit == &aBottomMarginED)
pOpposite = &aTopMarginED;
- sal_Int64 nOpposite = pOpposite->GetValue();
+ OSL_ASSERT(pOpposite);
- if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax()))
- pOpposite->SetValue(pOpposite->GetMax() - nValue);
+ if (pOpposite)
+ {
+ sal_Int64 nOpposite = pOpposite->GetValue();
+
+ if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax()))
+ pOpposite->SetValue(pOpposite->GetMax() - nValue);
+ }
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn )
{
sal_Bool bWrapThrough = (pBtn == &aWrapThroughRB);
@@ -716,12 +675,6 @@ IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG )
{
sal_Bool bEnable = !(aWrapOutlineCB.IsChecked() && aWrapOutlineCB.IsEnabled());
@@ -729,7 +682,7 @@ IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG )
aWrapOutsideCB.Enable(!bEnable);
bEnable = !aWrapOutlineCB.IsChecked();
- if (bEnable == bContourImage) // damit es nicht immer flackert
+ if (bEnable == bContourImage) // so that it doesn't always flicker
{
bContourImage = !bEnable;
ApplyImageList();
@@ -738,16 +691,11 @@ IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
sal_uInt16* SwWrapTabPage::GetRanges()
{
return aWrapPageRg;
}
-/* -----------------------------08.05.2002 14:28------------------------------
- ---------------------------------------------------------------------------*/
void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
@@ -756,30 +704,29 @@ void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt )
SfxTabPage::DataChanged( rDCEvt );
}
-/* -----------------------------08.05.2002 14:28------------------------------
- ---------------------------------------------------------------------------*/
void SwWrapTabPage::ApplyImageList()
{
- ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ?
- aWrapILH : aWrapIL;
+ ImageList& rImgLst = aWrapIL;
aWrapThroughRB.SetModeRadioImage(rImgLst.GetImage(IMG_THROUGH));
sal_Bool bWrapOutline = !aWrapOutlineCB.IsChecked();
if(bWrapOutline)
{
- aNoWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_NONE));
- aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage(IMG_LEFT));
- aWrapRightRB.SetModeRadioImage(rImgLst.GetImage(IMG_RIGHT));
- aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_PARALLEL));
- aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_IDEAL));
+ aNoWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_NONE ));
+ aWrapLeftRB.SetModeRadioImage( rImgLst.GetImage( IMG_LEFT ));
+ aWrapRightRB.SetModeRadioImage( rImgLst.GetImage( IMG_RIGHT ));
+ aWrapParallelRB.SetModeRadioImage( rImgLst.GetImage( IMG_PARALLEL ));
+ aIdealWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_IDEAL ));
}
else
{
- aNoWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_NONE ));
- aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_LEFT ));
- aWrapRightRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_RIGHT ));
- aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_KON_PARALLEL ));
- aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_IDEAL ));
+ aNoWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_NONE ));
+ aWrapLeftRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_LEFT ));
+ aWrapRightRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_RIGHT ));
+ aWrapParallelRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_PARALLEL ));
+ aIdealWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_IDEAL ));
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/frmdlg/wrap.hrc b/sw/source/ui/frmdlg/wrap.hrc
index be19dbe702c2..5874b161e012 100644
--- a/sw/source/ui/frmdlg/wrap.hrc
+++ b/sw/source/ui/frmdlg/wrap.hrc
@@ -24,13 +24,13 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#define RB_NO_WRAP 2
-#define RB_WRAP_LEFT 3
-#define RB_WRAP_RIGHT 4
-#define RB_WRAP_PARALLEL 5
-#define RB_WRAP_THROUGH 6
-#define RB_WRAP_IDEAL 7
-#define CB_ANCHOR_ONLY 8
+#define RB_NO_WRAP 2
+#define RB_WRAP_LEFT 3
+#define RB_WRAP_RIGHT 4
+#define RB_WRAP_PARALLEL 5
+#define RB_WRAP_THROUGH 6
+#define RB_WRAP_IDEAL 7
+#define CB_ANCHOR_ONLY 8
#define FT_LEFT_MARGIN 13
#define ED_LEFT_MARGIN 14
#define FT_RIGHT_MARGIN 15
@@ -39,28 +39,25 @@
#define ED_TOP_MARGIN 18
#define ED_BOTTOM_MARGIN 19
#define FT_BOTTOM_MARGIN 20
-#define FL_MARGIN 21
+#define FL_MARGIN 21
#define CB_TRANSPARENT 22
#define CB_OUTLINE 23
-#define FL_OPTION 24
+#define FL_OPTION 24
#define CB_ONLYOUTSIDE 25
-#define FL_OPTION_SEP 26
-#define C_WRAP_FL 31
+#define FL_OPTION_SEP 26
+#define C_WRAP_FL 31
#define IL_WRAP 32
-#define ILH_WRAP 33
// nur fuer die ImageList
-#define IMG_BEGIN 1
-#define IMG_NONE (IMG_BEGIN)
-#define IMG_LEFT (IMG_BEGIN + 1)
-#define IMG_RIGHT (IMG_BEGIN + 2)
-#define IMG_PARALLEL (IMG_BEGIN + 3)
-#define IMG_THROUGH (IMG_BEGIN + 4)
-#define IMG_IDEAL (IMG_BEGIN + 5)
-#define IMG_KON_NONE (IMG_BEGIN + 6)
-#define IMG_KON_LEFT (IMG_BEGIN + 7)
-#define IMG_KON_RIGHT (IMG_BEGIN + 8)
-#define IMG_KON_PARALLEL (IMG_BEGIN + 9)
-#define IMG_KON_IDEAL (IMG_BEGIN + 10)
-
-
+#define IMG_BEGIN 1
+#define IMG_NONE (IMG_BEGIN)
+#define IMG_LEFT (IMG_BEGIN + 1)
+#define IMG_RIGHT (IMG_BEGIN + 2)
+#define IMG_PARALLEL (IMG_BEGIN + 3)
+#define IMG_THROUGH (IMG_BEGIN + 4)
+#define IMG_IDEAL (IMG_BEGIN + 5)
+#define IMG_KON_NONE (IMG_BEGIN + 6)
+#define IMG_KON_LEFT (IMG_BEGIN + 7)
+#define IMG_KON_RIGHT (IMG_BEGIN + 8)
+#define IMG_KON_PARALLEL (IMG_BEGIN + 9)
+#define IMG_KON_IDEAL (IMG_BEGIN + 10)
diff --git a/sw/source/ui/frmdlg/wrap.src b/sw/source/ui/frmdlg/wrap.src
index a3f23e79624b..5b4bbd19a48d 100644
--- a/sw/source/ui/frmdlg/wrap.src
+++ b/sw/source/ui/frmdlg/wrap.src
@@ -260,12 +260,4 @@ TabPage TP_FRM_WRAP
MaskColor = IMAGE_MASK_COLOR ;
WRAP_IDLIST
};
- ImageList ILH_WRAP
- {
- Prefix = "wrh";
- MaskColor = IMAGE_MASK_COLOR ;
- WRAP_IDLIST
- };
-
};
-
diff --git a/sw/source/ui/globdoc/globdoc.cxx b/sw/source/ui/globdoc/globdoc.cxx
index a4572f0a16da..1b92ec6d794a 100644
--- a/sw/source/ui/globdoc/globdoc.cxx
+++ b/sw/source/ui/globdoc/globdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,13 +43,11 @@
#include "cfgid.h"
-/*--------------------------------------------------------------------
- Beschreibung: Alle Filter registrieren
- --------------------------------------------------------------------*/
+
+// Description: Register all filters
TYPEINIT1(SwGlobalDocShell, SwDocShell);
-//-------------------------------------------------------------------------
SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/GlobalDocument" )
SwGlobalDocShell::SwGlobalDocShell(SfxObjectCreateMode eMode ) :
@@ -69,7 +68,7 @@ void SwGlobalDocShell::FillClass( SvGlobalName * pClassName,
sal_Bool bTemplate /* = sal_False */) const
{
(void)bTemplate;
- DBG_ASSERT( bTemplate == sal_False, "No template for Writer Global" );
+ OSL_ENSURE( bTemplate == sal_False, "No template for Writer Global" );
if (nVersion == SOFFICE_FILEFORMAT_60)
{
@@ -89,3 +88,4 @@ void SwGlobalDocShell::FillClass( SvGlobalName * pClassName,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/DropDownFieldDialog.hxx b/sw/source/ui/inc/DropDownFieldDialog.hxx
index 9800783c2e48..cabf71ac46c1 100644
--- a/sw/source/ui/inc/DropDownFieldDialog.hxx
+++ b/sw/source/ui/inc/DropDownFieldDialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <svx/stddlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwDropDownField;
class SwField;
@@ -67,5 +66,6 @@ public:
};
} //namespace sw
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/SidebarWindowsConsts.hxx b/sw/source/ui/inc/SidebarWindowsConsts.hxx
index 378b2be0790a..5df62bdee181 100644
--- a/sw/source/ui/inc/SidebarWindowsConsts.hxx
+++ b/sw/source/ui/inc/SidebarWindowsConsts.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,10 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- *
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -39,3 +36,5 @@ const sal_Int8 ANCHORLINE_WIDTH = 1;
} } // end of namespace sw::sidebarwindows
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
index b45dd1a6cd2d..0d3cf88faac2 100644
--- a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
+++ b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#define SW_SPELL_DIALOG_CHILD_WINDOW_HXX
#include <svx/SpellDialogChildWindow.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
class SwWrtShell;
struct SpellState;
@@ -74,3 +73,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/SwXFilterOptions.hxx b/sw/source/ui/inc/SwXFilterOptions.hxx
index c1dcc3676447..e5d6030be989 100644
--- a/sw/source/ui/inc/SwXFilterOptions.hxx
+++ b/sw/source/ui/inc/SwXFilterOptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,10 +39,6 @@ namespace com { namespace sun { namespace star { namespace io {
class XInputStream;
} } } }
-
-/* -----------------------------2002/06/21 12:07------------------------------
-
- ---------------------------------------------------------------------------*/
class SwXFilterOptions : public ::cppu::WeakImplHelper5<
::com::sun::star::beans::XPropertyAccess,
::com::sun::star::ui::dialogs::XExecutableDialog,
@@ -111,3 +108,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/abstract.hxx b/sw/source/ui/inc/abstract.hxx
index 4dd8f3a56b65..755d30b61503 100644
--- a/sw/source/ui/inc/abstract.hxx
+++ b/sw/source/ui/inc/abstract.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,22 +30,12 @@
#include <sfx2/basedlgs.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-
-
-/*-----------------22.02.97 15.06-------------------
---------------------------------------------------*/
class SwInsertAbstractDlg : public SfxModalDialog
{
FixedLine aFL;
@@ -71,3 +62,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/actctrl.hxx b/sw/source/ui/inc/actctrl.hxx
index d1e9a3d82907..f28bd79ec8e5 100644
--- a/sw/source/ui/inc/actctrl.hxx
+++ b/sw/source/ui/inc/actctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,15 +28,12 @@
#ifndef _ACTCTRL_HXX
#define _ACTCTRL_HXX
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include "swdllapi.h"
/*--------------------------------------------------------------------
- Beschreibung: numerische Eingabe
+ Description: numerical input
--------------------------------------------------------------------*/
-
class SW_DLLPUBLIC NumEditAction: public NumericField
{
Link aActionLink;
@@ -52,8 +50,8 @@ public:
};
-/* -----------------21.04.98 08:11-------------------
- * Edit, dass keine Spaces akzeptiert
+/* --------------------------------------------------
+ * Edit that doesn't accept spaces
* --------------------------------------------------*/
class SW_DLLPUBLIC NoSpaceEdit : public Edit
{
@@ -69,8 +67,8 @@ public:
const String& GetForbiddenChars(){return sForbiddenChars;}
};
-/* -----------------21.04.98 08:33-------------------
- * Kein Space und kein Punkt
+/* --------------------------------------------------
+ * No space and no full stop
* --------------------------------------------------*/
class TableNameEdit : public NoSpaceEdit
{
@@ -79,7 +77,8 @@ public:
NoSpaceEdit(pWin, rResId)
{SetForbiddenChars(String::CreateFromAscii(" .<>"));}
};
-/* -----------------25.06.2003 15:55-----------------
+
+/* --------------------------------------------------
call a link when KEY_RETURN is pressed
--------------------------------------------------*/
class SW_DLLPUBLIC ReturnActionEdit : public Edit
@@ -96,3 +95,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/addrdlg.hxx b/sw/source/ui/inc/addrdlg.hxx
index 9e8370d1e2fc..de798ad12f5d 100644
--- a/sw/source/ui/inc/addrdlg.hxx
+++ b/sw/source/ui/inc/addrdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/annotsh.hxx b/sw/source/ui/inc/annotsh.hxx
index ee8d8e9ccf17..b70b23d6f8ed 100755..100644
--- a/sw/source/ui/inc/annotsh.hxx
+++ b/sw/source/ui/inc/annotsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,13 @@
#include <sfx2/shell.hxx>
#include "shellid.hxx"
#include "swmodule.hxx"
+#include <unotools/caserotate.hxx>
class SwView;
class SwAnnotationShell: public SfxShell
{
SwView& rView;
+ RotateTransliteration m_aRotateCase;
public:
SFX_DECL_INTERFACE(SW_ANNOTATIONSHELL)
@@ -59,6 +62,7 @@ public:
void StateClpbrd(SfxItemSet &rSet);
void ExecTransliteration(SfxRequest &);
+ void ExecRotateTransliteration(SfxRequest &);
void ExecUndo(SfxRequest &rReq);
void StateUndo(SfxItemSet &rSet);
@@ -76,3 +80,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc
index edf7014a4e4f..5de05376a882 100644
--- a/sw/source/ui/inc/app.hrc
+++ b/sw/source/ui/inc/app.hrc
@@ -30,148 +30,99 @@
#include "rcid.hrc"
-// Default Bitmap fuer ToolBox
-#define BMP_FEHLT (RC_APP_BEGIN + 1)
-
// Document-Icon
-#define RC_DOC_ICON (RC_APP_BEGIN + 2)
+#define RC_DOC_ICON (RC_APP_BEGIN + 2)
-//Soll das Clipboard fuer andere Applikationen...
-#define MSG_CLPBRD_CLEAR (RC_APP_BEGIN + 3)
+// Should the clipboard for other applications...
+#define MSG_CLPBRD_CLEAR (RC_APP_BEGIN + 3)
-#define STR_CANTCREATE (RC_APP_BEGIN + 4)
-#define STR_CANTOPEN (RC_APP_BEGIN + 5)
+#define STR_CANTCREATE (RC_APP_BEGIN + 4)
+#define STR_CANTOPEN (RC_APP_BEGIN + 5)
// Messages
-#define MSG_ERROR_SEND_MAIL ( RC_APP_BEGIN + 6)
-#define MSG_SAVE_HTML_QUERY ( RC_APP_BEGIN + 7)
-
-//Fuer das Interface, weil der RID_APP_BEGIN jetzt Desktop ist.
-#define RID_SW_NAME ( RC_APP_BEGIN + 8)
-#define MSG_SAVEAS_HTML_QUERY ( RC_APP_BEGIN + 9)
-
-
-#define STR_UNBENANNT (RC_APP_BEGIN + 13)
-#define STR_VERSION (RC_APP_BEGIN + 14)
-#define STR_PRINT_MERGE_MACRO (RC_APP_BEGIN + 15)
-#define STR_PAGE_COUNT_MACRO (RC_APP_BEGIN + 16)
-
-// Bitmap fuer die NumerierungsVorlagen im Organizer
-#define BMP_STYLES_FAMILY_NUM (RC_APP_BEGIN + 17)
-#define BMP_STYLES_FAMILY_NUM_HC (RC_APP_BEGIN + 18)
-
-// Strings fuer Bereiche in der Konfiguration
-#define STR_GRP_FILE (RC_APP_BEGIN + 56)
-#define STR_GRP_EDIT (RC_APP_BEGIN + 57)
-#define STR_GRP_TRAVELLING (RC_APP_BEGIN + 58)
-#define STR_GRP_VIEW (RC_APP_BEGIN + 59)
-#define STR_GRP_INSERT (RC_APP_BEGIN + 60)
-#define STR_GRP_FORMAT (RC_APP_BEGIN + 61)
-#define STR_GRP_STYLE (RC_APP_BEGIN + 62)
-#define STR_GRP_TEXT (RC_APP_BEGIN + 63)
-#define STR_GRP_FRAME (RC_APP_BEGIN + 64)
-#define STR_GRP_GRAPHIC (RC_APP_BEGIN + 65)
-#define STR_GRP_TABLE (RC_APP_BEGIN + 66)
-#define STR_GRP_TOOLS (RC_APP_BEGIN + 67)
-#define STR_GRP_NUMBERING (RC_APP_BEGIN + 68)
-#define STR_GRP_WINDOW (RC_APP_BEGIN + 69)
-#define STR_GRP_MISC (RC_APP_BEGIN + 70)
-#define STR_GRP_MACRO (RC_APP_BEGIN + 71)
-#define RES_EXT_HELP_STRING (RC_APP_BEGIN + 72)
-#define RES_STD_HELP_STRING (RC_APP_BEGIN + 73)
-#define STR_PAGEOFFSET (RC_APP_BEGIN + 74)
-#define STR_PAGEBREAK (RC_APP_BEGIN + 75)
-#define STR_REDLINE_UNKNOWN_AUTHOR (RC_APP_BEGIN + 76)
-#define STR_WESTERN_FONT (RC_APP_BEGIN + 77)
-#define STR_CJK_FONT (RC_APP_BEGIN + 78)
-//#define MSG_INS_MERGE_FIELDS (RC_APP_BEGIN + 79)
-#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80)
-#define MSG_DATA_SOURCES_UNAVAILABLE (RC_APP_BEGIN + 82)
-#define DLG_MERGE_SOURCE_UNAVAILABLE (RC_APP_BEGIN + 83)
-#define ST_MERGE_SOURCE_UNAVAILABLE 1
-#define PB_MERGE_OK 2
-#define PB_MERGE_CANCEL 3
-#define IMG_MERGE 4
-#define SID_TOGGLETOOLBOX (RC_APP_BEGIN + 89)
-
-#define STR_ENV_TITLE (RC_APP_BEGIN + 91)
-#define STR_LAB_TITLE (RC_APP_BEGIN + 92)
-
-#define STR_HUMAN_SWDOC_NAME (RC_APP_BEGIN + 93)
-
-#define RID_SW_ERRHDL (RC_APP_BEGIN + 95)
-
-#define STR_FDLG_TEMPLATE_BUTTON (RC_APP_BEGIN + 1)
-#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2)
-
-
-// Ids fuer die einzelnen PopUpMenues
-//#define MN_WIZARD (RC_APP_BEGIN + 9)
-//#define MN_INDEX (RC_APP_BEGIN + 10)
-//#define MN_FILE (RC_APP_BEGIN + 11)
-//#define MN_EDIT (RC_APP_BEGIN + 12)
-//#define MN_VIEW (RC_APP_BEGIN + 13)
-//#define MN_INS (RC_APP_BEGIN + 14)
-//#define MN_TEXT (RC_APP_BEGIN + 15)
-//#define MN_FORMAT (RC_APP_BEGIN + 16)
-#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17)
-#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18)
-#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19)
-//#define MN_EXTRA (RC_APP_BEGIN + 20)
-//#define MN_WIN (RC_APP_BEGIN + 21)
-//#define MN_HELP (RC_APP_BEGIN + 22)
-#define MN_FORMAT_FRM_HORZ (RC_APP_BEGIN + 23)
-//#define MN_FORMAT_FRM_VERT (RC_APP_BEGIN + 24)
-//#define MN_PICKLIST (RC_APP_BEGIN + 25)
-//#define MN_WINLIST (RC_APP_BEGIN + 26)
-//#define MN_MACRO (RC_APP_BEGIN + 27)
-//#define MN_FORMAT_HIERARCHY (RC_APP_BEGIN + 28)
-#define MN_CELL (RC_APP_BEGIN + 29)
-//#define MN_HELP_TIP (RC_APP_BEGIN + 30)
-//#define MN_HELP_SEARCH (RC_APP_BEGIN + 31)
-//#define MN_HELP_ACTIVE (RC_APP_BEGIN + 32)
-//#define MN_HELP_INDEX (RC_APP_BEGIN + 33)
-//#define MN_OBJECT (RC_APP_BEGIN + 34)
-//#define MN_DATABASE (RC_APP_BEGIN + 35)
-//#define MN_DIRSUBMENU (RC_APP_BEGIN + 36)
-//#define MN_MAIL (RC_APP_BEGIN + 37)
-#define MN_WRAP (RC_APP_BEGIN + 38)
-#define MN_SUB_TBLROW (RC_APP_BEGIN + 39)
-#define MN_SUB_TBLCOL (RC_APP_BEGIN + 40)
-//#define MN_SUB_AUTOFORMAT (RC_APP_BEGIN + 41)
-//#define MN_SUB_TOOLBAR (RC_APP_BEGIN + 42)
-//#define MN_SUB_FIELD (RC_APP_BEGIN + 43)
-//#define MN_SUB_GRAPHIC (RC_APP_BEGIN + 44)
-//#define MN_SUB_TEMPLATES (RC_APP_BEGIN + 45)
-#define MN_SUB_ARRANGE (RC_APP_BEGIN + 46)
-
-//#define MN_SUB_UPDATE (RC_APP_BEGIN + 48)
-//#define MN_SUB_MIRROR (RC_APP_BEGIN + 49)
-#define MN_SUB_ALIGN (RC_APP_BEGIN + 50)
-//#define MN_SUB_OPTIONS (RC_APP_BEGIN + 51)
-//#define MN_SUB_SENDTO (RC_APP_BEGIN + 52)
-//#define MN_SUB_REVISE (RC_APP_BEGIN + 53)
-//#define MN_TEMPLATES (RC_APP_BEGIN + 54)
-//#define MN_FILE_PORT (RC_APP_BEGIN + 55)
-//#define MN_EDIT_PORT (RC_APP_BEGIN + 56)
-//#define MN_VIEW_PORT (RC_APP_BEGIN + 57)
-//#define MN_INS_PORT (RC_APP_BEGIN + 58)
-//#define MN_FORMAT_PORT (RC_APP_BEGIN + 59)
-//#define MN_EXTRA_PORT (RC_APP_BEGIN + 60)
-//#define MN_WIN_PORT (RC_APP_BEGIN + 61)
-//#define MN_HELP_PORT (RC_APP_BEGIN + 62)
-//#define MN_SUB_TRANSLITERATE (RC_APP_BEGIN + 63)
-//#define MN_SUB_MACRO (RC_APP_BEGIN + 64)
+#define MSG_ERROR_SEND_MAIL ( RC_APP_BEGIN + 6)
+#define MSG_SAVE_HTML_QUERY ( RC_APP_BEGIN + 7)
+
+// For the interface because the RID_APP_BEGIN is now Desktop.
+#define RID_SW_NAME ( RC_APP_BEGIN + 8)
+#define MSG_SAVEAS_HTML_QUERY ( RC_APP_BEGIN + 9)
+
+
+#define STR_UNBENANNT (RC_APP_BEGIN + 13)
+#define STR_VERSION (RC_APP_BEGIN + 14)
+#define STR_PRINT_MERGE_MACRO (RC_APP_BEGIN + 15)
+#define STR_PAGE_COUNT_MACRO (RC_APP_BEGIN + 16)
+
+// Bitmap for the numbering style in organizer
+#define BMP_STYLES_FAMILY_NUM (RC_APP_BEGIN + 17)
+
+// Strings for regions in the configuration
+#define STR_GRP_FILE (RC_APP_BEGIN + 56)
+#define STR_GRP_EDIT (RC_APP_BEGIN + 57)
+#define STR_GRP_TRAVELLING (RC_APP_BEGIN + 58)
+#define STR_GRP_VIEW (RC_APP_BEGIN + 59)
+#define STR_GRP_INSERT (RC_APP_BEGIN + 60)
+#define STR_GRP_FORMAT (RC_APP_BEGIN + 61)
+#define STR_GRP_STYLE (RC_APP_BEGIN + 62)
+#define STR_GRP_TEXT (RC_APP_BEGIN + 63)
+#define STR_GRP_FRAME (RC_APP_BEGIN + 64)
+#define STR_GRP_GRAPHIC (RC_APP_BEGIN + 65)
+#define STR_GRP_TABLE (RC_APP_BEGIN + 66)
+#define STR_GRP_TOOLS (RC_APP_BEGIN + 67)
+#define STR_GRP_NUMBERING (RC_APP_BEGIN + 68)
+#define STR_GRP_WINDOW (RC_APP_BEGIN + 69)
+#define STR_GRP_MISC (RC_APP_BEGIN + 70)
+#define STR_GRP_MACRO (RC_APP_BEGIN + 71)
+#define RES_EXT_HELP_STRING (RC_APP_BEGIN + 72)
+#define RES_STD_HELP_STRING (RC_APP_BEGIN + 73)
+#define STR_PAGEOFFSET (RC_APP_BEGIN + 74)
+#define STR_PAGEBREAK (RC_APP_BEGIN + 75)
+#define STR_REDLINE_UNKNOWN_AUTHOR (RC_APP_BEGIN + 76)
+#define STR_WESTERN_FONT (RC_APP_BEGIN + 77)
+#define STR_CJK_FONT (RC_APP_BEGIN + 78)
+#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80)
+#define MSG_DATA_SOURCES_UNAVAILABLE (RC_APP_BEGIN + 82)
+#define DLG_MERGE_SOURCE_UNAVAILABLE (RC_APP_BEGIN + 83)
+
+#define ST_MERGE_SOURCE_UNAVAILABLE 1
+#define PB_MERGE_OK 2
+#define PB_MERGE_CANCEL 3
+#define IMG_MERGE 4
+
+#define SID_TOGGLETOOLBOX (RC_APP_BEGIN + 89)
+
+#define STR_ENV_TITLE (RC_APP_BEGIN + 91)
+#define STR_LAB_TITLE (RC_APP_BEGIN + 92)
+
+#define STR_HUMAN_SWDOC_NAME (RC_APP_BEGIN + 93)
+
+#define RID_SW_ERRHDL (RC_APP_BEGIN + 95)
+
+#define STR_FDLG_TEMPLATE_BUTTON (RC_APP_BEGIN + 1)
+#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2)
+
+
+// Ids for all the PopUpMenues
+#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17)
+#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18)
+#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19)
+#define MN_FORMAT_FRM_HORZ (RC_APP_BEGIN + 23)
+#define MN_CELL (RC_APP_BEGIN + 29)
+#define MN_WRAP (RC_APP_BEGIN + 38)
+#define MN_SUB_TBLROW (RC_APP_BEGIN + 39)
+#define MN_SUB_TBLCOL (RC_APP_BEGIN + 40)
+#define MN_SUB_ARRANGE (RC_APP_BEGIN + 46)
+
+#define MN_SUB_ALIGN (RC_APP_BEGIN + 50)
#define STR_WRITER_DOCUMENT_FULLTYPE (RC_APP_BEGIN + 100)
#define STR_ABSTRACT_TITLE (RC_APP_BEGIN + 102)
#define STR_DONT_ASK_AGAIN (RC_APP_BEGIN + 103)
// --> OD 2008-04-14 #outlinelevel#
#define STR_OUTLINE_NUMBERING (RC_APP_BEGIN + 104)
-// <--
//#outline level,zhaojianwei
-#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105)
-#define STR_FDLG_STYLE (RC_APP_BEGIN + 106)
+#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105)
+#define STR_FDLG_STYLE (RC_APP_BEGIN + 106)
//<-end,zhaojianwei
#define APP_ACT_END STR_FDLG_STYLE
diff --git a/sw/source/ui/inc/ascfldlg.hxx b/sw/source/ui/inc/ascfldlg.hxx
index 9fc1b98d044a..763eaba3e55c 100644
--- a/sw/source/ui/inc/ascfldlg.hxx
+++ b/sw/source/ui/inc/ascfldlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _ASCFLDLG_HXX
#include <vcl/fixed.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <sfx2/basedlgs.hxx>
#include <svx/txencbox.hxx>
@@ -76,3 +75,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/autoedit.hxx b/sw/source/ui/inc/autoedit.hxx
index 535bc04bf9ca..a7a0be298634 100644
--- a/sw/source/ui/inc/autoedit.hxx
+++ b/sw/source/ui/inc/autoedit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef _AUTOEDIT_HXX
#define _AUTOEDIT_HXX
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
class AutoEdit : public Edit
@@ -41,10 +40,11 @@ protected:
virtual void KeyInput( const KeyEvent& rEvent );
};
-// Implementieriung im autocorr.cxx
+// Implementation in autocorr.cxx
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/barcfg.hxx b/sw/source/ui/inc/barcfg.hxx
index 6b88039eddbe..cb5f06a76b47 100644
--- a/sw/source/ui/inc/barcfg.hxx
+++ b/sw/source/ui/inc/barcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,3 +46,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx
index 03e183b81116..5b85afcd7649 100644
--- a/sw/source/ui/inc/basesh.hxx
+++ b/sw/source/ui/inc/basesh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <shellid.hxx>
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
#include <tools/link.hxx>
#include <vcl/timer.hxx>
@@ -39,6 +39,7 @@
#include <svl/svstdarr.hxx>
#include <mdiexp.hxx>
+#include <set>
class SwWrtShell;
class SwCrsrShell;
@@ -51,15 +52,15 @@ class SwBaseShell: public SfxShell
{
SwView &rView;
- // DragModus
+ // DragMode
static FlyMode eFrameMode;
// Bug 75078 - if in GetState the asynch call of GetGraphic returns
// synch, the set the state directly into the itemset
SfxItemSet* pGetStateSet;
- //Update-Timer fuer Graphic
- SvUShortsSort aGrfUpdateSlots;
+ // Update-Timer for graphic
+ std::set<sal_uInt16> aGrfUpdateSlots;
DECL_LINK( GraphicArrivedHdl, SwCrsrShell* );
@@ -69,7 +70,7 @@ protected:
inline SwView& GetView() { return rView; }
inline void SetGetStateSet( SfxItemSet* p ) { pGetStateSet = p; }
- inline sal_Bool AddGrfUpdateSlot( sal_uInt16 nSlot ){ return aGrfUpdateSlots.Insert( nSlot ); }
+ inline sal_Bool AddGrfUpdateSlot( sal_uInt16 nSlot ){ return aGrfUpdateSlots.insert( nSlot ).second; }
DECL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl* );
@@ -117,7 +118,7 @@ public:
void ExecField(SfxRequest& rReq);
- static void SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); //Mit Update!
+ static void SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); // with update!
static void _SetFrmMode( FlyMode eMode ) { eFrameMode = eMode; }
static FlyMode GetFrmMode() { return eFrameMode; }
@@ -125,3 +126,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/beziersh.hxx b/sw/source/ui/inc/beziersh.hxx
index c9c88adb441e..1fa2750c0433 100644
--- a/sw/source/ui/inc/beziersh.hxx
+++ b/sw/source/ui/inc/beziersh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/bmpwin.hxx b/sw/source/ui/inc/bmpwin.hxx
index aa7c6287de8d..15b9e6b534eb 100644
--- a/sw/source/ui/inc/bmpwin.hxx
+++ b/sw/source/ui/inc/bmpwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,24 +29,18 @@
#ifndef _BMPWIN_HXX
#define _BMPWIN_HXX
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
-#ifndef _BITMAPEX_HXX
#include <vcl/bitmapex.hxx>
-#endif
#include <vcl/window.hxx>
/*--------------------------------------------------------------------
- Beschreibung: Extended Page fuer Grafiken
+ Description: extended page for graphics
--------------------------------------------------------------------*/
-
class BmpWindow : public Window
{
private:
Graphic aGraphic;
BitmapEx aBmp;
- BitmapEx aBmpHC;
sal_Bool bHorz : 1;
sal_Bool bVert : 1;
@@ -56,7 +51,7 @@ private:
public:
BmpWindow(Window* pPar, sal_uInt16 nId,
- const Graphic& rGraphic, const BitmapEx& rBmp, const BitmapEx& rBmpHC);
+ const Graphic& rGraphic, const BitmapEx& rBmp);
BmpWindow(Window* pParent, const ResId rResId) :
Window(pParent, rResId),
bHorz(sal_False), bVert(sal_False),bGraphic(sal_False), bLeftAlign(sal_True) {}
@@ -67,3 +62,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/bookctrl.hxx b/sw/source/ui/inc/bookctrl.hxx
index 8955276579fb..0f9e96f50d73 100644
--- a/sw/source/ui/inc/bookctrl.hxx
+++ b/sw/source/ui/inc/bookctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx
index 3b53b3f1bd77..effdba914367 100644
--- a/sw/source/ui/inc/bookmark.hxx
+++ b/sw/source/ui/inc/bookmark.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,19 +31,13 @@
#include <svx/stddlg.hxx>
#include <vcl/fixed.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include "swlbox.hxx" // SwComboBox
class SwWrtShell;
class SfxRequest;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class BookmarkCombo : public SwComboBox
{
sal_uInt16 GetFirstSelEntryPos() const;
@@ -59,10 +54,6 @@ public:
static const String aForbiddenChars;
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwInsertBookmarkDlg: public SvxStandardDialog
{
FixedLine aBookmarkFl;
@@ -86,3 +77,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/break.hxx b/sw/source/ui/inc/break.hxx
index 8c6c53744ad4..9ff55fde5d2b 100644
--- a/sw/source/ui/inc/break.hxx
+++ b/sw/source/ui/inc/break.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,21 +30,13 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
class SwWrtShell;
@@ -90,3 +83,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/caption.hxx b/sw/source/ui/inc/caption.hxx
index 17cb80f3b518..70f39be1b7e0 100644
--- a/sw/source/ui/inc/caption.hxx
+++ b/sw/source/ui/inc/caption.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,10 @@
#define _CAPTION_HXX
#include <tools/string.hxx>
-//#ifndef _STREAM_HXX //autogen
-//#include <tools/stream.hxx>
-//#endif
#include <tools/globname.hxx>
#include <SwCapObjType.hxx>
#include "swdllapi.h"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SW_DLLPUBLIC InsCaptionOpt
{
private:
@@ -55,7 +49,7 @@ private:
String sSeparator;
String sCharacterStyle;
- sal_Bool bIgnoreSeqOpts; // wird nicht gespeichert
+ sal_Bool bIgnoreSeqOpts; // is not being saved
sal_Bool bCopyAttributes; // -""-
public:
@@ -116,3 +110,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/cfgdesc.hxx b/sw/source/ui/inc/cfgdesc.hxx
index 6a45826c9019..8ecc19a00b5c 100644
--- a/sw/source/ui/inc/cfgdesc.hxx
+++ b/sw/source/ui/inc/cfgdesc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,5 +66,6 @@ inline String SwCfgDesc::GetFuncText() const { return aFuncText; }
inline String SwCfgDesc::GetMacro() const { return aFuncText; }
inline String SwCfgDesc::GetLib() const { return aLibName; }
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/cfgid.h b/sw/source/ui/inc/cfgid.h
index 71f061e7b094..d4602a2e89e5 100644
--- a/sw/source/ui/inc/cfgid.h
+++ b/sw/source/ui/inc/cfgid.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,3 +39,5 @@
#define CFG_SWGLOBAL_MENU (SFX_ITEMTYPE_SW_BEGIN +29)
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx
index 2b98f70cbdca..3181aeb64bac 100644
--- a/sw/source/ui/inc/cfgitems.hxx
+++ b/sw/source/ui/inc/cfgitems.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@
class SwWriterApp;
class SwModule;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
class SwTestTabPage;
#endif
class SwAddPrinterTabPage;
@@ -50,9 +51,8 @@ class SwDocEditDialog;
SfxPrinter* GetPrt( ViewShell* );
void SetPrt( SfxPrinter* );
-
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Dokumentanzeige
+Item for settings dialog - document view
--------------------------------------------------------- */
class SW_DLLPUBLIC SwDocDisplayItem : public SfxPoolItem
{
@@ -87,8 +87,9 @@ public:
void operator=( const SwDocDisplayItem& );
void FillViewOptions( SwViewOption& rVOpt) const;
};
+
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog, Elementeseite
+Item for settings dialog, element page
--------------------------------------------------------- */
class SW_DLLPUBLIC SwElemItem : public SfxPoolItem
{
@@ -127,10 +128,10 @@ public:
void FillViewOptions( SwViewOption& rVOpt) const;
};
+
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Drucker/Zusaetze
+Item for settings dialog - printer/add ons
--------------------------------------------------------- */
-
class SW_DLLPUBLIC SwAddPrinterItem : public SfxPoolItem, public SwPrintData
{
friend class SwAddPrinterTabPage;
@@ -175,11 +176,9 @@ public:
};
-
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog, ShadowCursorSeite
+Item for settings dialog, ShadowCursorPage
--------------------------------------------------------- */
-
class SW_DLLPUBLIC SwShadowCursorItem : public SfxPoolItem
{
sal_uInt8 eMode;
@@ -204,9 +203,10 @@ public:
void SetOn( sal_Bool bFlag ) { bOn = bFlag; }
};
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
+
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Testeinstellungen
+Item for settings dialog - test settings
--------------------------------------------------------- */
class SW_DLLPUBLIC SwTestItem : public SfxPoolItem
{
@@ -239,4 +239,4 @@ public:
#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx
index 210f81907cc5..d5201d780bdd 100644
--- a/sw/source/ui/inc/changedb.hxx
+++ b/sw/source/ui/inc/changedb.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,20 +29,13 @@
#define _CHANGEDB_HXX
-#ifndef _BITMAP_HXX //autogen
#include <vcl/bitmap.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <svtools/svtreebx.hxx>
#include <svx/stddlg.hxx>
#include "dbtree.hxx"
-#include <vcl/fixed.hxx>
class SwFldMgr;
class SwView;
@@ -49,9 +43,8 @@ class SwWrtShell;
struct SwDBData;
/*--------------------------------------------------------------------
- Beschreibung: Datenbank an Feldern austauschen
+ Description: exchange database at fields
--------------------------------------------------------------------*/
-
class SwChangeDBDlg: public SvxStandardDialog
{
FixedLine aDBListFL;
@@ -66,10 +59,8 @@ class SwChangeDBDlg: public SvxStandardDialog
OKButton aOKBT;
CancelButton aCancelBT;
HelpButton aHelpBT;
-// PushButton aChangeBT;
ImageList aImageList;
- ImageList aImageListHC;
SwWrtShell *pSh;
SwFldMgr *pMgr;
@@ -90,3 +81,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/chartins.hxx b/sw/source/ui/inc/chartins.hxx
index 15050f946227..4b6de648be57 100644
--- a/sw/source/ui/inc/chartins.hxx
+++ b/sw/source/ui/inc/chartins.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,3 +34,4 @@ void SwInsertChart( Window *pParent, SfxBindings *pBindings );
#endif /*_CHARTINS_HXX*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/chldwrap.hxx b/sw/source/ui/inc/chldwrap.hxx
index 6a6bfe0f9a97..70b4e4385ab6 100644
--- a/sw/source/ui/inc/chldwrap.hxx
+++ b/sw/source/ui/inc/chldwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/chrdlg.hxx b/sw/source/ui/inc/chrdlg.hxx
index 300874ffaeb6..b16579833101 100644
--- a/sw/source/ui/inc/chrdlg.hxx
+++ b/sw/source/ui/inc/chrdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,37 +29,21 @@
#define _SWCHARDLG_HXX
#include <sfx2/tabdlg.hxx>
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
class SwView;
class SvxMacroItem;
-/*--------------------------------------------------------------------
- Beschreibung: Der Tabdialog Traeger der TabPages
- --------------------------------------------------------------------*/
-
class SwCharDlg: public SfxTabDialog
{
SwView& rView;
@@ -73,10 +58,6 @@ public:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
};
-/*-----------------14.08.96 11.03-------------------
- Beschreibung: Tabpage fuer URL-Attribut
---------------------------------------------------*/
-
class SwCharURLPage : public SfxTabPage
{
FixedLine aURLFL;
@@ -117,3 +98,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/cnttab.hxx b/sw/source/ui/inc/cnttab.hxx
index d263be129b56..9c1a3fca65cb 100644
--- a/sw/source/ui/inc/cnttab.hxx
+++ b/sw/source/ui/inc/cnttab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,32 +30,24 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <sfx2/tabdlg.hxx>
#include "tox.hxx"
-#include <tools/list.hxx>
#include <toxmgr.hxx>
#include <svx/checklbx.hxx>
#include <tools/resary.hxx>
#include <svtools/svtreebx.hxx>
#include <vcl/menubtn.hxx>
#include <svx/langbox.hxx>
+
#define TOX_PAGE_SELECT 1
#define TOX_PAGE_ENTRY 2
#define TOX_PAGE_STYLES 3
@@ -88,3 +81,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/colex.hxx b/sw/source/ui/inc/colex.hxx
index 22cd2b6ff507..f8d194a5fe7e 100644
--- a/sw/source/ui/inc/colex.hxx
+++ b/sw/source/ui/inc/colex.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,6 @@
class SwColMgr;
class SfxItemSet;
-/* -----------------------------08.02.2002 11:32------------------------------
-
- ---------------------------------------------------------------------------*/
class SW_DLLPUBLIC SwPageExample : public SvxPageWindow
{
public:
@@ -48,10 +46,9 @@ public:
void UpdateExample( const SfxItemSet& rSet );
};
-/* -----------------------------08.02.2002 11:34------------------------------
- ---------------------------------------------------------------------------*/
class SwTextGridItem;
+
class SW_DLLPUBLIC SwPageGridExample : public SwPageExample
{
SwTextGridItem* pGridItem;
@@ -68,9 +65,6 @@ public:
~SwPageGridExample();
void UpdateExample( const SfxItemSet& rSet );
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SW_DLLPUBLIC SwColExample : public SwPageExample
{
@@ -94,9 +88,6 @@ public:
}
};
-/*-----------------25.10.96 08.23-------------------
-
---------------------------------------------------*/
class SW_DLLPUBLIC SwColumnOnlyExample : public Window
{
private:
@@ -116,3 +107,5 @@ public:
};
#endif // _COLEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/colmgr.hxx b/sw/source/ui/inc/colmgr.hxx
index 0d9ebdf5123c..da8eae13d554 100644
--- a/sw/source/ui/inc/colmgr.hxx
+++ b/sw/source/ui/inc/colmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,8 +36,7 @@ SW_DLLPUBLIC void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth);
class SW_DLLPUBLIC SwColMgr
{
public:
- // lActWidth wird aus den Edits des Seitendialogs
- // direkt uebergeben
+ // lActWidth is passed directly from the page dialogs edits
SwColMgr(const SfxItemSet &rSet, sal_uInt16 nActWidth = USHRT_MAX);
~SwColMgr();
@@ -55,7 +55,8 @@ public:
inline sal_Bool HasLine() const;
inline void SetNoLine();
- inline void SetLineWidthAndColor(sal_uLong nWidth, const Color& rCol);
+ void SetLineWidthAndColor(::editeng::SvxBorderStyle eStyle, sal_uLong nWidth, const Color& rCol);
+ inline ::editeng::SvxBorderStyle GetLineStyle() const;
inline sal_uLong GetLineWidth() const;
inline const Color& GetLineColor() const;
@@ -80,29 +81,31 @@ private:
sal_uInt16 nWidth;
};
-// INLINE METHODE --------------------------------------------------------
-
+// INLINE METHOD --------------------------------------------------------
inline sal_uInt16 SwColMgr::GetCount() const
{
return aFmtCol.GetNumCols();
}
-inline void SwColMgr::SetLineWidthAndColor(sal_uLong nLWidth, const Color& rCol)
+
+inline ::editeng::SvxBorderStyle SwColMgr::GetLineStyle() const
{
- aFmtCol.SetLineWidth(nLWidth);
- aFmtCol.SetLineColor(rCol);
+ return aFmtCol.GetLineStyle();
}
inline sal_uLong SwColMgr::GetLineWidth() const
{
return aFmtCol.GetLineWidth();
}
+
inline const Color& SwColMgr::GetLineColor() const
{
return aFmtCol.GetLineColor();
}
+
inline SwColLineAdj SwColMgr::GetAdjust() const
{
return aFmtCol.GetLineAdj();
}
+
inline void SwColMgr::SetAdjust(SwColLineAdj eAdj)
{
aFmtCol.SetLineAdj(eAdj);
@@ -115,6 +118,7 @@ inline void SwColMgr::SetAutoWidth(sal_Bool bOn, sal_uInt16 nGutterWidth)
{
aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth);
}
+
inline void SwColMgr::NoCols()
{
aFmtCol.GetColumns().DeleteAndDestroy(0, aFmtCol.GetColumns().Count());
@@ -123,9 +127,12 @@ inline sal_Bool SwColMgr::HasLine() const
{
return GetAdjust() != COLADJ_NONE;
}
+
inline void SwColMgr::SetNoLine()
{
SetAdjust(COLADJ_NONE);
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx
index 86c10c647836..b36e0623e719 100644
--- a/sw/source/ui/inc/column.hxx
+++ b/sw/source/ui/inc/column.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,28 +30,14 @@
#define _COLUMN_HXX
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _IMAGE_HXX //autogen
#include <vcl/image.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/timer.hxx>
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <svtools/ctrlbox.hxx>
#include <svtools/valueset.hxx>
#include <sfx2/basedlgs.hxx>
@@ -63,9 +50,6 @@ const int nMaxCols = 99;
class SwColMgr;
class SwWrtShell;
class SwColumnPage;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SwColumnDlg : public SfxModalDialog
{
@@ -103,9 +87,6 @@ public:
SwWrtShell& GetWrtShell() { return rWrtShell; }
};
-/*-----------------07.03.97 08.26-------------------
-
---------------------------------------------------*/
class ColumnValueSet : public ValueSet
{
public:
@@ -118,7 +99,7 @@ class ColumnValueSet : public ValueSet
};
/*--------------------------------------------------------------------
- Beschreibung: Spaltendialog jetzt als TabPage
+ Description: column dialog now as TabPage
--------------------------------------------------------------------*/
class SwColumnPage : public SfxTabPage
{
@@ -149,13 +130,15 @@ class SwColumnPage : public SfxTabPage
FixedLine aFLLineType;
FixedText aLineTypeLbl;
LineListBox aLineTypeDLB;
+ FixedText aLineWidthLbl;
+ MetricField aLineWidthEdit;
+ FixedText aLineColorLbl;
+ ColorListBox aLineColorDLB;
FixedText aLineHeightLbl;
MetricField aLineHeightEdit;
FixedText aLinePosLbl;
ListBox aLinePosDLB;
- FixedLine aVertFL;
- FixedLine aPropertiesFL;
FixedText aTextDirectionFT;
ListBox aTextDirectionLB;
@@ -225,3 +208,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/conarc.hxx b/sw/source/ui/inc/conarc.hxx
index 739a27e309cc..c2d20960e810 100644
--- a/sw/source/ui/inc/conarc.hxx
+++ b/sw/source/ui/inc/conarc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -47,7 +48,7 @@ public:
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Funktion aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
virtual void Deactivate();
};
@@ -55,3 +56,4 @@ public:
#endif // _CONARC_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/concustomshape.hxx b/sw/source/ui/inc/concustomshape.hxx
index 20b9cf798f77..092b5708e2c5 100644
--- a/sw/source/ui/inc/concustomshape.hxx
+++ b/sw/source/ui/inc/concustomshape.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@ class SfxRequest;
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -55,7 +56,7 @@ class ConstCustomShape : public SwDrawBase
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
rtl::OUString GetShapeType() const;
static rtl::OUString GetShapeTypeFromRequest( SfxRequest& rReq );
@@ -70,3 +71,4 @@ class ConstCustomShape : public SwDrawBase
#endif // _SW_CONRECT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/condedit.hxx b/sw/source/ui/inc/condedit.hxx
index 1cbd29d52a78..8287d54665c9 100644
--- a/sw/source/ui/inc/condedit.hxx
+++ b/sw/source/ui/inc/condedit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,16 +28,10 @@
#ifndef _CONDEDTI_HXX
#define _CONDEDTI_HXX
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <svtools/transfer.hxx>
#include "swdllapi.h"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SW_DLLPUBLIC ConditionEdit : public Edit, public DropTargetHelper
{
sal_Bool bBrackets, bEnableDrop;
@@ -55,18 +50,4 @@ public:
#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/conform.hxx b/sw/source/ui/inc/conform.hxx
index db62dc3deada..c38ade37abf3 100644
--- a/sw/source/ui/inc/conform.hxx
+++ b/sw/source/ui/inc/conform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,7 @@ public:
// Mouse- & Key-Events
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
virtual void CreateDefaultObject();
};
@@ -45,3 +46,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/conpoly.hxx b/sw/source/ui/inc/conpoly.hxx
index 3733c7a71b61..bf90080bbd21 100644
--- a/sw/source/ui/inc/conpoly.hxx
+++ b/sw/source/ui/inc/conpoly.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/*************************************************************************
|*
-|* Basisklasse fuer alle Funktionen
+|* base class for all functions
|*
\************************************************************************/
@@ -47,9 +48,10 @@ public:
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
#endif // _CONPOLY_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/conrect.hxx b/sw/source/ui/inc/conrect.hxx
index 0280cf173a00..a04087e58951 100644
--- a/sw/source/ui/inc/conrect.hxx
+++ b/sw/source/ui/inc/conrect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -51,10 +52,11 @@ class ConstRectangle : public SwDrawBase
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
#endif // _SW_CONRECT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/content.hxx b/sw/source/ui/inc/content.hxx
index c7bc20ebb65b..0a994c0f0a9d 100644
--- a/sw/source/ui/inc/content.hxx
+++ b/sw/source/ui/inc/content.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <limits.h> // USHRT_MAX
#include "swcont.hxx"
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
class SwWrtShell;
class SwContentArr;
@@ -42,7 +41,7 @@ class SwTOXBase;
class SwRedline;
//----------------------------------------------------------------------------
-// Hilfsklassen
+// helper classes
//----------------------------------------------------------------------------
class SwPopup : public PopupMenu
@@ -170,29 +169,28 @@ public:
const SwTOXBase* GetTOXBase() const {return pBase;}
};
/*
- class ContentType enthaelt Informationen zu einer Inhaltsform
- Das MemberArray wird nur gefuellt, wenn der Inhalt mit GetMember
- angefordert wird. Es wird nach Invalidate() nur dann neu geladen,
- wenn der Inhalt erneut ausgelesen werden soll.
+ class ContentType contains information to one type of content.
+ MemberArray is only populated if the content is requested by
+ GetMember. It is reloaded after Invalidate() only if the content
+ should be read again.
*/
//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
class SwContentType : public SwTypeNumber
{
SwWrtShell* pWrtShell;
- SwContentArr* pMember; // Array fuer Inhalte
- String sContentTypeName; // Name der Inhaltsform
- String sSingleContentTypeName; // Name der Inhaltsform, Singular
- String sTypeToken; // Anhaengsel fuer URL
- sal_uInt16 nMemberCount; // Inhaltsanzahl
- sal_uInt16 nContentType; // Id der Inhaltsform
+ SwContentArr* pMember; // array for content
+ String sContentTypeName; // name of content type
+ String sSingleContentTypeName; // name of content type, singular
+ String sTypeToken; // attachment for URL
+ sal_uInt16 nMemberCount; // content count
+ sal_uInt16 nContentType; // content type's Id
sal_uInt8 nOutlineLevel;
- sal_Bool bMemberFilled : 1; // wurden die Inhalte bereits eingefuegt?
- sal_Bool bIsInternalDrag:1; // koennen die Inhalte verschoben werden?
+ sal_Bool bMemberFilled : 1; // has content already been inserted?
+ sal_Bool bIsInternalDrag:1; // can content be relocated?
sal_Bool bDataValid : 1; //
- sal_Bool bEdit: 1; // kann diese Type bearbeitet werden ?
- sal_Bool bDelete: 1; // kann diese Type geloescht werden ?
+ sal_Bool bEdit: 1; // can this type be edited?
+ sal_Bool bDelete: 1; // can this type be deleted?
protected:
void RemoveNewline(String&);
public:
@@ -215,7 +213,7 @@ public:
Invalidate();
}
- void Invalidate(); // nur nMemberCount wird neu gelesen
+ void Invalidate(); // only nMemberCount is read again
sal_Bool IsEditable() const {return bEdit;}
sal_Bool IsDeletable() const {return bDelete;}
@@ -223,3 +221,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx
index 10e222b3787b..3659f847ab01 100644
--- a/sw/source/ui/inc/conttree.hxx
+++ b/sw/source/ui/inc/conttree.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include <svtools/svtreebx.hxx>
#include "swcont.hxx"
+#include <map>
+
class SwWrtShell;
class SwContentType;
class SwNavigationPI;
@@ -70,10 +73,12 @@ class SwContentTree : public SvTreeListBox
String sPostItHide;
String sPostItDelete;
- SwWrtShell* pHiddenShell; // gedropptes Doc
- SwWrtShell* pActiveShell; // die aktive oder eine konst. offene View
+ SwWrtShell* pHiddenShell; // dropped Doc
+ SwWrtShell* pActiveShell; // the active or a const. open view
SwNavigationConfig* pConfig;
+ std::map< void*, sal_Bool > mOutLineNodeMap;
+
sal_Int32 nActiveBlock;
sal_uInt16 nHiddenBlock;
sal_uInt16 nRootType;
@@ -103,7 +108,6 @@ class SwContentTree : public SvTreeListBox
using SvListView::Select;
protected:
-// virtual void Command( const CommandEvent& rCEvt );
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind);
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -191,7 +195,6 @@ public:
SwWrtShell* GetHiddenWrtShell() {return pHiddenShell;}
DECL_LINK( ContentDoubleClickHdl, SwContentTree * );
-// DECL_LINK( PopupHdl, Menu* );
DECL_LINK( TimerUpdate, Timer * );
virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
@@ -204,7 +207,7 @@ public:
//----------------------------------------------------------------------------
-// TreeListBox fuer Globaldokumente
+// TreeListBox for global documents
//----------------------------------------------------------------------------
class SwLBoxString : public SvLBoxString
@@ -232,9 +235,9 @@ private:
ImageList aEntryImages;
SwWrtShell* pActiveShell; //
- SvLBoxEntry* pEmphasisEntry; // Drag'n Drop-Emphasis
- SvLBoxEntry* pDDSource; // Quelle beim DnD
- SwGlblDocContents* pSwGlblDocContents; // Array mit sortierten Inhalten
+ SvLBoxEntry* pEmphasisEntry; // Drag'n Drop emphasis
+ SvLBoxEntry* pDDSource; // source for Drag'n Drop
+ SwGlblDocContents* pSwGlblDocContents; // array with sorted content
Window* pDefParentWin;
SwGlblDocContent* pDocContent;
@@ -332,3 +335,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/convert.hxx b/sw/source/ui/inc/convert.hxx
index fc1879bc4f2d..3fc218459f68 100644
--- a/sw/source/ui/inc/convert.hxx
+++ b/sw/source/ui/inc/convert.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _SW_CONVERT_HXX
#include <vcl/fixed.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/edit.hxx>
#include <sfx2/basedlgs.hxx>
#include <textcontrolcombo.hxx>
@@ -89,3 +88,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/cption.hxx b/sw/source/ui/inc/cption.hxx
index edb8590d5c8f..dcbda5163ead 100644
--- a/sw/source/ui/inc/cption.hxx
+++ b/sw/source/ui/inc/cption.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,25 +30,15 @@
#include <svx/stddlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <actctrl.hxx>
@@ -104,8 +95,8 @@ class SwCaptionDialog : public SvxStandardDialog
SwCaptionPreview aPrevWin;
- SwView &rView; //Suchen per aktive ::com::sun::star::sdbcx::View vermeiden.
- SwFldMgr *pMgr; //Ptr um das include zu sparen
+ SwView &rView; // search per active, avoid ::com::sun::star::sdbcx::View
+ SwFldMgr *pMgr; // pointer to save the include
SelectionType eType;
String sCharacterStyle;
@@ -127,6 +118,7 @@ class SwCaptionDialog : public SvxStandardDialog
void CheckButtonWidth();
void ApplyCaptionOrder(); //#i61007# order of captions
+ static String our_aSepTextSave; // Save caption separator text
public:
SwCaptionDialog( Window *pParent, SwView &rV );
~SwCaptionDialog();
@@ -135,3 +127,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dbconfig.hxx b/sw/source/ui/inc/dbconfig.hxx
index 2e82249b84b9..f8da4b00c8d9 100644
--- a/sw/source/ui/inc/dbconfig.hxx
+++ b/sw/source/ui/inc/dbconfig.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx
index 4cc46b7ff964..9b7485cf9a62 100644
--- a/sw/source/ui/inc/dbinsdlg.hxx
+++ b/sw/source/ui/inc/dbinsdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,18 +30,10 @@
#define _DBINSDLG_HXX
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <svtools/svmedit.hxx>
#include <sfx2/basedlgs.hxx>
@@ -167,7 +160,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem
virtual void Commit();
void Load();
- // setze die Tabellen - Eigenschaften
+ // set the tables - properties
void SetTabSet();
public:
@@ -186,3 +179,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx
index 44236edf7b00..090654b3f55c 100644
--- a/sw/source/ui/inc/dbtree.hxx
+++ b/sw/source/ui/inc/dbtree.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,6 @@ class SwWrtShell;
class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
{
ImageList aImageList;
- ImageList aImageListHC;
Image aDBBMP;
Image aTableBMP;
Image aQueryBMP;
@@ -84,3 +84,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dbui.hxx b/sw/source/ui/inc/dbui.hxx
index 2c8e9cdf02c7..95a5864ef9d1 100644
--- a/sw/source/ui/inc/dbui.hxx
+++ b/sw/source/ui/inc/dbui.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
@@ -84,3 +83,4 @@ private: //member
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dialmgr.hxx b/sw/source/ui/inc/dialmgr.hxx
index ebd9731c5e0a..7be3129b8a5b 100644
--- a/sw/source/ui/inc/dialmgr.hxx
+++ b/sw/source/ui/inc/dialmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
// forward ---------------------------------------------------------------
class ResMgr;
+
struct SwDialogsResMgr
{
static ResMgr* GetResMgr();
@@ -46,3 +48,4 @@ struct SwDialogsResMgr
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/docfnote.hxx b/sw/source/ui/inc/docfnote.hxx
index 7804773be5ff..172ca409317a 100644
--- a/sw/source/ui/inc/docfnote.hxx
+++ b/sw/source/ui/inc/docfnote.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx
index b45700534d48..a2a3433fe66e 100644
--- a/sw/source/ui/inc/docstdlg.hxx
+++ b/sw/source/ui/inc/docstdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,17 +30,14 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include "docstat.hxx"
/*--------------------------------------------------------------------
- Beschreibung: DocInfo jetzt als Page
+ Description: DocInfo now as page
--------------------------------------------------------------------*/
-
class SwDocStatPage: public SfxTabPage
{
public:
@@ -69,6 +67,8 @@ private:
FixedInfo aWordNo;
FixedText aCharLbl;
FixedInfo aCharNo;
+ FixedText aCharExclSpacesLbl;
+ FixedInfo aCharExclSpacesNo;
FixedText aLineLbl;
FixedInfo aLineNo;
@@ -82,3 +82,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drawbase.hxx b/sw/source/ui/inc/drawbase.hxx
index 2a63c6db360c..36747e9eb3b4 100644
--- a/sw/source/ui/inc/drawbase.hxx
+++ b/sw/source/ui/inc/drawbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ class MouseEvent;
/*************************************************************************
|*
-|* Basisklasse fuer alle Funktionen
+|* base class for all functions
|*
\************************************************************************/
@@ -49,8 +50,8 @@ protected:
SwView* m_pView;
SwWrtShell* m_pSh;
SwEditWin* m_pWin;
- Point m_aStartPos; // Position von BeginCreate
- Point m_aMDPos; // Position von MouseButtonDown
+ Point m_aStartPos; // position of BeginCreate
+ Point m_aMDPos; // position of MouseButtonDown
sal_uInt16 m_nSlotId;
sal_Bool m_bCreateObj :1;
sal_Bool m_bInsForm :1;
@@ -65,7 +66,7 @@ public:
inline sal_Bool IsInsertForm() const { return m_bInsForm; }
inline sal_Bool IsCreateObj() const { return m_bCreateObj; }
- // Mouse- & Key-Events; Returnwert=sal_True: Event wurde bearbeitet
+ // mouse- & key events; return value=sal_True: event was edited
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
@@ -75,8 +76,8 @@ public:
void SetSlotId(sal_uInt16 nSlot) {m_nSlotId = nSlot;}
sal_uInt16 GetSlotId() { return m_nSlotId;}
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
- virtual void Deactivate(); // Function deaktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate fuction
+ virtual void Deactivate(); // deactivate function
virtual void CreateDefaultObject();
@@ -88,3 +89,4 @@ public:
#endif // _SW_DRAWBASE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drawsh.hxx b/sw/source/ui/inc/drawsh.hxx
index deb0849d66a0..4325661414f9 100644
--- a/sw/source/ui/inc/drawsh.hxx
+++ b/sw/source/ui/inc/drawsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drformsh.hxx b/sw/source/ui/inc/drformsh.hxx
index 8648742b1f99..061b2f4aad23 100644
--- a/sw/source/ui/inc/drformsh.hxx
+++ b/sw/source/ui/inc/drformsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,3 +46,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drpcps.hxx b/sw/source/ui/inc/drpcps.hxx
index 6e7d6547053c..f9a8f7316c93 100644
--- a/sw/source/ui/inc/drpcps.hxx
+++ b/sw/source/ui/inc/drpcps.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,25 +31,15 @@
#include <sfx2/basedlgs.hxx>
#include <sfx2/tabdlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
class SwWrtShell;
@@ -123,3 +114,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drwbassh.hxx b/sw/source/ui/inc/drwbassh.hxx
index 00b18f2fb143..0b5628b99cad 100644
--- a/sw/source/ui/inc/drwbassh.hxx
+++ b/sw/source/ui/inc/drwbassh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/drwtxtsh.hxx b/sw/source/ui/inc/drwtxtsh.hxx
index add257a36ac2..46efceaf2bef 100644
--- a/sw/source/ui/inc/drwtxtsh.hxx
+++ b/sw/source/ui/inc/drwtxtsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include <sfx2/shell.hxx>
#include "shellid.hxx"
+#include <unotools/caserotate.hxx>
class SdrView;
class SwView;
@@ -38,6 +40,7 @@ class SfxModule;
class SwDrawTextShell: public SfxShell
{
SwView &rView;
+ RotateTransliteration m_aRotateCase;
SdrView *pSdrView;
@@ -78,9 +81,12 @@ public:
void StateClpbrd(SfxItemSet &rSet);
void StateInsert(SfxItemSet &rSet);
void ExecTransliteration(SfxRequest &);
+ void ExecRotateTransliteration(SfxRequest &);
void Init();
void StateStatusline(SfxItemSet &rSet);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dselect.hxx b/sw/source/ui/inc/dselect.hxx
index 65b778181947..c3b3d0104bb8 100644
--- a/sw/source/ui/inc/dselect.hxx
+++ b/sw/source/ui/inc/dselect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -40,13 +41,14 @@ class DrawSelection : public SwDrawBase
public:
DrawSelection(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView);
- // Mouse- & Key-Events
+ // mouse- & key events
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
#endif // _SW_DSELECT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index 3ca6259c41a4..547d67883508 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,7 +54,7 @@ struct QuickHelpData;
class SdrDropMarkerOverlay;
/*--------------------------------------------------------------------
- Beschreibung: Eingabe-Fenster
+ Description: input window
--------------------------------------------------------------------*/
class SwEditWin: public Window,
@@ -75,18 +76,18 @@ friend void PageNumNotify( ViewShell* pVwSh,
static sal_Bool bReplaceQuote;
static long nDDStartPosX, nDDStartPosY;
- static Color aTextColor; //Textfarbe, fuer die Giesskanne
- static sal_Bool bTransparentBackColor; // Hintergrund transparent
- static Color aTextBackColor; //Texthintergrundfarbe, fuer die Giesskanne
+ static Color aTextColor; // text color; for the watering can
+ static sal_Bool bTransparentBackColor; // transparent background
+ static Color aTextBackColor; // text background; for the watering can
/*
- * Timer und Handler fuer das Weiterscrollen, wenn der
- * Mauspointer innerhalb eines Drag-Vorgangs ausserhalb des
- * EditWin stehen bleibt. In regelmaessigen Intervallen wird
- * die Selektion in Richtung der Mausposition vergroessert.
+ * timer and handler for scrolling on when the mousepointer
+ * stopps outside of EditWin during a drag-operation.
+ * The selection is increased towards the mouse position
+ * regularly.
*/
AutoTimer aTimer;
- // Timer fuer verschachtelte KeyInputs (z.B. fuer Tabellen)
+ // timer for overlapping KeyInputs (e.g. for tables)
Timer aKeyInputTimer;
// timer for ANY-KeyInut question without a following KeyInputEvent
Timer aKeyInputFlushTimer;
@@ -98,11 +99,11 @@ friend void PageNumNotify( ViewShell* pVwSh,
Point aRszMvHdlPt;
Timer aTemplateTimer;
- // Type/Objecte ueber dem der MousePointer steht
+ // type/object where the mouse pointer is
SwCallMouseEvent aSaveCallEvent;
SwApplyTemplate *pApplyTempl;
- SwAnchorMarker *pAnchorMarker; // zum Verschieben eines Ankers
+ SwAnchorMarker *pAnchorMarker; // for relocating the anchor
SdrDropMarkerOverlay *pUserMarker;
SdrObject *pUserMarkerObj;
@@ -111,29 +112,29 @@ friend void PageNumNotify( ViewShell* pVwSh,
SwView &rView;
- int aActHitType; // aktueller Mauspointer
+ int aActHitType; // current mouse pointer
- sal_uLong m_nDropFormat; //Format aus dem letzten QueryDrop
- sal_uInt16 m_nDropAction; //Action aus dem letzten QueryDrop
- sal_uInt16 m_nDropDestination; //Ziel aus dem letzten QueryDrop
+ sal_uLong m_nDropFormat; // format from the last QueryDrop
+ sal_uInt16 m_nDropAction; // action from the last QueryDrop
+ sal_uInt16 m_nDropDestination; // destination from the last QueryDrop
sal_uInt16 eBezierMode;
- sal_uInt16 nInsFrmColCount; //Spaltenzahl fuer interaktiven Rahmen
+ sal_uInt16 nInsFrmColCount; // column number for interactive frame
SdrObjKind eDrawMode;
sal_Bool bLinkRemoved : 1,
bMBPressed : 1,
bInsDraw : 1,
bInsFrm : 1,
bIsInMove : 1,
- bIsInDrag : 1, //StartExecuteDrag nich doppelt ausfuehren
- bOldIdle : 1, //Zum abschalten des Idle'ns
- bOldIdleSet : 1, //waehrend QeueryDrop
+ bIsInDrag : 1, // don't execute StartExecuteDrag twice
+ bOldIdle : 1, // to stop to idle
+ bOldIdleSet : 1, // during QeueryDrop
bTblInsDelMode : 1, //
bTblIsInsMode : 1, //
bTblIsColMode : 1, //
- bChainMode : 1, //Rahmen verbinden
- bWasShdwCrsr : 1, //ShadowCrsr war im MouseButtonDown an
- bLockInput : 1, //Lock waehrend die Rechenleiste aktiv ist
+ bChainMode : 1, // connect frames
+ bWasShdwCrsr : 1, // ShadowCrsr was on in MouseButtonDown
+ bLockInput : 1, // lock while calc panel is active
bIsRowDrag : 1, //selection of rows is used, in combination with pRowColumnSelectionStart
/** #i42732# display status of font size/name depending on either the input language or the
selection position depending on what has changed lately
@@ -157,7 +158,7 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_Bool EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos);
sal_Bool RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVerticalMode);
- //Hilfsfunktionen fuer D&D
+ // helper function for D&D
void DropCleanup();
void CleanupDropUserMarker();
sal_uInt16 GetDropDestination( const Point& rPixPnt,
@@ -166,10 +167,10 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_Bool SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos );
/*
- * Handler fuer das Weiterscrollen, wenn der Mauspointer innerhalb eines
- * Drag-Vorgangs ausserhalb des EditWin stehen bleibt. In regelmaessigen
- * Intervallen wird die Selektion in Richtung der Mausposition
- * vergroessert.
+ * handler for scrolling on when the mousepointer
+ * stopps outside of EditWin during a drag-operation.
+ * The selection is regularly increased towards the mouse
+ * position.
*/
DECL_LINK( TimerHandler, Timer * );
void StartDDTimer();
@@ -179,10 +180,10 @@ friend void PageNumNotify( ViewShell* pVwSh,
// timer for ANY-KeyInut question without a following KeyInputEvent
DECL_LINK( KeyInputFlushHandler, Timer * );
- // Timer fuer verschachtelte KeyInputs (z.B. fuer Tabellen)
+ // timer for overlapping KeyInputs (e.g. for tables)
DECL_LINK( KeyInputTimerHandler, Timer * );
- // Timer fuer das ApplyTemplates per Maus (verkapptes Drag&Drop)
+ // timer for ApplyTemplates via mouse (in disguise Drag&Drop)
DECL_LINK( TemplateTimerHdl, Timer* );
using OutputDevice::GetTextColor;
@@ -233,10 +234,10 @@ public:
sal_Bool IsFrmAction() { return (bInsFrm); }
inline sal_uInt16 GetBezierMode() { return eBezierMode; }
void SetBezierMode(sal_uInt16 eBezMode) { eBezierMode = eBezMode; }
- void EnterDrawTextMode(const Point& aDocPos); // DrawTextEditMode einschalten
+ void EnterDrawTextMode(const Point& aDocPos); // turn on DrawTextEditMode
void InsFrm(sal_uInt16 nCols);
void StopInsFrm();
- sal_uInt16 GetFrmColCount() const {return nInsFrmColCount;} //Spaltenzahl fuer interaktiven Rahmen
+ sal_uInt16 GetFrmColCount() const {return nInsFrmColCount;} // column number for interactive frame
void SetChainMode( sal_Bool bOn );
@@ -276,7 +277,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- // Tipfenster loeschen
+ // delete tip window
static void ClearTip();
static inline long GetDDStartPosX() { return nDDStartPosX; }
@@ -288,10 +289,9 @@ public:
//#i3370# remove quick help to prevent saving of autocorrection suggestions
void StopQuickHelp();
- // --> OD 2005-02-18 #i42921# - add parameter <bVerticalMode>
+ // #i42921# - add parameter <bVerticalMode>
sal_Bool RulerMarginDrag( const MouseEvent& rMEvt,
const bool bVerticalMode );
- // <--
/** #i42732# display status of font size/name depending on either the input
language or the selection position depending on what has changed lately
@@ -305,3 +305,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/envimg.hxx b/sw/source/ui/inc/envimg.hxx
index 659fe46892db..0c282b3d35c5 100644
--- a/sw/source/ui/inc/envimg.hxx
+++ b/sw/source/ui/inc/envimg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,11 +33,9 @@
#include "swdllapi.h"
// MakeSender -----------------------------------------------------------------
-
SW_DLLPUBLIC String MakeSender();
// enum -----------------------------------------------------------------------
-
enum SwEnvAlign
{
ENV_HOR_LEFT = 0,
@@ -48,24 +47,23 @@ enum SwEnvAlign
};
// class SwEnvItem ------------------------------------------------------------
-
class SW_DLLPUBLIC SwEnvItem : public SfxPoolItem
{
public:
- rtl::OUString aAddrText; // Text fuer Empfaenger
- sal_Bool bSend; // Absender?
- rtl::OUString aSendText; // Text fuer Absender
- sal_Int32 lAddrFromLeft; // Linker Abstand fuer Empfaenger (twips)
- sal_Int32 lAddrFromTop; // Oberer Abstand fuer Empfaenger (twips)
- sal_Int32 lSendFromLeft; // Linker Abstand fuer Absender (twips)
- sal_Int32 lSendFromTop; // Oberer Abstand fuer Absender (twips)
- sal_Int32 lWidth; // Breite des Umschlags (twips)
- sal_Int32 lHeight; // Hoehe des Umschlags (twips)
- SwEnvAlign eAlign; // Ausrichtung beim Einzug
- sal_Bool bPrintFromAbove; // Von oben drucken?
- sal_Int32 lShiftRight; // Verschiebung nach rechts (twips)
- sal_Int32 lShiftDown; // Verschiebung nach unten (twips)
+ rtl::OUString aAddrText; // text for reciever
+ sal_Bool bSend; // sender?
+ rtl::OUString aSendText; // text for sender
+ sal_Int32 lAddrFromLeft; // left gap for reciever (twips)
+ sal_Int32 lAddrFromTop; // upper gap for reciever (twips)
+ sal_Int32 lSendFromLeft; // left gap for sender (twips)
+ sal_Int32 lSendFromTop; // upper gap for sender (twips)
+ sal_Int32 lWidth; // envelope's width (twips)
+ sal_Int32 lHeight; // envelope's height (twips)
+ SwEnvAlign eAlign; // alignment at indent
+ sal_Bool bPrintFromAbove; // print from above?
+ sal_Int32 lShiftRight; // shift to right (twips)
+ sal_Int32 lShiftDown; // shift down (twips)
SwEnvItem();
SwEnvItem(const SwEnvItem& rItem);
@@ -77,8 +75,8 @@ public:
virtual int operator ==(const SfxPoolItem& rItem) const;
virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
};
// class SwEnvCfgItem -------------------------------------------------------
@@ -96,5 +94,7 @@ public:
virtual void Commit();
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
};
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/envlop.hxx b/sw/source/ui/inc/envlop.hxx
index 85f87c71d7c0..1deb5c788b2c 100644
--- a/sw/source/ui/inc/envlop.hxx
+++ b/sw/source/ui/inc/envlop.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,26 +28,16 @@
#ifndef _ENVLOP_HXX
#define _ENVLOP_HXX
-#ifndef _SV_MEDIT_HXX
#include <svtools/svmedit.hxx>
-#endif
#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include "envimg.hxx"
@@ -59,7 +50,6 @@ class SwWrtShell;
class Printer;
// class SwEnvPreview ---------------------------------------------------------
-
class SwEnvPreview : public Window
{
void Paint(const Rectangle&);
@@ -74,7 +64,6 @@ protected:
};
// class SwEnvDlg -----------------------------------------------------------
-
class SwEnvDlg : public SfxTabDialog
{
friend class SwEnvPage;
@@ -99,7 +88,6 @@ public:
};
// class SwEnvPage ----------------------------------------------------------
-
class SwEnvPage : public SfxTabPage
{
FixedText aAddrText;
@@ -146,4 +134,4 @@ public:
#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/extedit.hxx b/sw/source/ui/inc/extedit.hxx
new file mode 100644
index 000000000000..d013890a338d
--- /dev/null
+++ b/sw/source/ui/inc/extedit.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Surendran Mahendran <surenspost@gmail.com>]
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _EXTEDIT_HXX
+#define _EXTEDIT_HXX
+
+#include <osl/file.hxx>
+#include <osl/process.h>
+#include <vcl/graph.hxx>
+#include <svtools/grfmgr.hxx>
+#include <wrtsh.hxx>
+#include <vcl/timer.hxx>
+
+struct Data
+{
+ GraphicObject *pGraphicObject;
+ rtl::OUString fileName;
+ SwWrtShell *rSh ;
+};
+
+class ExternalProcessClass_Impl
+{
+ public:
+ DECL_LINK( CloseEvent, void *pEvent );
+ DECL_LINK( StartListeningEvent, void *pEvent );
+};
+
+void EditWithExternalTool(GraphicObject *pGraphic, SwWrtShell *rSh);
+
+#endif
diff --git a/sw/source/ui/inc/fldedt.hxx b/sw/source/ui/inc/fldedt.hxx
index 35b0b19be6c8..d41557e1636f 100644
--- a/sw/source/ui/inc/fldedt.hxx
+++ b/sw/source/ui/inc/fldedt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,6 @@
class SwView;
class SwWrtShell;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwFldEditDlg : public SfxSingleTabDialog
{
SwWrtShell* pSh;
@@ -62,5 +59,6 @@ public:
void InsertHdl();
};
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx
index 009084c633a2..a5431c6c845f 100644
--- a/sw/source/ui/inc/fldmgr.hxx
+++ b/sw/source/ui/inc/fldmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,10 +53,10 @@ class SbModule;
class SvxMacroItem;
class SvNumberFormatter;
class Window;
+
/*--------------------------------------------------------------------
- Beschreibung: Die Gruppen von Feldern
+ Description: the groups of fields
--------------------------------------------------------------------*/
-
enum SwFldGroups
{
GRP_DOC,
@@ -73,8 +74,8 @@ struct SwFldGroupRgn
};
/*--------------------------------------------------------------------
- Beschreibung: Der FeldManager handelt das Einfuegen von Felder
- ueber Command-Strings
+ Description: the field manager handles the insertation of fields
+ with command strings
--------------------------------------------------------------------*/
struct SwInsertFld_Data
{
@@ -116,7 +117,7 @@ private:
SwField* pCurFld;
SbModule* pModule;
const SvxMacroItem* pMacroItem;
- SwWrtShell* pWrtShell; // darf auch NULL sein!
+ SwWrtShell* pWrtShell; // can be ZERO too!
String aCurPar1;
String aCurPar2;
String sCurFrame;
@@ -140,10 +141,10 @@ public:
void SetWrtShell( SwWrtShell* pShell )
{ pWrtShell = pShell; }
- // Feld einfuegen ueber TypeId (TYP_ ...)
+ // insert field using TypeID (TYP_ ...)
sal_Bool InsertFld( const SwInsertFld_Data& rData );
- // Direkt das aktuelle Feld aendern
+ // change the current field directly
void UpdateCurFld(sal_uLong nFormat,
const String& rPar1,
const String& rPar2,
@@ -153,7 +154,7 @@ public:
inline const String& GetCurFldPar2() const;
inline sal_uLong GetCurFldFmt() const;
- // Ein Feld ermitteln
+ // determine a field
SwField* GetCurFld();
void InsertFldType(SwFieldType& rType);
@@ -164,54 +165,54 @@ public:
inline const String& GetMacroName() const { return (sMacroName); }
inline void SetMacroModule(SbModule* pMod) { pModule = pMod; }
- // Vorheriger Naechster gleichen Typ
+ // previous and next of the same type
sal_Bool GoNextPrev( sal_Bool bNext = sal_True, SwFieldType* pTyp = 0 );
sal_Bool GoNext( SwFieldType* pTyp = 0 ) { return GoNextPrev( sal_True, pTyp ); }
sal_Bool GoPrev( SwFieldType* pTyp = 0 ) { return GoNextPrev( sal_False, pTyp ); }
- // Erfragen von Werten aus Datenbankfeldern (BASIC )
+ // query values from database fields (BASIC )
// String GetDataBaseFieldValue(const String &rDBName, const String &rFieldName, SwWrtShell* pSh);
sal_Bool IsDBNumeric(const String& rDBName, const String& rTblQryName,
sal_Bool bIsTable, const String& rFldName);
- // RefMark mit Namen organisieren
+ // organise RefMark with names
sal_Bool CanInsertRefMark( const String& rStr );
- // Zugriff ueber ResId auf Feldtypen
+ // access to field types via ResId
sal_uInt16 GetFldTypeCount(sal_uInt16 nResId = USHRT_MAX) const;
SwFieldType* GetFldType(sal_uInt16 nResId, sal_uInt16 nId = 0) const;
SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName) const;
void RemoveFldType(sal_uInt16 nResId, const String& rName);
- // Zugriff ueber TypeId aus dem Dialog
- // Ids fuer einen Bereich von Feldern
+ // access via TypeId from the dialog
+ // Ids for a range of fields
const SwFldGroupRgn& GetGroupRange(sal_Bool bHtmlMode, sal_uInt16 nGrpId) const;
sal_uInt16 GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16 nSubType = 0) const;
- // TypeId des aktuellen Feldes
+ // the current field's TypeId
sal_uInt16 GetCurTypeId() const;
- // TypeId fuer einen konkrete Pos in der Liste
+ // TypeId for a concrete position in the list
static sal_uInt16 GetTypeId(sal_uInt16 nPos);
- // Name des Typen in der Liste der Felder
+ // name of the type in the list of fields
static const String& GetTypeStr(sal_uInt16 nPos);
- // Pos in der Liste der Felder
+ // Pos in the list of fields
static sal_uInt16 GetPos(sal_uInt16 nTypeId);
- // Untertypen zu einem Typ
+ // subtypes to a type
sal_Bool GetSubTypes(sal_uInt16 nId, SvStringsDtor& rToFill);
- // Formate zu einem Typ
+ // format to a type
sal_uInt16 GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bool bHtmlMode = sal_False) const;
String GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const;
sal_uInt16 GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const;
sal_uLong GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNumberFormatter* pFormatter, double* pVal = 0L);
- // Evaluierung der ExpressionFelder ausschalten fuer das Einfuegen
- // vieler Expressionfelder (siehe Etiketten)
+ // turn off evaluation of expression fields for insertation
+ // of many expressino fields (see labels)
//
inline void SetEvalExpFlds(sal_Bool bEval);
void EvalExpFlds(SwWrtShell* pSh = NULL);
@@ -229,6 +230,6 @@ inline const String& SwFldMgr::GetCurFldPar2() const
inline sal_uLong SwFldMgr::GetCurFldFmt() const
{ return nCurFmt; }
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/fldtdlg.hxx b/sw/source/ui/inc/fldtdlg.hxx
index 9ee45e91cbe8..013002276b9c 100644
--- a/sw/source/ui/inc/fldtdlg.hxx
+++ b/sw/source/ui/inc/fldtdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,10 +34,6 @@ class SfxTabPage;
class SwChildWinWrapper;
struct SfxChildWinInfo;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwFldDlg: public SfxTabDialog
{
SwChildWinWrapper* m_pChildWin;
@@ -66,3 +63,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/fldwrap.hxx b/sw/source/ui/inc/fldwrap.hxx
index 9d8435e60bfc..f2ed07bc3fba 100644
--- a/sw/source/ui/inc/fldwrap.hxx
+++ b/sw/source/ui/inc/fldwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,8 @@ public:
virtual sal_Bool ReInitDlg(SwDocShell *pDocSh);
void ShowPage(sal_uInt16 nPage = 0);
};
-/* -----------------04.02.2003 14:14-----------------
+
+/* --------------------------------------------------
* field dialog only showing database page to support
* mail merge
* --------------------------------------------------*/
@@ -58,6 +60,6 @@ public:
virtual sal_Bool ReInitDlg(SwDocShell *pDocSh);
};
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx
index 23f585863a07..5acd526bd16e 100644
--- a/sw/source/ui/inc/fontcfg.hxx
+++ b/sw/source/ui/inc/fontcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <unotools/configitem.hxx>
#include <tools/string.hxx>
#include <i18npool/lang.h>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include "swdllapi.h"
#define FONT_STANDARD 0
@@ -58,6 +59,7 @@
//pt-size of fonts
#define FONTSIZE_DEFAULT 240
+#define FONTSIZE_CJK_DEFAULT 210
#define FONTSIZE_OUTLINE 280
@@ -118,3 +120,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/formatclipboard.hxx b/sw/source/ui/inc/formatclipboard.hxx
index ca35d7b5f8ab..07891a0b5874 100644
--- a/sw/source/ui/inc/formatclipboard.hxx
+++ b/sw/source/ui/inc/formatclipboard.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/formedt.hxx b/sw/source/ui/inc/formedt.hxx
index 333f76f093ae..28782f96330e 100644
--- a/sw/source/ui/inc/formedt.hxx
+++ b/sw/source/ui/inc/formedt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,21 +30,13 @@
#include <svx/stddlg.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include "toxe.hxx"
@@ -51,9 +44,8 @@ class SwWrtShell;
class SwForm;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert marker for index entry
--------------------------------------------------------------------*/
-
class SwIdxFormDlg : public SvxStandardDialog
{
DECL_LINK( EntryHdl, Button * );
@@ -106,3 +98,5 @@ inline const SwForm& SwIdxFormDlg::GetTOXForm()
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmdlg.hxx b/sw/source/ui/inc/frmdlg.hxx
index 69d17759b625..0cadce11e1b9 100644
--- a/sw/source/ui/inc/frmdlg.hxx
+++ b/sw/source/ui/inc/frmdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,8 @@
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Rahmendialog
+ Description: frame dialog
--------------------------------------------------------------------*/
-
class SwFrmDlg : public SfxTabDialog
{
sal_Bool m_bFormat;
@@ -63,5 +63,6 @@ public:
inline SwWrtShell* GetWrtShell() { return m_pWrtShell; }
};
-
#endif // _FRMDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx
index 0d4d0131de43..6a462480d4b7 100644
--- a/sw/source/ui/inc/frmmgr.hxx
+++ b/sw/source/ui/inc/frmmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,20 +68,19 @@ class SW_DLLPUBLIC SwFlyFrmAttrMgr
sal_Bool bIsInVertical;
// --> OD 2009-09-01 #mongolianlayout#
sal_Bool bIsInVerticalL2R;
- // <--
- // interne Verrechnung fuer Umrandung
+ // internal calculation for borders
SW_DLLPRIVATE SwTwips CalcTopSpace();
SW_DLLPRIVATE SwTwips CalcBottomSpace();
SW_DLLPRIVATE SwTwips CalcLeftSpace();
SW_DLLPRIVATE SwTwips CalcRightSpace();
- SW_DLLPRIVATE void _UpdateFlyFrm(); //Nacharbeit nach Einfuegen oder Update
+ SW_DLLPRIVATE void _UpdateFlyFrm(); // post-treatment after insert or update
public:
SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nType );
- //CopyCtor fuer die Dialoge, zum Pruefen der Metrics
+ //CopyCtor for dialogs to check the metrics
SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell *pSh, const SfxItemSet &rSet );
inline SwWrtShell* GetShell() { return pOwnSh; }
@@ -91,14 +91,14 @@ public:
void SetHorzOrientation(sal_Int16 eOrient);
void SetVertOrientation(sal_Int16 eOrient);
- // Absolute Position
+ // absolute position
void SetAbsPos(const Point& rLPoint);
- // Relative Position vom Anker
+ // anchor's relative position
void SetPos(const Point& rLPoint);
inline Point GetPos() const;
- // Groesse
+ // size
void SetSize(const Size& rLSize);
inline const Size& GetSize() const;
@@ -106,7 +106,7 @@ public:
void SetHeightSizeType(SwFrmSize eType);
- // Abstand zum Inhalt
+ // space to content
void SetLRSpace( long nLeft = LONG_MAX,
long nRight = LONG_MAX );
void SetULSpace( long nTop = LONG_MAX,
@@ -114,25 +114,25 @@ public:
void SetCol( const SwFmtCol &rCol);
- // Attribute aendern und erfragen
+ // change and query attributes
void UpdateAttrMgr();
void UpdateFlyFrm();
- // neuen Rahmen erzeugen
+ // create new frame
sal_Bool InsertFlyFrm();
void InsertFlyFrm(RndStdIds eAnchorType,
const Point &rPos,
const Size &rSize,
sal_Bool bAbsPos = sal_False);
- // Metriken pruefen und aendern
+ // check and change metrics
void ValidateMetrics(SvxSwFrameValidation& rVal,
const SwPosition* pToCharCntntPos,
sal_Bool bOnlyPercentRefValue = sal_False);
void DelAttr(sal_uInt16 nId);
- // Set rausreichen
+ // reach out the set
inline const SfxItemSet &GetAttrSet() const { return aSet; }
inline SfxItemSet &GetAttrSet() { return aSet; }
void SetAttrSet(const SfxItemSet& rSet);
@@ -194,3 +194,5 @@ inline sal_uInt16 SwFlyFrmAttrMgr::GetHeightPercent() const
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 29983a275e59..57221dba9699 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,6 @@
#include <prcntfld.hxx>
#include <globals.hrc>
-
namespace sfx2{class FileDialogHelper;}
class SwWrtShell;
struct FrmMap;
@@ -48,12 +48,11 @@ struct FrmMap;
struct SwPosition;
/*--------------------------------------------------------------------
- Beschreibung: Rahmendialog
+ Description: frame dialog
--------------------------------------------------------------------*/
-
class SwFrmPage: public SfxTabPage
{
- // Size
+ // size
FixedLine aSizeFL;
FixedText aWidthFT;
FixedText aWidthAutoFT;
@@ -68,7 +67,7 @@ class SwFrmPage: public SfxTabPage
CheckBox aFixedRatioCB;
PushButton aRealSizeBT;
- // Anker
+ // anchor
FixedLine aTypeSepFL;
FixedLine aTypeFL;
RadioButton aAnchorAtPageRB;
@@ -77,7 +76,7 @@ class SwFrmPage: public SfxTabPage
RadioButton aAnchorAsCharRB;
RadioButton aAnchorAtFrameRB;
- // Position
+ // position
FixedLine aPositionFL;
FixedText aHorizontalFT;
ListBox aHorizontalDLB;
@@ -95,7 +94,7 @@ class SwFrmPage: public SfxTabPage
// OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
CheckBox aFollowTextFlowCB;
- // Example
+ // example
SvxSwFrameExample aExampleWN;
//'string provider'
@@ -111,7 +110,6 @@ class SwFrmPage: public SfxTabPage
sal_Bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
// --> OD 2009-08-31 #mongolianlayou#
sal_Bool bIsVerticalL2R;
- // <--
sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
sal_Bool bHtmlMode;
sal_uInt16 nHtmlMode;
@@ -126,7 +124,7 @@ class SwFrmPage: public SfxTabPage
// to character anchored objects.
const SwPosition* mpToCharCntntPos;
- // Die alten Ausrichtungen
+ // old alignment
short nOldH;
short nOldHRel;
short nOldV;
@@ -158,7 +156,7 @@ class SwFrmPage: public SfxTabPage
DECL_LINK( AutoWidthClickHdl, void* );
DECL_LINK( AutoHeightClickHdl, void* );
- // Beispiel aktualisieren
+ // update example
void UpdateExample();
DECL_LINK( ModifyHdl, Edit * );
@@ -207,7 +205,7 @@ public:
class SwGrfExtPage: public SfxTabPage
{
- // Spiegeln
+ // mirror
FixedLine aMirrorFL;
CheckBox aMirrorVertBox;
CheckBox aMirrorHorzBox;
@@ -228,7 +226,7 @@ class SwGrfExtPage: public SfxTabPage
sal_Bool bHtmlMode;
- // Handler fuer Spiegeln
+ // handler for mirroring
DECL_LINK( MirrorHdl, CheckBox * );
DECL_LINK( BrowseHdl, Button * );
@@ -248,10 +246,9 @@ public:
virtual int DeactivatePage(SfxItemSet *pSet);
};
-
class SwFrmURLPage : public SfxTabPage
{
- //Hyperlink
+ // hyperlink
FixedLine aHyperLinkFL;
FixedText aURLFT;
Edit aURLED;
@@ -261,7 +258,7 @@ class SwFrmURLPage : public SfxTabPage
FixedText aFrameFT;
ComboBox aFrameCB;
- //Image map
+ // image map
FixedLine aImageFL;
CheckBox aServerCB;
CheckBox aClientCB;
@@ -283,10 +280,6 @@ public:
virtual void Reset(const SfxItemSet &rSet);
};
-/*-----------------13.11.96 12.59-------------------
-
---------------------------------------------------*/
-
class SwFrmAddPage : public SfxTabPage
{
FixedLine aNamesFL;
@@ -340,3 +333,5 @@ public:
};
#endif // _FRMPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmsh.hxx b/sw/source/ui/inc/frmsh.hxx
index d4f4c546acf1..0e83ccbc6bf7 100644
--- a/sw/source/ui/inc/frmsh.hxx
+++ b/sw/source/ui/inc/frmsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/globals.h b/sw/source/ui/inc/globals.h
index 46a2fba86397..530fef285f9a 100644
--- a/sw/source/ui/inc/globals.h
+++ b/sw/source/ui/inc/globals.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,3 +36,5 @@ enum SwChangeState
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/glosbib.hxx b/sw/source/ui/inc/glosbib.hxx
index 0046e4f46e87..c886ad6cea92 100644
--- a/sw/source/ui/inc/glosbib.hxx
+++ b/sw/source/ui/inc/glosbib.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,19 +29,13 @@
#ifndef _GLOSBIB_HXX
#define _GLOSBIB_HXX
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <svx/stddlg.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <svtools/svtabbx.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
class SwGlossaryHdl;
@@ -54,15 +49,14 @@ class FEdit : public Edit
virtual void KeyInput( const KeyEvent& rKEvent );
};
-/* -----------------------------08.02.00 15:04--------------------------------
- ---------------------------------------------------------------------------*/
struct GlosBibUserData
{
String sPath;
String sGroupName;
String sGroupTitle;
};
+
class SwGlossaryGroupTLB : public SvTabListBox
{
public:
@@ -115,6 +109,6 @@ public:
const String& GetCreatedGroupName() const {return sCreatedGroup;}
};
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/glosdoc.hxx b/sw/source/ui/inc/glosdoc.hxx
index ff7c01ee0b88..b85e6fa74283 100644
--- a/sw/source/ui/inc/glosdoc.hxx
+++ b/sw/source/ui/inc/glosdoc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,3 +147,5 @@ public:
#endif // _GLOSDOC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/gloshdl.hxx b/sw/source/ui/inc/gloshdl.hxx
index 9bda46e4afef..7368edacf7f3 100644
--- a/sw/source/ui/inc/gloshdl.hxx
+++ b/sw/source/ui/inc/gloshdl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,8 +78,8 @@ public:
sal_Bool CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
const String& rDestGroupName, const String& rLongName, sal_Bool bMove );
sal_Bool HasShortName(const String &rShortName) const;
- //wird NewGlossary vom Basic gerufen, dann soll dir zuvor eingestellte
- //Gruppe ggf. neu erstellt werden
+ // when NewGlossary is called from Basic then the previously set group should
+ // be newly created if applicable.
sal_Bool NewGlossary(const String &rName, const String &rShortName,
sal_Bool bApiCall = sal_False, sal_Bool bNoAttr = sal_False );
sal_Bool DelGlossary(const String&);
@@ -99,7 +100,7 @@ public:
sal_Bool IsReadOnly( const String* = 0 ) const;
sal_Bool IsOld() const;
- sal_Bool FindGroupName(String & rGroup); // Gruppe ohne Pfadindex finden
+ sal_Bool FindGroupName(String & rGroup); // find group without path index
sal_Bool ImportGlossaries( const String& rName );
@@ -108,3 +109,5 @@ public:
};
#endif // _GLOSHDL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx
index 676c3f3c4afd..84d9c839cfd4 100644
--- a/sw/source/ui/inc/gloslst.hxx
+++ b/sw/source/ui/inc/gloslst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,8 +43,8 @@ struct AutoTextGroup
sal_uInt16 nCount;
String sName;
String sTitle;
- String sLongNames; // durch 0x0A getrennte Langnamen
- String sShortNames; // durch 0x0A getrennte Kurznamen
+ String sLongNames; // by 0x0A seperated long names
+ String sShortNames; // by 0x0A seperated short names
DateTime aDateModified;
};
@@ -87,3 +88,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx
index 11328575fa4c..3f499a8c0def 100644
--- a/sw/source/ui/inc/glossary.hxx
+++ b/sw/source/ui/inc/glossary.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,32 +28,16 @@
#ifndef _GLOSSARY_HXX
#define _GLOSSARY_HXX
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <svtools/svtreebx.hxx>
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _MENUBTN_HXX //autogen
#include <vcl/menubtn.hxx>
-#endif
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -195,3 +180,4 @@ inline String SwGlossaryDlg::GetCurrShortName() const
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/glshell.hxx b/sw/source/ui/inc/glshell.hxx
index 85f01396910e..2c073f8b3e07 100644
--- a/sw/source/ui/inc/glshell.hxx
+++ b/sw/source/ui/inc/glshell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,3 +113,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/grfsh.hxx b/sw/source/ui/inc/grfsh.hxx
index f8448ae9bc68..231cc170baab 100644
--- a/sw/source/ui/inc/grfsh.hxx
+++ b/sw/source/ui/inc/grfsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/hidfunc.h b/sw/source/ui/inc/hidfunc.h
deleted file mode 100644
index d5cff23e616b..000000000000
--- a/sw/source/ui/inc/hidfunc.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define HID_EXIT 1017
-#define HID_NEW_WINDOW 1701
-#define HID_ARRANGE_CASCADE_WIN 1703
-#define HID_ARRANGE_HORZ_WIN 1704
-#define HID_ARRANGE_VERT_WIN 1705
-#define HID_ARRANGE_ALL_WIN 1702
-#define HID_SHOW_HELP_INDEX 1802
-#define HID_NEW_FILE 1005
-#define HID_NEW_FILE_DEFAULT 1024
-#define HID_CLOSE_FILE 1001
-#define HID_DOC_MGR_DLG 1032
-#define HID_CONFIG_TOOLBOX 1629
-#define HID_CONFIG_MENU 1630
-#define HID_CONFIG_KEY 1631
-#define HID_TEMPLATE_PI 1657
-#define HID_ADDR_PI 1658
-#define HID_AUTO_FORMAT 1651
-#define HID_NAVIGATION_PI 1656
-#define HID_NAVIGATION_PI_GOTO_PAGE 1659
-#define HID_HELP_PI 1655
-#define HID_FORMAT_DROPCAPS 1454
-#define HID_CONFIG_VIEWOPTIONS 1635
-#define HID_CONFIG_COLORS 1636
-#define HID_TOOLBOX 1213
-#define HID_RIBBON 1210
-#define HID_RULER 1211
-#define HID_VLINEAL 1216
-#define HID_VSCROLLBAR 1217
-#define HID_HSCROLLBAR 1218
-#define HID_SAVE_FILE 1013
-#define HID_SAVE_ALL 1023
-#define HID_SAVE_FILE_AS 1012
-#define HID_OPEN_LASTVERSION 1009
-#define HID_STATUSBAR 1212
-#define HID_ABOUT_DLG 1806
-#define HID_SEND_MAIL 1022
-#define HID_OPEN_FILE 1007
-#define HID_INSERT_FILE 1309
-#define HID_DOCSTAT_DLG 1020
-#define HID_LOAD_TEMPLATE_DLG 1021
-#define HID_ESCAPE 1941
-#define HID_PLAY_MACRO_DLG 1624
-#define HID_RECORD_MACRO_DLG 1622
-#define HID_ASSIGN_LOCAL_MACRO_DLG 1632
-#define HID_COMPILE_MACRO 1633
-#define HID_CREATE_DOCUMENT 1019
-#define HID_PAGEUP 1937
-#define HID_PAGEDOWN 1938
-#define HID_SET_LEFT_PARA 1418
-#define HID_SET_RIGHT_PARA 1419
-#define HID_SET_CENTER_PARA 1420
-#define HID_SET_JUSTIFY_PARA 1421
-#define HID_SET_ADJUST 1428
-#define HID_FORMAT_RESET 1469
-#define HID_INDENT_TO_TABSTOP 1417
-#define HID_UNINDENT_TO_TABSTOP 1431
-#define HID_SET_BOLD 1405
-#define HID_SET_ITALIC 1406
-#define HID_SET_UNDERLINE 1409
-#define HID_SET_STRIKEOUT 1410
-#define HID_SET_OUTLINE 1408
-#define HID_SET_SHADOW 1407
-#define HID_SET_SUPER_SCRIPT 1411
-#define HID_SET_SUB_SCRIPT 1412
-#define HID_SET_COLOR 1413
-#define HID_SET_CASEMAP 1414
-#define HID_SET_LANGUAGE 1415
-#define HID_SET_KERNING 1416
-#define HID_SET_FONT 1401
-#define HID_SET_FONT_SIZE 1402
-#define HID_GROW_FONT_SIZE 1403
-#define HID_SHRINK_FONT_SIZE 1404
-#define HID_SET_LINE_SPACE_1 1422
-#define HID_SET_LINE_SPACE_15 1423
-#define HID_SET_LINE_SPACE_2 1424
-#define HID_SET_PROP_LINE_SPACE 1540
-#define HID_SET_ABS_LINE_SPACE 1541
-#define HID_INSERT_SYMBOL 1328
-#define HID_INSERT_OBJECT_DLG 1322
-#define HID_EDIT_OBJECT 1110
-#define HID_EDIT_LINK_DLG 1109
-#define HID_EDIT_FILE_INFO_DLG 1107
-#define HID_EDIT_IDX_ENTRY_DLG 1123
-#define HID_NUM_BULLET_DOWN 1130
-#define HID_NUM_BULLET_MOVEUP 1134
-#define HID_NUM_BULLET_MOVEDOWN 1135
-#define HID_NUM_BULLET_UP 1131
-#define HID_NUM_BULLET_PREV 1132
-#define HID_NUM_BULLET_NEXT 1133
-#define HID_NUM_BULLET_OUTLINE_MOVEDOWN 1142
-#define HID_NUM_BULLET_OUTLINE_MOVEUP 1141
-#define HID_NUM_BULLET_OUTLINE_UP 1140
-#define HID_NUM_BULLET_OUTLINE_DOWN 1139
-#define HID_NUM_BULLET_NONUM 1136
-#define HID_NUM_NUMBERING_ON 1144
-#define HID_NUM_BULLET_ON 1138
-#define HID_NUM_BULLET_OFF 1137
-#define HID_INSERT_IDX_ENTRY_DLG 1335
-#define HID_POSTIT 1329
-#define HID_INSERT_CAPTION 1310
-#define HID_INSERT_IDX 1336
-#define HID_INSERT_USERIDX 1337
-#define HID_INSERT_CNTNTIDX 1338
-#define HID_INSERT_IDX_ENTRY 1340
-#define HID_INSERT_USERIDX_ENTRY 1341
-#define HID_INSERT_CNTNTIDX_ENTRY 1342
-#define HID_INSERT_FRAME 1334
-#define HID_INSERT_FRAME_INTERACT 1333
-#define HID_INSERT_SOFT_HYPHEN 1350
-#define HID_INSERT_HARD_SPACE 1351
-#define HID_FORMAT_FRAME_DLG 1456
-#define HID_FRAME_TO_TOP 1470
-#define HID_FRAME_TO_BOTTOM 1471
-#define HID_FRAME_NOWRAP 1472
-#define HID_FRAME_WRAP 1473
-#define HID_FRAME_WRAPTHRU 1474
-#define HID_FRAME_ALIGN_HORZ_LEFT 1475
-#define HID_FRAME_ALIGN_HORZ_RIGHT 1476
-#define HID_FRAME_ALIGN_HORZ_CENTER 1477
-#define HID_FRAME_ALIGN_VERT_TOP 1478
-#define HID_FRAME_ALIGN_VERT_BOTTOM 1479
-#define HID_FRAME_ALIGN_VERT_CENTER 1480
-#define HID_EDIT_FIELD 1104
-#define HID_SET_FIELD_VALUE 1112
-#define HID_INSERT_FIELD 1308
-#define HID_INSERT_MERGEFIELD_DLG 1320
-#define HID_EXECUTE_MACROFIELD 1127
-#define HID_UPDATE_FIELDS 1126
-#define HID_UPDATE_INPUTFIELDS 1143
-#define HID_CALC_TABLE 1129
-#define HID_INSERT_BREAK_DLG 1304
-#define HID_INSERT_BOOKMARK 1302
-#define HID_DELETE_BOOKMARK 1301
-#define HID_INSERT_GRAFIC 1315
-#define HID_FORMAT_TABLE_DLG 1460
-#define HID_INSERT_TABLE 1330
-#define HID_INSERT_COLS 1332
-#define HID_PAGE_STYLE_SET_COLS 1538
-#define HID_CONVERT_TEXT_TABLE 1500
-#define HID_TABLE_INSERT_ROW 1501
-#define HID_TABLE_INSERT_COL 1502
-#define HID_TABLE_DELETE_ROW 1503
-#define HID_TABLE_DELETE_COL 1504
-#define HID_TABLE_SPLIT_CELLS 1505
-#define HID_TABLE_MERGE_CELLS 1506
-#define HID_TABLE_SET_ROW_HEIGHT 1507
-#define HID_TABLE_SET_COL_WIDTH 1508
-#define HID_TABLE_SET_ULSPACE 1509
-#define HID_TABLE_SET_GRID 1510
-#define HID_TABLE_SET_SHADOW 1511
-#define HID_FORMAT_CHAR_DLG 1441
-#define HID_FORMAT_PAGE_DLG 1452
-#define HID_CHANGE_PAGENUM 1634
-#define HID_FORMAT_PARA_DLG 1443
-#define HID_FORMAT_TAB_DLG 1445
-#define HID_FORMAT_BORDER_DLG 1447
-#define HID_FORMAT_BORDER 1439
-#define HID_FORMAT_SHADOW 1438
-#define HID_FORMAT_BACKGROUND 1448
-#define HID_FORMAT_BACKGROUND_DLG 1450
-#define HID_SET_FRM_SIZE 1481
-#define HID_SET_FRM_POSITION 1482
-#define HID_SET_FRM_ANCHOR 1483
-#define HID_SET_FRM_WRAP 1484
-#define HID_SET_FRM_DIST 1485
-#define HID_SET_FRM_OPTIONS 1486
-#define HID_SET_FRM_MACRO 1494
-#define HID_SET_FRM_COLUMNS 1495
-#define HID_SET_FRM_COLUMN_WIDTH 1496
-#define HID_SET_GRF_MIRROR 1488
-#define HID_SET_TABLE_WIDTH 1489
-#define HID_SET_TABLE_ALIGN 1490
-#define HID_TABLE_SET_READ_ONLY_CELLS 1517
-#define HID_TABLE_UNSET_READ_ONLY_CELLS 1519
-#define HID_NEW_STYLE_BY_EXAMPLE 1462
-#define HID_UPDATE_STYLES_DIRECT 1497
-#define HID_UPDATE_STYLE_BY_EXAMPLE 1463
-#define HID_STYLE_SHEET_FRAME_DLG 1464
-#define HID_STYLE_SHEET_DOC_DLG 1465
-#define HID_SET_STANDARD_FONTS 1442
-#define HID_COPY 1102
-#define HID_PASTE 1113
-#define HID_PASTEUNFORMATTED 1115
-#define HID_PASTESPECIAL 1114
-#define HID_CUT 1103
-#define HID_FLIP_HORZ_GRAFIC 1425
-#define HID_FLIP_VERT_GRAFIC 1426
-#define HID_FORMAT_GRAFIC_DLG 1458
-#define HID_VIEW_BOUNDS 1214
-#define HID_VIEW_FIELDS 1215
-#define HID_VIEW_META_CHARS 1224
-#define HID_VIEW_MARKS 1225
-#define HID_VIEW_FIELDNAME 1226
-#define HID_VIEW_TABLEGRID 1227
-#define HID_SEARCH 1117
-#define HID_REPEAT_SEARCH 1150
-#define HID_REPLACE 1118
-#define HID_GOTO 1111
-#define HID_SETUP_PRINTER_DLG 1015
-#define HID_PRINT_FILE 1010
-#define HID_PRINT_FILE_DEFAULT 1025
-#define HID_FAX 1028
-#define HID_PRINT_FILE_OPTIONS 1011
-#define HID_THESAURUS_DLG 1604
-#define HID_SPELLING_DLG 1601
-#define HID_HYPHENATE_OPT_DLG 1607
-#define HID_MERGE_FILE_DLG 1004
-#define HID_SELECT_DATABASE 1030
-#define HID_DOC_INFO_DLG 1031
-#define HID_MERGE_FILE 1003
-#define HID_MERGE_RECORD 1327
-#define HID_INSERT_RECORD 1326
-#define HID_NUMBERING_OUTLINE_DLG 1612
-#define HID_NUMBER_BULLETS 1121
-#define HID_ZOOM 1231
-#define HID_SORTING 1613
-#define HID_SORTING_DLG 1614
-#define HID_CALCULATE 1615
-#define HID_REFRESH_VIEW 1201
-#define HID_CHAR_LEFT 1901
-#define HID_CHAR_RIGHT 1902
-#define HID_LINE_UP 1903
-#define HID_LINE_DOWN 1904
-#define HID_START_OF_LINE 1905
-#define HID_END_OF_LINE 1906
-#define HID_START_OF_DOCUMENT 1907
-#define HID_END_OF_DOCUMENT 1908
-#define HID_SELECT_WORD 1943
-#define HID_SELECT_ALL 1119
-#define HID_START_OF_NEXT_PAGE 1909
-#define HID_END_OF_NEXT_PAGE 1910
-#define HID_START_OF_PREV_PAGE 1911
-#define HID_END_OF_PREV_PAGE 1912
-#define HID_START_OF_PAGE 1913
-#define HID_END_OF_PAGE 1914
-#define HID_NEXT_WORD 1921
-#define HID_START_OF_PARA 1919
-#define HID_END_OF_PARA 1920
-#define HID_PREV_WORD 1922
-#define HID_NEXT_SENT 1923
-#define HID_PREV_SENT 1924
-#define HID_SET_INS_MODE 1936
-#define HID_SET_ADD_MODE 1939
-#define HID_SET_EXT_MODE 1940
-#define HID_START_TABLE 1947
-#define HID_END_TABLE 1948
-#define HID_NEXT_TABLE 1949
-#define HID_PREV_TABLE 1950
-#define HID_TABLE_SELECT_ALL 1515
-#define HID_TABLE_SELECT_COL 1514
-#define HID_TABLE_SELECT_ROW 1513
-#define HID_START_OF_COLUMN 1917
-#define HID_END_OF_COLUMN 1918
-#define HID_START_OF_NEXT_COLUMN 1951
-#define HID_END_OF_NEXT_COLUMN 1952
-#define HID_START_OF_PREV_COLUMN 1953
-#define HID_END_OF_PREV_COLUMN 1954
-#define HID_FOOTNOTE_TO_ANCHOR 1955
-#define HID_NEXT_FOOTNOTE 1956
-#define HID_PREV_FOOTNOTE 1957
-#define HID_CNTNT_TO_NEXT_FRAME 1958
-#define HID_FRAME_TO_ANCHOR 1959
-#define HID_TO_HEADER 1960
-#define HID_TO_FOOTER 1961
-#define HID_IDX_MARK_TO_IDX 1962
-#define HID_DELETE 1925
-#define HID_BACKSPACE 1926
-#define HID_DELETE_SENT 1927
-#define HID_DELETE_BACK_SENT 1928
-#define HID_DELETE_WORD 1929
-#define HID_DELETE_BACK_WORD 1930
-#define HID_DELETE_LINE 1931
-#define HID_DELETE_BACK_LINE 1932
-#define HID_DELETE_PARA 1933
-#define HID_DELETE_BACK_PARA 1934
-#define HID_DELETE_WHOLE_LINE 1935
-#define HID_INSERT_BREAK 1303
-#define HID_INSERT_PAGEBREAK 1323
-#define HID_INSERT_LINEBREAK 1318
-#define HID_INSERT_COLUMN_BREAK 1305
-#define HID_INSERT_FOOTNOTE 1311
-#define HID_INSERT_FOOTNOTE_DLG 1312
-#define HID_FORMAT_FOOTNOTE_DLG 1468
-#define HID_UNDO 1120
-#define HID_REDO 1116
-#define HID_REPEAT 1122
-#define HID_REPAGINATE 1161
-#define HID_SHOW_UPDATE_HELP 1805
-#define HID_SHOW_KEYBOARD_HELP 1803
-#define HID_SHOW_HELP_MANUAL 1804
-#define HID_GLOSSARY_DLG 1620
-#define HID_EXPAND_GLOSSARY 1628
-#define HID_INSERT_GLOSSARY 1640
-#define HID_AUTO_CORRECT_DLG 1650
-#define HID_AUTO_CORRECT 1649
-#define HID_CONFIG_DLG 1627
-#define HID_INSERT_STRING 1331
-#define HID_SET_CHAR_STYLE 1491
-#define HID_SET_PARA_STYLE 1492
-#define HID_SET_PAGE_STYLE 1493
-#define HID_SET_LRMARGIN 1429
-#define HID_SET_ULMARGIN 1430
-#define HID_SET_HYPHEN_ZONE 1432
-#define HID_SET_PAGE_BREAK 1433
-#define HID_FORMAT_PAGE 1451
-#define HID_SET_KEEP_TOGETHER 1434
-#define HID_SET_WIDOW 1436
-#define HID_SET_ORPHAN 1437
-#define HID_BUFFER_UPDATE 1124
-#define HID_FORMAT_TAB 1444
-#define HID_IS_END_OF_PARA 2000
-#define HID_IS_END_OF_WORD 2000
-#define HID_IS_END_OF_DOC 2000
-#define HID_IS_START_OF_PARA 2000
-#define HID_IS_START_OF_WORD 2000
-#define HID_IS_START_OF_DOC 2000
-#define HID_EDIT_FORMULA 1128
-#define HID_ENVELOP 2050
-#define HID_LABEL 2051
-#define HID_AGENDA_WIZZARD 1663
-#define HID_MEMO_WIZZARD 1662
-#define HID_FAX_WIZZARD 1661
-#define HID_LETTER_WIZZARD 1660
-#define HID_LAUNCH_REGISTRY 1002
diff --git a/sw/source/ui/inc/hyp.hxx b/sw/source/ui/inc/hyp.hxx
index 330507024f3c..fdc997b58fb4 100644
--- a/sw/source/ui/inc/hyp.hxx
+++ b/sw/source/ui/inc/hyp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,12 +41,12 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenator > xHyph;
Link aOldLnk;
- LanguageType nLangError; // nicht vorhandene Sprache
- sal_uInt16 nPageCount; // Seitenanzahl fuer Progressanzeige
- sal_uInt16 nPageStart; // 1. gepruefte Seite
- sal_Bool bInSelection : 1; // Trennen von selektiertem Text
- sal_Bool bShowError : 1; // nicht vorhandene Sprache melden
- sal_Bool bAutomatic : 1; // Trennstellen ohne Rueckfrage einfuegen
+ LanguageType nLangError; // non existing language
+ sal_uInt16 nPageCount; // page count for progress view
+ sal_uInt16 nPageStart; // 1st checked page
+ sal_Bool bInSelection : 1; // seperating selected text
+ sal_Bool bShowError : 1; // report non existing language
+ sal_Bool bAutomatic : 1; // insert seperators without further inquiry
sal_Bool bInfoBox : 1; // display info-box when ending
DECL_LINK( SpellError, LanguageType * );
@@ -54,7 +55,7 @@ protected:
virtual sal_Bool SpellContinue();
virtual void SpellEnd( );
virtual sal_Bool SpellMore();
- virtual void InsertHyphen( const sal_uInt16 nPos ); // Hyphen einfuegen
+ virtual void InsertHyphen( const sal_uInt16 nPos ); // insert hyphen
public:
SwHyphWrapper( SwView* pVw,
@@ -65,3 +66,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/idxmrk.hxx b/sw/source/ui/inc/idxmrk.hxx
index 6d569bb798dd..22e71dbc6168 100644
--- a/sw/source/ui/inc/idxmrk.hxx
+++ b/sw/source/ui/inc/idxmrk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,6 @@
class SwWrtShell;
-/* -----------------07.09.99 08:02-------------------
-
- --------------------------------------------------*/
class SwInsertIdxMarkWrapper : public SfxChildWindow
{
AbstractMarkFloatDlg* pAbstDlg;
@@ -51,9 +49,6 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-/* -----------------07.09.99 08:02-------------------
-
- --------------------------------------------------*/
class SwInsertAuthMarkWrapper : public SfxChildWindow
{
AbstractMarkFloatDlg* pAbstDlg;
@@ -71,3 +66,4 @@ public:
#endif // _IDXMRK_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/imaildsplistener.hxx b/sw/source/ui/inc/imaildsplistener.hxx
index 9cb7d11f2684..f12fbc1f3256 100644
--- a/sw/source/ui/inc/imaildsplistener.hxx
+++ b/sw/source/ui/inc/imaildsplistener.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,5 @@ public:
};
#endif // INCLUDED_IMAILDISPATCHERLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/initui.hxx b/sw/source/ui/inc/initui.hxx
index 6c5b5b694445..77b44131c2be 100644
--- a/sw/source/ui/inc/initui.hxx
+++ b/sw/source/ui/inc/initui.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ extern SvStringsDtor* pDBNameList;
extern SvStringsDtor* pAuthFieldNameList;
extern SvStringsDtor* pAuthFieldTypeList;
-// stellt die Textbausteinverwaltung zur Verfuegung
+// provides textblock management
class SwGlossaries;
SW_DLLPUBLIC SwGlossaries* GetGlossaries();
@@ -77,3 +78,5 @@ extern void _FinitSpell();
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/inpdlg.hxx b/sw/source/ui/inc/inpdlg.hxx
index f2ed1b22f0d4..4a99f955c583 100644
--- a/sw/source/ui/inc/inpdlg.hxx
+++ b/sw/source/ui/inc/inpdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,9 @@
#include <svx/stddlg.hxx>
-#ifndef _SV_SVMEDIT_HXX //autogen
#include <svtools/svmedit.hxx>
-#endif
#include <vcl/fixed.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwInputField;
class SwSetExpField;
@@ -44,7 +41,7 @@ class SwField;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Einfuegen Felder
+ Description: insert fields
--------------------------------------------------------------------*/
class SwFldInputDlg: public SvxStandardDialog
@@ -76,3 +73,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/inputwin.hxx b/sw/source/ui/inc/inputwin.hxx
index 2f9aaa669205..0c9b185bf1ca 100644
--- a/sw/source/ui/inc/inputwin.hxx
+++ b/sw/source/ui/inc/inputwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,8 +69,8 @@ friend class InputEdit;
String aAktTableName, sOldFml;
sal_Int32 m_nActionCount;
- sal_Bool bFirst : 1; //Initialisierungen beim ersten Aufruf
- sal_Bool bActive : 1; //fuer Hide/Show beim Dokumentwechsel
+ sal_Bool bFirst : 1; // initialisations at first call
+ sal_Bool bActive : 1; // for hide/show when switching documents
sal_Bool bIsTable : 1;
sal_Bool bDelSel : 1;
bool m_bDoesUndo : 1;
@@ -131,3 +132,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx
index e9483eea02c3..385bdda08352 100644
--- a/sw/source/ui/inc/insfnote.hxx
+++ b/sw/source/ui/inc/insfnote.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,9 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <vcl/fixed.hxx>
class SwWrtShell;
@@ -44,7 +41,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog
{
SwWrtShell &rSh;
- //Alles fuer das/die Zeichen
+ // everything for the character(s)
String aFontName;
CharSet eCharSet;
char cExtChar;
@@ -56,7 +53,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog
Edit aNumberCharEdit;
PushButton aNumberExtChar;
- //Alles fuer die Auswahl Fussnote/Endnote
+ // everything for the selection footnote/endnote
FixedLine aTypeFL;
RadioButton aFtnBtn;
RadioButton aEndNoteBtn;
@@ -95,3 +92,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/insrule.hxx b/sw/source/ui/inc/insrule.hxx
index fff497ca2c0e..ea4d0cc08268 100644
--- a/sw/source/ui/inc/insrule.hxx
+++ b/sw/source/ui/inc/insrule.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,13 +27,14 @@
************************************************************************/
#ifndef _INSRULE_HXX
#define _INSRULE_HXX
+
+#include <vector>
+
#include "num.hxx"
class SwRulerValueSet;
class ValueSet;
-/*-----------------14.02.97 12.30-------------------
---------------------------------------------------*/
class SwInsertGrfRulerDlg : public SfxModalDialog
{
FixedLine aSelectionFL;
@@ -40,7 +42,7 @@ class SwInsertGrfRulerDlg : public SfxModalDialog
CancelButton aCancelPB;
HelpButton aHelpPB;
- List aGrfNames;
+ std::vector<String> aGrfNames;
String sSimple;
String sRulers;
sal_uInt16 nSelPos;
@@ -57,10 +59,11 @@ public:
String GetGraphicName();
sal_Bool IsSimpleLine() {return nSelPos == 1;}
- sal_Bool HasImages() const {return 0 != aGrfNames.Count();}
+ sal_Bool HasImages() const {return !aGrfNames.empty();}
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/instable.hxx b/sw/source/ui/inc/instable.hxx
index 24e54e4c0f86..9f222c918176 100644
--- a/sw/source/ui/inc/instable.hxx
+++ b/sw/source/ui/inc/instable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,18 +28,10 @@
#ifndef _INSTABLE_HXX
#define _INSTABLE_HXX
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <sfx2/basedlgs.hxx>
#include <actctrl.hxx>
#include <textcontrolcombo.hxx>
@@ -98,3 +91,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/javaedit.hxx b/sw/source/ui/inc/javaedit.hxx
index d78e77597d4d..767d05a7028c 100644
--- a/sw/source/ui/inc/javaedit.hxx
+++ b/sw/source/ui/inc/javaedit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,21 +32,13 @@
#include <svx/stddlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _SV_SVMEDIT_HXX //autogen
#include <svtools/svmedit.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwWrtShell;
class SwFldMgr;
@@ -116,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/label.hxx b/sw/source/ui/inc/label.hxx
index 46bf210bd8da..8a23e1e845ce 100644
--- a/sw/source/ui/inc/label.hxx
+++ b/sw/source/ui/inc/label.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,3 +98,4 @@ inline void SwLabDlg::ReplaceGroup( const String &rMake )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/labelcfg.hxx b/sw/source/ui/inc/labelcfg.hxx
index ab01d365bbe1..34b5e0786d8e 100644
--- a/sw/source/ui/inc/labelcfg.hxx
+++ b/sw/source/ui/inc/labelcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/labimg.hxx b/sw/source/ui/inc/labimg.hxx
index cb435bd38925..6733e4024383 100644
--- a/sw/source/ui/inc/labimg.hxx
+++ b/sw/source/ui/inc/labimg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,8 +34,8 @@
#include "swdllapi.h"
// class SwLabItem ----------------------------------------------------------
-
class SwLabCfgItem;
+
class SW_DLLPUBLIC SwLabItem : public SfxPoolItem
{
@@ -49,28 +50,28 @@ public:
virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
- rtl::OUString aLstMake; //Letzte Auswahl merken.
+ rtl::OUString aLstMake; // remember last selection
rtl::OUString aLstType;
- rtl::OUString sDBName; // Verwendete Datenbank
-
- rtl::OUString aWriting; // Aufschrift
- rtl::OUString aMake; // Etikettenmarke
- rtl::OUString aType; // Etikettentyp
- rtl::OUString aBin; // Druckerschacht
- sal_Int32 lHDist; // Horizontaler Abstand (Benutzer)
- sal_Int32 lVDist; // Vertikaler Abstand (Benutzer)
- sal_Int32 lWidth; // Breite (Benutzer)
- sal_Int32 lHeight; // Hoehe (Benutzer)
- sal_Int32 lLeft; // Rand links (Benutzer)
- sal_Int32 lUpper; // Rand oben (Benutzer)
- sal_Int32 nCols; // Anzahl Spalten (Benutzer)
- sal_Int32 nRows; // Anzahl Zeilen (Benutzer)
- sal_Int32 nCol; // Spalte fuer Einzeldruck
- sal_Int32 nRow; // Zeile fuer Einzeldruck
- sal_Bool bAddr;// Adresse als Aufschrift?
- sal_Bool bCont;// Endlospapier?
- sal_Bool bPage;// Ganze Seite oder einzelnes Etikett?
- sal_Bool bSynchron;// Alle Etiketten synchronisieren
+ rtl::OUString sDBName; // used database
+
+ rtl::OUString aWriting; // label
+ rtl::OUString aMake; // label mark
+ rtl::OUString aType; // label type
+ rtl::OUString aBin; // printer shaft
+ sal_Int32 lHDist; // horizontal distance (user)
+ sal_Int32 lVDist; // vertical distance (user)
+ sal_Int32 lWidth; // width (user)
+ sal_Int32 lHeight; // height (user)
+ sal_Int32 lLeft; // left border (user)
+ sal_Int32 lUpper; // upper border (user)
+ sal_Int32 nCols; // number of columns (user)
+ sal_Int32 nRows; // number of rows (user)
+ sal_Int32 nCol; // column for single print
+ sal_Int32 nRow; // row for single print
+ sal_Bool bAddr;// adress as label?
+ sal_Bool bCont;// continuous paper?
+ sal_Bool bPage;// whole page or single labels?
+ sal_Bool bSynchron;// synchronise all labels
//parts of the business card
rtl::OUString aPrivFirstName;
@@ -111,7 +112,6 @@ public:
};
// class SwLabCfgItem -------------------------------------------------------
-
class SwLabCfgItem : public utl::ConfigItem
{
SwLabItem aItem;
@@ -129,3 +129,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/langhelper.hxx b/sw/source/ui/inc/langhelper.hxx
index 213092062a00..90a8503cea6f 100755..100644
--- a/sw/source/ui/inc/langhelper.hxx
+++ b/sw/source/ui/inc/langhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,5 @@ namespace SwLangHelper
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/linenum.hxx b/sw/source/ui/inc/linenum.hxx
index 8d727b771750..270241a2f6bd 100644
--- a/sw/source/ui/inc/linenum.hxx
+++ b/sw/source/ui/inc/linenum.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <vcl/field.hxx>
#include <numberingtypelistbox.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
class Window;
class SfxItemSet;
@@ -43,9 +42,8 @@ class SwView;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: SingleTabDialog
+ Description: SingleTabDialog
--------------------------------------------------------------------*/
-
class SwLineNumberingDlg : public SfxSingleTabDialog
{
SwWrtShell* pSh;
@@ -60,9 +58,8 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: TabPage
+ Description: TabPage
--------------------------------------------------------------------*/
-
class SwLineNumberingPage : public SfxTabPage
{
CheckBox aNumberingOnCB;
@@ -107,4 +104,4 @@ public:
#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/listsh.hxx b/sw/source/ui/inc/listsh.hxx
index 61fea6ece214..30a97c04c0f2 100644
--- a/sw/source/ui/inc/listsh.hxx
+++ b/sw/source/ui/inc/listsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/macassgn.hxx b/sw/source/ui/inc/macassgn.hxx
index ac8be8d2dd87..291129d20ada 100644
--- a/sw/source/ui/inc/macassgn.hxx
+++ b/sw/source/ui/inc/macassgn.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@ class SvxMacroItem;
enum DlgEventType
{
- MACASSGN_TEXTBAUST,
+ MACASSGN_AUTOTEXT,
MACASSGN_GRAPHIC,
MACASSGN_OLE,
MACASSGN_FRMURL,
@@ -52,3 +53,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailconfigpage.hxx b/sw/source/ui/inc/mailconfigpage.hxx
index cf0022b378c8..4c01efb74a90 100644
--- a/sw/source/ui/inc/mailconfigpage.hxx
+++ b/sw/source/ui/inc/mailconfigpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,25 +29,15 @@
#define _MAILCONFIGPAGE_HXX
#include <sfx2/tabdlg.hxx>
-#ifndef _BUTTON_HXX
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIELD_HXX
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
#include <sfx2/basedlgs.hxx>
class SwTestAccountSettingsDialog;
class SwMailMergeConfigItem;
-/*-- 05.05.2004 16:45:45---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMailConfigPage : public SfxTabPage
{
friend class SwTestAccountSettingsDialog;
@@ -95,9 +86,6 @@ public:
};
-/*-- 18.08.2004 12:02:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailConfigDlg : public SfxSingleTabDialog
{
public:
@@ -108,3 +96,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/maildispatcher.hxx b/sw/source/ui/inc/maildispatcher.hxx
index bc8afb829fdf..ad5521d3814a 100644
--- a/sw/source/ui/inc/maildispatcher.hxx
+++ b/sw/source/ui/inc/maildispatcher.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
#ifndef INCLUDED_MAILDISPATCHER_HXX
#define INCLUDED_MAILDISPATCHER_HXX
-//#ifndef _COM_SUN_STAR_MAIL_XMAILSERVER_HPP_
-//#include "com/sun/star/mail/XMailServer.hpp"
-//#endif
#include "com/sun/star/mail/XSmtpService.hpp"
#include "com/sun/star/mail/XMailMessage.hpp"
#include <osl/thread.hxx>
@@ -166,3 +164,5 @@ private:
};
#endif // INCLUDED_MAILDISPATCHER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailmergechildwindow.hxx b/sw/source/ui/inc/mailmergechildwindow.hxx
index fb4f529f10cf..a02ca949180c 100644
--- a/sw/source/ui/inc/mailmergechildwindow.hxx
+++ b/sw/source/ui/inc/mailmergechildwindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,6 @@
#include <vcl/toolbox.hxx>
#include "swdllapi.h"
-/*-- 25.05.2004 15:25:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailMergeChildWin : public SfxFloatingWindow
{
ToolBox m_aBackTB;
@@ -47,10 +45,8 @@ public:
virtual void FillInfo(SfxChildWinInfo&) const;
};
-/*-- 25.05.2004 15:25:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwSendMailDialog;
+
class SwMailMergeChildWindow : public SfxChildWindow
{
public:
@@ -64,3 +60,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailmergehelper.hxx b/sw/source/ui/inc/mailmergehelper.hxx
index 954ce643d8e9..a38ef5eef0ca 100644
--- a/sw/source/ui/inc/mailmergehelper.hxx
+++ b/sw/source/ui/inc/mailmergehelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,8 +43,8 @@
#include <vcl/scrbar.hxx>
#include "swdllapi.h"
-
class SwMailMergeConfigItem;
+
namespace com{ namespace sun{ namespace star{
namespace uno{
class XComponentContext;
@@ -56,9 +57,7 @@ namespace com{ namespace sun{ namespace star{
class XMailService;
}
}}}
-/*-- 14.06.2004 12:27:42---------------------------------------------------
- -----------------------------------------------------------------------*/
namespace SwMailMergeHelper
{
SW_DLLPUBLIC String CallSaveAsDialog(String& rFilter);
@@ -70,9 +69,7 @@ namespace SwMailMergeHelper
const String& rOutMailServerPassword,
Window* pDialogParentWindow = 0 );
}
-/* -----------------06.04.2004 10:29-----------------
- --------------------------------------------------*/
class SW_DLLPUBLIC SwBoldFixedInfo : public FixedInfo
{
public:
@@ -86,7 +83,7 @@ namespace com{namespace sun{namespace star{
}
}}}
-/*-- 27.04.2004 13:20:00---------------------------------------------------
+/*-------------------------------------------------------------------------
Preview window used to show the possible selection of address blocks
and also the resulting address filled with database data
-----------------------------------------------------------------------*/
@@ -142,7 +139,7 @@ public:
void SetSelectHdl (const Link& rLink) {m_aSelectHdl = rLink;}
};
-/*-- 11.05.2004 15:39:59---------------------------------------------------
+/*-------------------------------------------------------------------------
iterate over an address block or a greeting line
the iterator returns the parts either as pure string
or as column
@@ -156,6 +153,7 @@ struct SwMergeAddressItem
bIsColumn(false),
bIsReturn(false) {}
};
+
class SW_DLLPUBLIC SwAddressIterator
{
String sAddress;
@@ -167,9 +165,6 @@ public:
bool HasMore() const{return sAddress.Len() > 0;}
};
-/*-- 21.05.2004 10:31:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SW_DLLPUBLIC SwAuthenticator :
public cppu::WeakImplHelper1< ::com::sun::star::mail::XAuthenticator>
{
@@ -189,9 +184,7 @@ public:
virtual ::rtl::OUString SAL_CALL getPassword( ) throw (::com::sun::star::uno::RuntimeException);
};
-/*-- 25.08.2004 12:48:47---------------------------------------------------
- -----------------------------------------------------------------------*/
class SW_DLLPUBLIC SwConnectionContext :
public cppu::WeakImplHelper1< ::com::sun::star::uno::XCurrentContext >
{
@@ -206,17 +199,13 @@ public:
virtual ::com::sun::star::uno::Any SAL_CALL getValueByName( const ::rtl::OUString& Name )
throw (::com::sun::star::uno::RuntimeException);
};
-/*-- 21.05.2004 10:39:20---------------------------------------------------
- -----------------------------------------------------------------------*/
class SwMutexBase
{
public:
osl::Mutex m_aMutex;
};
-/*-- 21.05.2004 10:39:20---------------------------------------------------
- -----------------------------------------------------------------------*/
class SW_DLLPUBLIC SwConnectionListener :
public SwMutexBase,
public cppu::WeakComponentImplHelper1< ::com::sun::star::mail::XConnectionListener >
@@ -239,9 +228,6 @@ public:
throw(com::sun::star::uno::RuntimeException);
};
-/*-- 13.07.2004 09:02:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailTransferable :
public SwMutexBase,
public cppu::WeakComponentImplHelper2
@@ -281,9 +267,6 @@ class SwMailTransferable :
};
-/*-- 22.06.2004 16:38:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
class SwMailMessage :
public SwMutexBase,
public cppu::WeakComponentImplHelper1< ::com::sun::star::mail::XMailMessage >
@@ -305,7 +288,7 @@ public:
SwMailMessage();
~SwMailMessage();
- // Attributes
+ // attributes
virtual ::rtl::OUString SAL_CALL getSenderName() throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getSenderAddress() throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getReplyToAddress() throw (::com::sun::star::uno::RuntimeException);
@@ -319,7 +302,7 @@ public:
virtual void SAL_CALL setBody( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _body )
throw (::com::sun::star::uno::RuntimeException);
- // Methods
+ // methods
virtual void SAL_CALL addRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addCcRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addBccRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
@@ -338,12 +321,11 @@ public:
void SetSenderAddress(const ::rtl::OUString& rSenderAddress)
{m_sSenderAddress = rSenderAddress;}
};
-/*-- 21.05.2004 10:17:22---------------------------------------------------
- -----------------------------------------------------------------------*/
SW_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>
getCurrentCmpCtx(
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory> rSrvMgr);
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailmergewizard.hxx b/sw/source/ui/inc/mailmergewizard.hxx
index 7a582693b013..ea413b445b13 100644
--- a/sw/source/ui/inc/mailmergewizard.hxx
+++ b/sw/source/ui/inc/mailmergewizard.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx
index c541832462ec..fd0fb2e0787b 100644
--- a/sw/source/ui/inc/mailmrge.hxx
+++ b/sw/source/ui/inc/mailmrge.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,25 +30,15 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <svtools/stdctrl.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/Reference.h>
@@ -167,9 +158,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
};
-/* -----------------27.11.2002 12:05-----------------
- *
- * --------------------------------------------------*/
+
class SwMailMergeCreateFromDlg : public ModalDialog
{
FixedLine aCreateFromFL;
@@ -185,9 +174,7 @@ public:
sal_Bool IsThisDocument() const {return aThisDocRB.IsChecked();}
};
-/* -----------------04.02.2003 13:41-----------------
- *
- * --------------------------------------------------*/
+
class SwMailMergeFieldConnectionsDlg : public ModalDialog
{
FixedLine aConnectionsFL;
@@ -208,3 +195,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mediash.hxx b/sw/source/ui/inc/mediash.hxx
index 035c03656119..d01dc6692d96 100644
--- a/sw/source/ui/inc/mediash.hxx
+++ b/sw/source/ui/inc/mediash.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,3 +42,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mergetbl.hxx b/sw/source/ui/inc/mergetbl.hxx
index 239f776ee938..8923a2a1c2f3 100644
--- a/sw/source/ui/inc/mergetbl.hxx
+++ b/sw/source/ui/inc/mergetbl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,13 +28,9 @@
#ifndef _MERGETBL_HXX
#define _MERGETBL_HXX
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svx/stddlg.hxx>
@@ -57,3 +54,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc
index f7c7cfcde9a0..39f33d39d677 100644
--- a/sw/source/ui/inc/misc.hrc
+++ b/sw/source/ui/inc/misc.hrc
@@ -96,6 +96,7 @@
#define MN_REDLINE_POPUP (RC_MISC_BEGIN + 61)
#define STR_REMOVE_WARNING (RC_MISC_BEGIN + 62)
#define STRRES_NUMTYPES (RC_MISC_BEGIN + 63)
+#define STR_MY_AUTOTEXT (RC_MISC_BEGIN + 64)
#define MISC_ACT_END STRRES_NUMTYPES
diff --git a/sw/source/ui/inc/mmconfigitem.hxx b/sw/source/ui/inc/mmconfigitem.hxx
index e647e934792d..4ac5eab0da00 100644
--- a/sw/source/ui/inc/mmconfigitem.hxx
+++ b/sw/source/ui/inc/mmconfigitem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,18 +45,17 @@ namespace com{namespace sun{namespace star{
class XColumnsSupplier;
}
}}}
+
class SwMailMergeConfigItem_Impl;
class SwView;
-/*-- 06.04.2004 10:43:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
struct SwDocMergeInfo
{
long nStartPageInTarget;
long nEndPageInTarget;
long nDBRow;
};
+
class SW_DLLPUBLIC SwMailMergeConfigItem
{
// com::sun::star::uno::Sequence< ::rtl::OUString> m_aSavedDocuments;
@@ -275,5 +275,7 @@ public:
//helper methods
::rtl::OUString GetAssignedColumn(sal_uInt32 nColumn)const;
};
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/multmrk.hxx b/sw/source/ui/inc/multmrk.hxx
index e56da31afc47..3df0d7070fe2 100644
--- a/sw/source/ui/inc/multmrk.hxx
+++ b/sw/source/ui/inc/multmrk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,25 +31,15 @@
#include <svx/stddlg.hxx>
-
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/stdctrl.hxx>
-
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#include <vcl/fixed.hxx>
-
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwTOXMgr;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert mark for index entry
--------------------------------------------------------------------*/
class SwMultiTOXMarkDlg : public SvxStandardDialog
@@ -75,3 +66,4 @@ public:
#endif // _MULTMRK_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/navicfg.hxx b/sw/source/ui/inc/navicfg.hxx
index de400eca916e..a3666dc4e624 100644
--- a/sw/source/ui/inc/navicfg.hxx
+++ b/sw/source/ui/inc/navicfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _NAVICFG_HXX
#include <unotools/configitem.hxx>
-/* -----------------------------08.09.00 16:27--------------------------------
- ---------------------------------------------------------------------------*/
class SwNavigationConfig : public utl::ConfigItem
{
sal_Int32 nRootType; //RootType
@@ -39,7 +38,7 @@ class SwNavigationConfig : public utl::ConfigItem
sal_Int32 nRegionMode; //InsertMode
sal_Int32 nActiveBlock; //ActiveBlock//Expand/CollapsState
sal_Bool bIsSmall; //ShowListBox
- sal_Bool bIsGlobalActive; //GlobalDocMode// Globalansicht fuer GlobalDoc gueltig?
+ sal_Bool bIsGlobalActive; //GlobalDocMode// global view for GlobalDoc valid?
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
@@ -115,5 +114,7 @@ public:
}
}
};
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/navicont.hxx b/sw/source/ui/inc/navicont.hxx
index d1f0a70272aa..ba7d50057525 100644
--- a/sw/source/ui/inc/navicont.hxx
+++ b/sw/source/ui/inc/navicont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,16 +35,16 @@ class SwDocShell;
class TransferDataContainer;
class TransferableDataHelper;
-/* [Beschreibung]
- Navigator-Bookmark zur eindeutigen Identifizierung im Sw
+/*
+ navigator bookmark for distinct identification in Sw
*/
class NaviContentBookmark
{
- String aUrl; // URL inkl. Sprungmarke
- String aDescr; // Description
- long nDocSh; // Adresse der DocShell
- sal_uInt16 nDefDrag; // Description enthaelt defaultDragType
+ String aUrl; // URL including jump mark
+ String aDescr; // description
+ long nDocSh; // adress of DocShell
+ sal_uInt16 nDefDrag; // description contains defaultDragType
public:
NaviContentBookmark();
@@ -59,3 +60,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/navipi.hxx b/sw/source/ui/inc/navipi.hxx
index 36dcbd7fa2e3..97a8c4b6312f 100644
--- a/sw/source/ui/inc/navipi.hxx
+++ b/sw/source/ui/inc/navipi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
// INCLUDE ---------------------------------------------------------------
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <svl/lstner.hxx>
#include <svtools/transfer.hxx>
#include <sfx2/childwin.hxx>
@@ -49,9 +48,8 @@ class SwView;
class SwNavigationConfig;
class SfxObjectShellLock;
class SfxChildWindowContext;
-
-//-----------------------------------------------------------------------
class SwNavigationPI;
+
class SwNavHelpToolBox : public SwHelpToolBox
{
virtual void MouseButtonDown(const MouseEvent &rEvt);
@@ -60,7 +58,6 @@ class SwNavHelpToolBox : public SwHelpToolBox
SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId);
};
-
// CLASS -----------------------------------------------------------------
class SwNavigationPI : public Window,
public SfxControllerItem, public SfxListener
@@ -73,7 +70,6 @@ class SwNavigationPI : public Window,
SwNavHelpToolBox aContentToolBox;
SwHelpToolBox aGlobalToolBox;
ImageList aContentImageList;
- ImageList aContentImageListH;
SwContentTree aContentTree;
SwGlobalTree aGlobalTree;
ListBox aDocListBox;
@@ -81,7 +77,7 @@ class SwNavigationPI : public Window,
String sContentFileName;
String aContextArr[3];
String aStatusArr[4];
- Point aBoxBottomLeft; // Pos., wenn Box unten ist
+ Point aBoxBottomLeft; // Pos when Box is at bottom
SfxObjectShellLock *pxObjectShell;
SwView *pContentView;
@@ -99,7 +95,7 @@ class SwNavigationPI : public Window,
long nDocLBIniHeight;
long nWishWidth;
sal_uInt16 nAutoMarkIdx;
- sal_uInt16 nRegionMode; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link
+ sal_uInt16 nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
short nZoomIn;
short nZoomOutInit;
short nZoomOut;
@@ -147,7 +143,7 @@ protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- // zum App-Ende rechtzeitig ObjectShellLock loslassen
+ // release ObjectShellLock early enough for app end
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
NumEditAction& GetPageEdit();
@@ -159,7 +155,7 @@ public:
SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*);
~SwNavigationPI();
- void GotoPage(); // Seite anspringen; bindbare Funktion
+ void GotoPage(); // jump to page; bindable function
void Update() { FillBox(); }
void UpdateListBox();
@@ -196,3 +192,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/navmgr.hxx b/sw/source/ui/inc/navmgr.hxx
new file mode 100644
index 000000000000..2a86172e6c1b
--- /dev/null
+++ b/sw/source/ui/inc/navmgr.hxx
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Maja Djordjevic < ovcica@gmail.com > ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com>
+ * Caolan McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _NAVMGR_HXX
+#define _NAVMGR_HXX
+
+#include "swtypes.hxx"
+#include "pam.hxx"
+#include "swdllapi.h"
+
+class SwWrtShell;
+struct SwPosition;
+
+class SW_DLLPUBLIC SwNavigationMgr
+{
+private:
+ /*
+ * List of entries in the navigation history
+ * Each entry is a SwPosition, which represents a position within the document
+ * SwPosition is given by a node index (SwNodeIndex) which usually represents the paragraph the position is in
+ * and an index (SwIndex), which represents the position inside this paragraph.
+ * You can find more on SwPositions at http://wiki.services.openoffice.org/wiki/Writer_Core_And_Layout
+ *
+ * The navigation history behaves as a stack, to which items are added when we jump to a new position
+ * (e.g. click a link, or double click an entry from the navigator).
+ * Every use of the back/forward buttons results in moving the stack pointer within the navigation history
+ */
+ std::vector<SwPosition> _entries;
+ std::vector<SwPosition>::size_type _nCurrent; /* Current position within the navigation history */
+ SwWrtShell* _pMyShell; /* The active shell within which the navigation occurs */
+
+ void GotoSwPosition(const SwPosition &rPos);
+
+public:
+ /* Constructor that initializes the shell to the current shell */
+ SwNavigationMgr( SwWrtShell* pShell );
+ /* Can we go back in the history ? */
+ sal_Bool backEnabled() ;
+ /* Can we go forward in the history ? */
+ sal_Bool forwardEnabled();
+ /* The method that is called when we click the back button */
+ void goBack() ;
+ /* The method that is called when we click the forward button */
+ void goForward() ;
+ /* The method that adds the position pPos to the navigation history */
+ bool addEntry(const SwPosition& rPos);
+};
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/navsh.hxx b/sw/source/ui/inc/navsh.hxx
new file mode 100644
index 000000000000..7c12ddc3b1cb
--- /dev/null
+++ b/sw/source/ui/inc/navsh.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Maja Djordjevic < ovcica@gmail.com > ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com>
+ * Caolan McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _SWNAVIGATIONSH_HXX
+#define _SWNAVIGATIONSH_HXX
+
+#include "frmsh.hxx"
+
+class SfxItemSet;
+class SwWrtShell;
+
+
+
+class SwNavigationShell: public SwBaseShell
+{
+public:
+ SFX_DECL_INTERFACE(SW_NAVIGATIONSHELL)
+
+ SwNavigationShell(SwView &rView);
+
+ void GetState(SfxItemSet &);
+ void Execute(SfxRequest &);
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx
index c999bf25eb93..a9c8eb901201 100644
--- a/sw/source/ui/inc/num.hxx
+++ b/sw/source/ui/inc/num.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,25 +30,13 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _MENUBTN_HXX //autogen
#include <vcl/menubtn.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/stdctrl.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include <svx/stddlg.hxx>
#include <numprevw.hxx>
#include "numrule.hxx"
@@ -56,36 +45,23 @@ class SwWrtShell;
class SvxBrushItem;
class SwOutlineTabDialog;
-
-/*-----------------13.02.97 14.02-------------------
-
---------------------------------------------------*/
-
struct SwBmpItemInfo
{
SvxBrushItem* pBrushItem;
sal_uInt16 nItemId;
};
-
-/*-----------------07.02.97 15.37-------------------
-
---------------------------------------------------*/
#define NUM_PAGETYPE_BULLET 0
#define NUM_PAGETYPE_SINGLENUM 1
#define NUM_PAGETYPE_NUM 2
#define NUM_PAGETYPE_BMP 3
#define PAGETYPE_USER_START 10
-/*-----------------03.12.97 10:18-------------------
-
---------------------------------------------------*/
class SwNumPositionTabPage : public SfxTabPage
{
FixedLine aLevelFL;
MultiListBox aLevelLB;
- // --> OD 2008-02-01 #newlistlevelattrs#
// former set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
FixedLine aPositionFL;
@@ -98,9 +74,7 @@ class SwNumPositionTabPage : public SfxTabPage
MetricField aDistNumMF;
FixedText aAlignFT;
ListBox aAlignLB;
- // <--
- // --> OD 2008-02-01 #newlistlevelattrs#
// new set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
FixedText aLabelFollowedByFT;
@@ -113,7 +87,6 @@ class SwNumPositionTabPage : public SfxTabPage
MetricField aAlignedAtMF;
FixedText aIndentAtFT;
MetricField aIndentAtMF;
- // <--
PushButton aStandardPB;
@@ -128,10 +101,8 @@ class SwNumPositionTabPage : public SfxTabPage
sal_Bool bModified : 1;
sal_Bool bPreset : 1;
- sal_Bool bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
- // --> OD 2008-02-01 #newlistlevelattrs#
+ sal_Bool bInInintControl : 1; // work around modify-error; should be resolved from 391 on
bool bLabelAlignmentPosAndSpaceModeActive;
- // <--
void InitControls();
@@ -141,7 +112,6 @@ class SwNumPositionTabPage : public SfxTabPage
DECL_LINK( RelativeHdl, CheckBox * );
DECL_LINK( StandardHdl, PushButton * );
- // --> OD 2008-02-01 #newlistlevelattrs#
void InitPosAndSpaceMode();
void ShowControlsDependingOnPosAndSpaceMode();
@@ -149,7 +119,6 @@ class SwNumPositionTabPage : public SfxTabPage
DECL_LINK( ListtabPosHdl_Impl, MetricField* );
DECL_LINK( AlignAtHdl_Impl, MetricField* );
DECL_LINK( IndentAtHdl_Impl, MetricField* );
- // <--
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -203,3 +172,4 @@ class SwSvxNumBulletTabDialog : public SfxTabDialog
};
#endif // _NUM_CXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/numberingtypelistbox.hxx b/sw/source/ui/inc/numberingtypelistbox.hxx
index eaf35c349417..747328dd1378 100644
--- a/sw/source/ui/inc/numberingtypelistbox.hxx
+++ b/sw/source/ui/inc/numberingtypelistbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/numfmtlb.hxx b/sw/source/ui/inc/numfmtlb.hxx
index d21380f30358..e19d7206535e 100644
--- a/sw/source/ui/inc/numfmtlb.hxx
+++ b/sw/source/ui/inc/numfmtlb.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,3 +86,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index 6fb8fe446154..a173de881c1d 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,14 +33,12 @@
#include <vcl/lstbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
/* --- class SwParagraphNumTabPage ----------------------------------------
- Mit dieser TabPage werden Numerierungseinstellungen am Absatz bzw. der
- Absatzvorlage vorgenommen.
+ with this TabPage numbering settings at the paragraph / paragraph style
+ are performed.
---------------------------------------------------------------------------*/
class SwParagraphNumTabPage : public SfxTabPage
@@ -64,7 +63,6 @@ class SwParagraphNumTabPage : public SfxTabPage
// --> OD 2008-04-14 #outlinelevel#
const String msOutlineNumbering;
- // <--
sal_Bool bModified : 1;
sal_Bool bCurNumrule : 1;
@@ -96,3 +94,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/numprevw.hxx b/sw/source/ui/inc/numprevw.hxx
index 5324fa8189db..e40e49b41347 100644
--- a/sw/source/ui/inc/numprevw.hxx
+++ b/sw/source/ui/inc/numprevw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,6 @@
#include <vcl/window.hxx>
class SwNumRule;
-/*-----------------02.12.97 10:31-------------------
-
---------------------------------------------------*/
class NumberingPreview : public Window
{
@@ -69,3 +67,4 @@ class NumberingPreview : public Window
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/olesh.hxx b/sw/source/ui/inc/olesh.hxx
index 32a413300f36..c4c220b795e0 100644
--- a/sw/source/ui/inc/olesh.hxx
+++ b/sw/source/ui/inc/olesh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx
index 270c8d8e458c..bc2c7a1e8973 100644
--- a/sw/source/ui/inc/olmenu.hxx
+++ b/sw/source/ui/inc/olmenu.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,3 +90,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/optcomp.hxx b/sw/source/ui/inc/optcomp.hxx
index ae9de51f1ba8..b9e95f5722bf 100644
--- a/sw/source/ui/inc/optcomp.hxx
+++ b/sw/source/ui/inc/optcomp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,6 @@
#include <svx/checklbx.hxx>
// class SwCompatibilityOptPage ------------------------------------------
-
class SwWrtShell;
struct SwCompatibilityOptPage_Impl;
@@ -85,3 +85,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx
index d883a63060c1..1c5d0bd4d5b0 100644
--- a/sw/source/ui/inc/optload.hxx
+++ b/sw/source/ui/inc/optload.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _GROUP_HXX
#include <vcl/group.hxx>
-#endif
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
@@ -45,10 +44,6 @@ class SwFldMgr;
class SvLBoxEntry;
class SwWrtShell;
-/*-----------------31.08.96 10.09-------------------
-
---------------------------------------------------*/
-
class SwLoadOptPage : public SfxTabPage
{
private:
@@ -68,6 +63,7 @@ private:
FixedText aTabFT;
MetricField aTabMF;
CheckBox aUseSquaredPageMode;
+ CheckBox aUseCharUnit;
SwWrtShell* pWrtShell;
sal_Bool bHTMLMode;
@@ -88,18 +84,12 @@ public:
virtual void Reset( const SfxItemSet& rSet );
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
class SwCaptionOptDlg : public SfxSingleTabDialog
{
public:
SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet);
~SwCaptionOptDlg();
};
-/* -----------------23.10.98 13:19-------------------
- *
- * --------------------------------------------------*/
class CaptionComboBox : public SwComboBox
{
@@ -112,10 +102,6 @@ public:
{}
};
-/*-----------------31.08.96 10.09-------------------
-
---------------------------------------------------*/
-
class SwCaptionPreview : public Window
{
private:
@@ -210,4 +196,4 @@ public:
#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index 4ee11b8757c6..2279161b5841 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,25 +29,15 @@
#define _OPTPAGE_HXX
#include <sfx2/tabdlg.hxx>
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/ctrlbox.hxx>
#include <svx/fntctrl.hxx>
#include <fontcfg.hxx>
@@ -56,10 +47,6 @@ class SwStdFontConfig;
class SwWrtShell;
class FontList;
-/*-----------------31.08.96 10.09-------------------
-
---------------------------------------------------*/
-
class SwContentOptPage : public SfxTabPage
{
//visual aids
@@ -107,11 +94,9 @@ public:
};
-/*-------- OS 27.01.95 -----------------------------------
- TabPage Druckereinstellungen Zusaetze
+/*--------------------------------------------------------
+ TabPage printer settings additions
--------------------------------------------------------- */
-
-
class SwAddPrinterTabPage : public SfxTabPage
{
FixedLine aFL1;
@@ -172,10 +157,6 @@ public:
};
-/*-----------------03.09.96 11.50-------------------
-
---------------------------------------------------*/
-
class SwStdFontTabPage : public SfxTabPage
{
FixedLine aStdChrFL ;
@@ -218,7 +199,7 @@ class SwStdFontTabPage : public SfxTabPage
SwStdFontConfig* pFontConfig;
SwWrtShell* pWrtShell;
LanguageType eLanguage;
- // waren nur defaults vorhanden? wurden sie mit den Boxen ueberschrieben
+ // only defaults were there? they were signed with the boxes
sal_Bool bListDefault :1;
sal_Bool bSetListDefault :1;
sal_Bool bLabelDefault :1;
@@ -260,10 +241,6 @@ public:
virtual void PageCreated (SfxAllItemSet aSet);
};
-/*-----------------18.01.97 12.10-------------------
-
---------------------------------------------------*/
-
class SwTableOptionsTabPage : public SfxTabPage
{
FixedLine aTableFL;
@@ -322,8 +299,9 @@ public:
virtual void PageCreated (SfxAllItemSet aSet);
};
-/*-----------------31.10.97 17:55-------------------
- TabPage fuer ShadowCrsr
+
+/*--------------------------------------------------
+ TabPage for ShadowCrsr
--------------------------------------------------*/
class SwShdwCrsrOptionsTabPage : public SfxTabPage
{
@@ -374,9 +352,8 @@ public:
};
/*-----------------------------------------------------------------------
- Beschreibung: Markierungsvorschau
+ Description: mark preview
-----------------------------------------------------------------------*/
-
class SwMarkPreview : public Window
{
Color m_aBgCol; // background
@@ -412,9 +389,8 @@ public:
};
/*-----------------------------------------------------------------------
- Beschreibung: Redlining-Optionen
+ Description: redlining options
-----------------------------------------------------------------------*/
-
class SwRedlineOptionsTabPage : public SfxTabPage
{
FixedLine aInsertFL;
@@ -468,11 +444,11 @@ public:
virtual void Reset( const SfxItemSet& rSet );
};
-/*--------OS 11.01.95 -----------------------------------
- TabPage Testeinstellungen fuer SW
+/*-------------------------------------------------------
+ TabPage test settings for SW
--------------------------------------------------------- */
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
class SwTestTabPage : public SfxTabPage
{
@@ -506,4 +482,6 @@ private:
};
#endif //PRODUCT
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/outline.hxx b/sw/source/ui/inc/outline.hxx
index f626de0c0fa3..22bc4f14a26b 100644
--- a/sw/source/ui/inc/outline.hxx
+++ b/sw/source/ui/inc/outline.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,28 +33,18 @@
#include <vcl/menu.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <svtools/stdctrl.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#include "swtypes.hxx" //fuer MAXLEVEL
+#include "swtypes.hxx" //for MAXLEVEL
#include <numprevw.hxx>
#include <numberingtypelistbox.hxx>
@@ -61,9 +52,6 @@ class SwWrtShell;
class SwNumRule;
class SwChapterNumRules;
-/* -----------------07.07.98 13:38-------------------
- *
- * --------------------------------------------------*/
class SwOutlineTabDialog : public SfxTabDialog
{
static sal_uInt16 nNumLevel;
@@ -99,9 +87,7 @@ class SwOutlineTabDialog : public SfxTabDialog
static sal_uInt16 GetActNumLevel() {return nNumLevel;}
static void SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;}
};
-/* -----------------07.07.98 13:47-------------------
- *
- * --------------------------------------------------*/
+
class SwOutlineSettingsTabPage : public SfxTabPage
{
FixedLine aLevelFL;
@@ -163,4 +149,7 @@ public:
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
};
+
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/pardlg.hxx b/sw/source/ui/inc/pardlg.hxx
index 3946300dc248..2bb0be8dc5fe 100644
--- a/sw/source/ui/inc/pardlg.hxx
+++ b/sw/source/ui/inc/pardlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,3 +38,5 @@ class SfxItemSet;
#define DLG_ENVELOP 2
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/pattern.hxx b/sw/source/ui/inc/pattern.hxx
index 2ee7cb079afd..d8bfd1a5e179 100644
--- a/sw/source/ui/inc/pattern.hxx
+++ b/sw/source/ui/inc/pattern.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index 5f8c147bf374..319782255c70 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,23 +30,16 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <svtools/ctrlbox.hxx>
/*--------------------------------------------------------------------
- Beschreibung: Fussnoteneinstellungs-TabPage
+ Description: footnote settings TabPage
--------------------------------------------------------------------*/
-
class SwFootNotePage: public SfxTabPage
{
public:
@@ -73,12 +67,18 @@ private:
LineListBox aLineTypeBox;
FixedText aLineWidthLbl;
MetricField aLineWidthEdit;
+ FixedText aLineColorLbl;
+ ColorListBox aLineColorBox;
+ FixedText aLineLengthLbl;
+ MetricField aLineLengthEdit;
FixedText aLineDistLbl;
MetricField aLineDistEdit;
DECL_LINK( HeightPage, Button * );
DECL_LINK( HeightMetric, Button * );
DECL_LINK( HeightModify, MetricField * );
+ DECL_LINK( LineWidthChanged_Impl, void * );
+ DECL_LINK( LineColorSelected_Impl, void * );
long lMaxHeight;
@@ -91,3 +91,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx
index 165f77be8302..974b48690465 100644
--- a/sw/source/ui/inc/pggrid.hxx
+++ b/sw/source/ui/inc/pggrid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,17 +30,13 @@
#include <sfx2/tabdlg.hxx>
#include <colex.hxx>
-#ifndef _FIELD_HXX
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
#include <svtools/ctrlbox.hxx>
+
/*--------------------------------------------------------------------
Description: TabPage Format/(Styles/)Page/Text grid
--------------------------------------------------------------------*/
-
class SwTextGridPage: public SfxTabPage
{
FixedLine aGridTypeFL;
@@ -54,12 +51,14 @@ class SwTextGridPage: public SfxTabPage
FixedText aLinesPerPageFT;
NumericField aLinesPerPageNF;
+ FixedText aLinesRangeFT;
FixedText aTextSizeFT;
MetricField aTextSizeMF;
FixedText aCharsPerLineFT;
NumericField aCharsPerLineNF;
+ FixedText aCharsRangeFT;
FixedText aCharWidthFT;
MetricField aCharWidthMF;
@@ -76,19 +75,22 @@ class SwTextGridPage: public SfxTabPage
FixedText aColorFT;
ColorListBox aColorLB;
- Window* aControls[18];
+ Window* aControls[20];
sal_Int32 m_nRubyUserValue;
sal_Bool m_bRubyUserValue;
Size m_aPageSize;
sal_Bool m_bVertical;
sal_Bool m_bSquaredMode;
+ sal_Bool m_bHRulerChanged;
+ sal_Bool m_bVRulerChanged;
SwTextGridPage(Window *pParent, const SfxItemSet &rSet);
~SwTextGridPage();
void UpdatePageSize(const SfxItemSet& rSet);
void PutGridItem(SfxItemSet& rSet);
+ void SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue );
DECL_LINK(GridTypeHdl, RadioButton*);
DECL_LINK(CharorLineChangedHdl, SpinField*);
@@ -111,3 +113,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/popbox.hxx b/sw/source/ui/inc/popbox.hxx
index bc9fa1855287..2df2b6cc894a 100644
--- a/sw/source/ui/inc/popbox.hxx
+++ b/sw/source/ui/inc/popbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _POPBOX_HXX
-#ifndef _TOOLBOX_HXX
#include <vcl/toolbox.hxx>
-#endif
#include <svtools/transfer.hxx>
class SwNavigationPI;
@@ -38,7 +37,7 @@ class SwNavigationPI;
class SwHelpToolBox: public ToolBox, public DropTargetHelper
{
Link aDoubleClickLink;
- Link aRightClickLink; // Link bekommt MouseEvent als Parameter !!!
+ Link aRightClickLink; // link gets mouse event as parameter !!!
using ToolBox::DoubleClick;
@@ -65,3 +64,5 @@ inline void SwHelpToolBox::SetRightClickLink(const Link &rLink) {
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/prcntfld.hxx b/sw/source/ui/inc/prcntfld.hxx
index e36d330f22b5..d9e3e2b77cc3 100644
--- a/sw/source/ui/inc/prcntfld.hxx
+++ b/sw/source/ui/inc/prcntfld.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,14 +28,12 @@
#ifndef _PRCNTFLD_HXX
#define _PRCNTFLD_HXX
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include "swdllapi.h"
class SW_DLLPUBLIC PercentField : public MetricField
{
- sal_Int64 nRefValue; // 100%-Wert fuer Umrechnung (in Twips)
+ sal_Int64 nRefValue; // 100% value for conversion (in Twips)
sal_Int64 nOldMax;
sal_Int64 nOldMin;
sal_Int64 nOldSpinSize;
@@ -97,3 +96,4 @@ public:
#endif // _PRCNTFLD_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index 35146bcc1ae0..e9902fbfd339 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,7 +74,7 @@ public:
SwPagePreViewWin( Window* pParent, SwPagePreView& rView );
~SwPagePreViewWin();
- //Ruft ViewShell::Paint
+ // calls ViewShell::Paint
virtual void Paint( const Rectangle& rRect );
virtual void KeyInput( const KeyEvent & );
virtual void Command( const CommandEvent& rCEvt );
@@ -170,15 +171,13 @@ public:
CreateAccessible();
};
-
/*--------------------------------------------------------------------
- Beschreibung: Sicht auf ein Dokument
+ Description: view of a document
--------------------------------------------------------------------*/
-
class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
{
- // ViewWindow und Henkel zur Core
- // aktuelle Dispatcher-Shell
+ // ViewWindow and handle to core
+ // current dispatcher shell
SwPagePreViewWin aViewWin;
//viewdata of the previous SwView and the new crsrposition
String sSwViewData,
@@ -186,18 +185,17 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too
sal_uInt16 nNewPage;
- // Sichtbarer Bereich
+ // visible range
String sPageStr;
Size aDocSz;
Rectangle aVisArea;
- // MDI Bedienelemente
+ // MDI control elements
SwScrollbar *pHScrollbar;
SwScrollbar *pVScrollbar;
ImageButton *pPageUpBtn,
*pPageDownBtn;
- // Dummy-Window zum F�llen der rechten unteren Ecke, wenn beide Scrollbars
- // aktiv sind
+ // dummy window for filling the lower right edge when both scrollbars are active
Window *pScrollFill;
sal_uInt16 mnPageCount;
@@ -285,7 +283,7 @@ public:
sal_uInt16 GetNewPage() const {return nNewPage;}
void SetNewPage(sal_uInt16 nSet) {nNewPage = nSet;}
- // Handler
+ // handler
void Execute(SfxRequest&);
void GetState(SfxItemSet&);
void StateUndo(SfxItemSet&);
@@ -325,12 +323,12 @@ public:
~SwPagePreView();
};
-// ----------------- inline Methoden ----------------------
-
-
+// ----------------- inline methods ----------------------
inline void SwPagePreView::AdjustEditWin()
{
OuterResizePixel( Point(), GetFrameWindow()->GetOutputSizePixel() );
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx
index 159e71628f46..8dedffb9aa4a 100644
--- a/sw/source/ui/inc/redlndlg.hxx
+++ b/sw/source/ui/inc/redlndlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <redline.hxx>
#include <tools/datetime.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SVSTDARR_HXX
#include <svl/svstdarr.hxx>
-#endif
#include <svl/eitem.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/viewfrm.hxx>
@@ -45,17 +44,17 @@ class SwChildWinWrapper;
struct SwRedlineDataChild
{
- const SwRedlineData* pChild; // Verweis auf originale gestackte Daten
- const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
- SvLBoxEntry* pTLBChild; // zugehoeriger TreeListBox-Eintrag
+ const SwRedlineData* pChild; // link to original stacked data
+ const SwRedlineDataChild* pNext; // link to stacked data
+ SvLBoxEntry* pTLBChild; // corresponding TreeListBox entry
};
struct SwRedlineDataParent
{
const SwRedlineData* pData; // RedlineDataPtr
- const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
- SvLBoxEntry* pTLBParent; // zugehoeriger TreeListBox-Eintrag
- String sComment; // Redline-Kommentar
+ const SwRedlineDataChild* pNext; // link to stacked data
+ SvLBoxEntry* pTLBParent; // corresponding TreeListBox entry
+ String sComment; // redline comment
inline sal_Bool operator==( const SwRedlineDataParent& rObj ) const
{ return (pData && pData->GetSeqNo() == rObj.pData->GetSeqNo()); }
@@ -145,10 +144,6 @@ public:
virtual void Resize();
};
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
class SwModelessRedlineAcceptDlg : public SfxModelessDialog
{
SwRedlineAcceptDlg* pImplDlg;
@@ -165,11 +160,6 @@ public:
void Initialize (SfxChildWinInfo* pInfo);
};
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
class SwRedlineAcceptChild : public SwChildWinWrapper
{
public:
@@ -187,3 +177,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx
index bcdb06393f6c..ca006c2bc940 100644
--- a/sw/source/ui/inc/regionsw.hxx
+++ b/sw/source/ui/inc/regionsw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,6 @@
#include <svx/paraprev.hxx>
#include <editeng/lrspitem.hxx>
-
class SwWrtShell;
class EditRegionDlg;
@@ -62,9 +62,8 @@ namespace sfx2
}
/*************************************************************************
- Dialog "Bereiche bearbeiten"
+ dialog "edit regions"
*************************************************************************/
-
class SectRepr;
typedef SectRepr* SectReprPtr;
SV_DECL_PTRARR_SORT( SectReprArr, SectReprPtr, 0, 4 )
@@ -96,10 +95,9 @@ class SwEditRegionDlg : public SfxModalDialog
FixedText aConditionFT;
ConditionEdit aConditionED;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
FixedLine aPropertiesFL;
TriStateBox aEditInReadonlyCB;
- // <--
OKButton aOK;
CancelButton aCancel;
@@ -107,7 +105,6 @@ class SwEditRegionDlg : public SfxModalDialog
PushButton aDismiss;
HelpButton aHelp;
ImageList aImageIL;
- ImageList aImageILH;
SwWrtShell& rSh;
SectReprArr aSectReprArr;
@@ -120,7 +117,7 @@ class SwEditRegionDlg : public SfxModalDialog
sal_Bool bWeb :1;
- Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden,sal_Bool bHighContrast);
+ Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden);
void RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry);
sal_uInt16 FindArrPos(const SwSectionFmt* pFmt);
@@ -135,9 +132,8 @@ class SwEditRegionDlg : public SfxModalDialog
DECL_LINK( ChangePasswdHdl, Button * );
DECL_LINK( ChangeProtectHdl, TriStateBox * );
DECL_LINK( ChangeHideHdl, TriStateBox * );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
DECL_LINK( ChangeEditInReadonlyHdl, TriStateBox * );
- // <--
DECL_LINK( ChangeDismissHdl, CheckBox * );
DECL_LINK( UseFileHdl, CheckBox* );
DECL_LINK( FileSearchHdl, PushButton* );
@@ -156,13 +152,10 @@ public:
void SelectSection(const String& rSectionName);
};
+
/*************************************************************************
- Dialog "Bereich einfuegen"
+ dialog "insert region"
*************************************************************************/
-
-/* -----------------21.05.99 11:05-------------------
- *
- * --------------------------------------------------*/
class SwInsertSectionTabPage : public SfxTabPage
{
FixedLine aNameFL;
@@ -188,10 +181,9 @@ class SwInsertSectionTabPage : public SfxTabPage
FixedText aConditionFT;
ConditionEdit aConditionED;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
FixedLine aPropertiesFL;
CheckBox aEditInReadonlyCB;
- // <--
String m_sFileName;
String m_sFilterName;
@@ -204,9 +196,8 @@ class SwInsertSectionTabPage : public SfxTabPage
Window* m_pOldDefDlgParent;
DECL_LINK( ChangeHideHdl, CheckBox * );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
DECL_LINK( ChangeEditInReadonlyHdl, CheckBox * );
- // <--
DECL_LINK( ChangeProtectHdl, CheckBox * );
DECL_LINK( ChangePasswdHdl, Button * );
DECL_LINK( NameEditHdl, Edit * );
@@ -272,9 +263,7 @@ public:
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
};
-/* -----------------13.06.2003 09:51-----------------
- --------------------------------------------------*/
class SwSectionIndentTabPage : public SfxTabPage
{
FixedLine aIndentFL;
@@ -299,9 +288,6 @@ public:
void SetWrtShell(SwWrtShell& rSh);
};
-/* -----------------21.05.99 13:07-------------------
- *
- * --------------------------------------------------*/
class SwInsertSectionTabDialog : public SfxTabDialog
{
SwWrtShell& rWrtSh;
@@ -318,9 +304,6 @@ public:
SwSectionData * GetSectionData() { return m_pSectionData.get(); }
};
-/* -----------------21.05.99 13:07-------------------
- *
- * --------------------------------------------------*/
class SwSectionPropertyTabDialog : public SfxTabDialog
{
SwWrtShell& rWrtSh;
@@ -333,4 +316,4 @@ public:
#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/rowht.hxx b/sw/source/ui/inc/rowht.hxx
index 6ad4e5f7ab19..0302fcefe4bb 100644
--- a/sw/source/ui/inc/rowht.hxx
+++ b/sw/source/ui/inc/rowht.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,22 +29,9 @@
#define _ROWHT_HXX
#include <svx/stddlg.hxx>
-
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
class SwWrtShell;
@@ -65,3 +53,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/scroll.hxx b/sw/source/ui/inc/scroll.hxx
index 49d023d17605..f0243f5fc6ee 100644
--- a/sw/source/ui/inc/scroll.hxx
+++ b/sw/source/ui/inc/scroll.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,18 +27,16 @@
************************************************************************/
#ifndef _SCROLL_HXX
#define _SCROLL_HXX
-#ifndef _SCRBAR_HXX //autogen
#include <vcl/scrbar.hxx>
-#endif
class SwScrollbar: public ScrollBar
{
Size aDocSz;
- sal_Bool bHori :1; // Horizontal = sal_True, sonst Vertikal
- sal_Bool bAuto :1; // fuer Scrollingmode
+ sal_Bool bHori :1; // horizontal = salTrue, otherwise vertical
+ sal_Bool bAuto :1; // for scrolling mode
sal_Bool bThumbEnabled:1;
- sal_Bool bVisible :1; // Show/Hide sollen nur noch dieses Flag setzen
- sal_Bool bSizeSet :1; // wurde die Groesse bereits gesetzt?
+ sal_Bool bVisible :1; // show/hide should only set this flag
+ sal_Bool bSizeSet :1; // was the size already set?
void AutoShow();
@@ -52,11 +51,11 @@ public:
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
sal_Bool IsVisible(sal_Bool bReal) const { return bReal ? ScrollBar::IsVisible() : bVisible; }
- // Aenderung der Dokumentgroesse
+ // changing of document size
void DocSzChgd(const Size &rNewSize);
- // Aenderung des sichtbaren Bereiches
+ // changing of visible region
void ViewPortChgd(const Rectangle &rRectangle);
- // was fuer einer ist es denn ??
+ // what is it??
sal_Bool IsHoriScroll() const { return bHori; }
void SetAuto(sal_Bool bSet);
@@ -69,3 +68,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/selglos.hxx b/sw/source/ui/inc/selglos.hxx
index 357600a31c0d..4ce626454d25 100644
--- a/sw/source/ui/inc/selglos.hxx
+++ b/sw/source/ui/inc/selglos.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,18 +28,12 @@
#ifndef _SELGLOS_HXX
#define _SELGLOS_HXX
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <vcl/fixed.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwSelGlossaryDlg : public ModalDialog
{
@@ -72,3 +67,5 @@ inline void SwSelGlossaryDlg::SelectEntryPos(sal_uInt16 nIdx)
{ aGlosBox.SelectEntryPos(nIdx); }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/sharedconnection.hxx b/sw/source/ui/inc/sharedconnection.hxx
index cbb6f41d17ad..cf61e646b9cc 100644
--- a/sw/source/ui/inc/sharedconnection.hxx
+++ b/sw/source/ui/inc/sharedconnection.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,3 +35,5 @@
typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection;
#endif // SW_UI_SHARED_CONNECTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/shdwcrsr.hxx b/sw/source/ui/inc/shdwcrsr.hxx
index 0652596b128c..7a6c85047dc0 100644
--- a/sw/source/ui/inc/shdwcrsr.hxx
+++ b/sw/source/ui/inc/shdwcrsr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/shells.hrc b/sw/source/ui/inc/shells.hrc
index 2058b6432ed8..569dba2a05ac 100644
--- a/sw/source/ui/inc/shells.hrc
+++ b/sw/source/ui/inc/shells.hrc
@@ -102,7 +102,9 @@
#define RID_MEDIA_TOOLBOX (RC_SHELLS_BEGIN + 61)
-#define SHELLS_ACT_END RID_MEDIA_TOOLBOX
+#define STR_SHELLNAME_NAVIGATION (RC_SHELLS_BEGIN + 62)
+
+#define SHELLS_ACT_END STR_SHELLNAME_NAVIGATION
#if SHELLS_ACT_END > RC_SHELLS_END
#error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/source/ui/inc/split.hxx b/sw/source/ui/inc/split.hxx
index 6d515acf22b5..5d9dd5aa2178 100644
--- a/sw/source/ui/inc/split.hxx
+++ b/sw/source/ui/inc/split.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,21 +30,13 @@
#include <svx/stddlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
class SwWrtShell;
@@ -74,3 +67,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/splittbl.hxx b/sw/source/ui/inc/splittbl.hxx
index 4bc4ec45f23b..7ce7c65e898e 100644
--- a/sw/source/ui/inc/splittbl.hxx
+++ b/sw/source/ui/inc/splittbl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/srcedtw.hxx b/sw/source/ui/inc/srcedtw.hxx
index 5b4aafddbcb8..9e9a74f900af 100644
--- a/sw/source/ui/inc/srcedtw.hxx
+++ b/sw/source/ui/inc/srcedtw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <unotools/options.hxx>
#include <vcl/timer.hxx>
-#ifndef _TABLE_HXX //autogen
#include <tools/table.hxx>
-#endif
#include <svtools/xtextedt.hxx>
class ScrollBar;
@@ -162,3 +161,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx
index e6574f5bfdce..faa770fc1ac5 100644
--- a/sw/source/ui/inc/srcview.hxx
+++ b/sw/source/ui/inc/srcview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,10 +39,6 @@ class SwDocShell;
class SvxSearchItem;
class SfxMedium;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SwSrcView: public SfxViewShell
{
SwSrcEditWindow aEditWin;
@@ -52,7 +49,7 @@ class SwSrcView: public SfxViewShell
rtl_TextEncoding eLoadEncoding;
void Init();
- // fuer Readonly-Umschaltung
+ // for read-only switching
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -101,26 +98,6 @@ public:
};
-
#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/srtdlg.hxx b/sw/source/ui/inc/srtdlg.hxx
index 25840e7ae2c0..3f17aff5d01a 100644
--- a/sw/source/ui/inc/srtdlg.hxx
+++ b/sw/source/ui/inc/srtdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,18 +28,10 @@
#ifndef _SRTDLG_HXX
#define _SRTDLG_HXX
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
-#ifndef _BUTTON_HXX
#include <vcl/button.hxx>
-#endif
-#ifndef _FIELD_HXX
#include <vcl/field.hxx>
-#endif
-#ifndef _LSTBOX_HXX
#include <vcl/lstbox.hxx>
-#endif
#include <svx/stddlg.hxx>
#include <svx/langbox.hxx>
@@ -116,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/stmenu.hxx b/sw/source/ui/inc/stmenu.hxx
index a761d60a12ed..f72de63e0c81 100644
--- a/sw/source/ui/inc/stmenu.hxx
+++ b/sw/source/ui/inc/stmenu.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,16 +31,12 @@
#ifndef _STMENU_HXX
#define _STMENU_HXX
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
#include <vector>
#include <com/sun/star/smarttags/XSmartTagAction.hpp>
-#ifndef _COM_SUN_STAR_SMARTTAGS_XSTRINGKEYMAP_HPP_
#include <com/sun/star/container/XStringKeyMap.hpp>
-#endif
#include <com/sun/star/text/XTextRange.hpp>
class SwView;
@@ -83,3 +80,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swcont.hxx b/sw/source/ui/inc/swcont.hxx
index 4c906ee8eacb..9ae0856ea8d5 100644
--- a/sw/source/ui/inc/swcont.hxx
+++ b/sw/source/ui/inc/swcont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
class SwContentType;
-//Reihenfolge und Anzahl mit ResIds abgleichen!!
+// synchronize order and number with ResIds!!
#define CONTENT_TYPE_OUTLINE 0
#define CONTENT_TYPE_TABLE 1
#define CONTENT_TYPE_FRAME 2
@@ -48,17 +49,17 @@ class SwContentType;
#define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1
-// Typen fuer das Globaldokument
+// types for global document
#define GLOBAL_CONTENT_REGION 100
#define GLOBAL_CONTENT_INDEX 101
#define GLOBAL_CONTENT_TEXT 102
#define GLOBAL_CONTENT_MAX 3
-// Strings fuer Kontextmenue
+// strings for context menus
#define CONTEXT_COUNT 12
#define GLOBAL_CONTEXT_COUNT 14
-// Modi fuer Drag 'n Drop
+// modes for Drag 'n Drop
#define REGION_MODE_NONE 0
#define REGION_MODE_LINK 1
#define REGION_MODE_EMBEDDED 2
@@ -93,12 +94,12 @@ public:
const String& GetName() const {return sContentName;}
int operator==(const SwContent& /*rCont*/) const
{
- //gleich sind sie nie, sonst fallen sie aus dem Array
+ // they're never equal, otherwise they'd fall out of the array
return sal_False;
}
int operator<(const SwContent& rCont) const
{
- //zuerst nach Position dann nach Name sortieren
+ // at first sort by position and then by name
return nYPosition != rCont.nYPosition ?
nYPosition < rCont.nYPosition :
sContentName < rCont.sContentName;;
@@ -111,3 +112,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 25a0871c9944..3caa280b522a 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ namespace nsTransferBufferType
const sal_uInt16 TRNSFR_DDELINK = 0x0010;
const sal_uInt16 TRNSFR_OLE = 0x0020;
const sal_uInt16 TRNSFR_INETFLD = 0x0040;
- const sal_uInt16 TRNSFR_DRAWING = 0x0081; //Drawing ist auch intern!
+ const sal_uInt16 TRNSFR_DRAWING = 0x0081; // drawing is internal too!
}
#define DATA_FLAVOR ::com::sun::star::datatransfer::DataFlavor
@@ -76,7 +77,7 @@ class SwTransferable : public TransferableHelper
const ViewShell *pCreatorView;
SwDocFac *pClpDocFac;
Graphic *pClpGraphic, *pClpBitmap, *pOrigGrf;
- INetBookmark *pBkmk; // URL und Beschreibung!
+ INetBookmark *pBkmk; // URL and description!
ImageMap *pImageMap;
INetImage *pTargetURL;
@@ -220,3 +221,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx
index 7bc40b394013..9788146dde63 100644
--- a/sw/source/ui/inc/swlbox.hxx
+++ b/sw/source/ui/inc/swlbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,9 @@
#include <svl/svarray.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
#include "swdllapi.h"
class SwBoxEntry;
@@ -44,9 +41,8 @@ class Window;
SV_DECL_PTRARR_DEL(SwEntryLst, SwBoxEntry*, 10, 10)
/*--------------------------------------------------------------------
- Beschreibung: SwBoxEntry
+ Description: SwBoxEntry
--------------------------------------------------------------------*/
-
class SW_DLLPUBLIC SwBoxEntry
{
friend class SwComboBox;
@@ -66,10 +62,10 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: fuer ComboBoxen
+ Description: for combo boxes
--------------------------------------------------------------------*/
-
typedef sal_uInt16 SwComboBoxStyle;
+
namespace nsSwComboBoxStyle
{
const SwComboBoxStyle CBS_UPPER = 0x01;
@@ -122,3 +118,5 @@ public:
};
#endif /* _SWLBOX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx
index 90bc788e3c54..2e983566c6f2 100644
--- a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx
+++ b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swrenamexnameddlg.hxx b/sw/source/ui/inc/swrenamexnameddlg.hxx
index d15c90935c85..de02fa8b06fc 100644
--- a/sw/source/ui/inc/swrenamexnameddlg.hxx
+++ b/sw/source/ui/inc/swrenamexnameddlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <actctrl.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
@@ -43,11 +42,6 @@
#include <tools/resary.hxx>
#include <swunodef.hxx>
-
-
-/* -----------------09.06.99 14:36-------------------
- *
- * --------------------------------------------------*/
class SwRenameXNamedDlg : public ModalDialog
{
FixedLine aNameFL;
@@ -85,3 +79,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swtablerep.hxx b/sw/source/ui/inc/swtablerep.hxx
index e874c78aa624..d0b341456cb0 100644
--- a/sw/source/ui/inc/swtablerep.hxx
+++ b/sw/source/ui/inc/swtablerep.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,3 +93,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swuiccoll.hxx b/sw/source/ui/inc/swuiccoll.hxx
index 1ed54fafe629..b665a068828e 100644
--- a/sw/source/ui/inc/swuiccoll.hxx
+++ b/sw/source/ui/inc/swuiccoll.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index a47bcb5a5e3a..a2ff8e8c0294 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,26 +30,17 @@
#include <svx/stddlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <sfx2/tabdlg.hxx>
#include "tox.hxx"
-#include <tools/list.hxx>
#include <toxmgr.hxx>
#include <svx/checklbx.hxx>
#include <tools/resary.hxx>
@@ -56,6 +48,8 @@
#include <vcl/menubtn.hxx>
#include <svx/langbox.hxx>
#include <cnttab.hxx>
+#include <vector>
+
class SwWrtShell;
class SwTOXMgr;
namespace com{namespace sun{namespace star{
@@ -65,15 +59,14 @@ namespace com{namespace sun{namespace star{
}
}}}
-//-----------------------------------------------------------------------------
struct SwIndexSections_Impl
{
com::sun::star::uno::Reference< com::sun::star::text::XTextSection > xContainerSection;
com::sun::star::uno::Reference< com::sun::star::text::XDocumentIndex > xDocumentIndex;
};
-//-----------------------------------------------------------------------------
class SwOneExampleFrame;
+
struct SwIndexSections_Impl;
class SwMultiTOXTabDialog : public SfxTabDialog
@@ -136,9 +129,7 @@ public:
static sal_Bool IsNoNum(SwWrtShell& rSh, const String& rName);
};
-/* -----------------14.07.99 12:17-------------------
- --------------------------------------------------*/
class IndexEntryRessource;
class IndexEntrySupplierWrapper;
@@ -160,7 +151,6 @@ class SwTOXSelectTabPage : public SfxTabPage
//content
FixedLine aCreateFromFL; // content, user, illustration
CheckBox aFromHeadingsCB;
-// PushButton aChapterDlgPB; //#outline level,removed by zhaojianwei
CheckBox aAddStylesCB;
PushButton aAddStylesPB;
Point aAddStylesPosDef;
@@ -233,7 +223,6 @@ class SwTOXSelectTabPage : public SfxTabPage
DECL_LINK(TOXTypeHdl, ListBox* );
DECL_LINK(TOXAreaHdl, ListBox* );
-// DECL_LINK(ChapterHdl, PushButton* ); //#outline level,removed by zhaojianwei
DECL_LINK(AddStylesHdl, PushButton* );
DECL_LINK(MenuEnableHdl, Menu*);
DECL_LINK(MenuExecuteHdl, Menu*);
@@ -265,11 +254,6 @@ public:
void SelectType(TOXTypes eSet); //preset TOXType, GlobalDoc
void SetWrtShell(SwWrtShell& rSh);
};
-/* -----------------16.06.99 08:33-------------------
-
- --------------------------------------------------*/
-
-DECLARE_LIST(TOXControlList, Control*)
class SwTOXEdit;
class SwTOXButton;
@@ -277,10 +261,15 @@ class SwTOXEntryTabPage;
class SwTokenWindow : public Window
{
+ typedef std::vector<Control*>::iterator ctrl_iterator;
+ typedef std::vector<Control*>::const_iterator ctrl_const_iterator;
+ typedef std::vector<Control*>::reverse_iterator ctrl_reverse_iterator;
+ typedef std::vector<Control*>::const_reverse_iterator ctrl_const_reverse_iterator;
+
ImageButton aLeftScrollWin;
Window aCtrlParentWin;
ImageButton aRightScrollWin;
- TOXControlList aControlList;
+ std::vector<Control*> aControlList;
SwForm* pForm;
sal_uInt16 nLevel;
sal_Bool bValid;
@@ -342,10 +331,9 @@ public:
virtual void Resize();
virtual void GetFocus();
};
-/* -----------------------------23.12.99 14:16--------------------------------
- ---------------------------------------------------------------------------*/
class SwTOXEntryTabPage;
+
class SwIdxTreeListBox : public SvTreeListBox
{
SwTOXEntryTabPage* pParent;
@@ -355,9 +343,6 @@ public:
SwIdxTreeListBox(SwTOXEntryTabPage* pPar, const ResId& rResId);
};
-/* -----------------16.06.99 12:49-------------------
-
- --------------------------------------------------*/
class SwTOXEntryTabPage : public SfxTabPage
{
FixedText aLevelFT;
@@ -487,9 +472,7 @@ public:
void PreTokenButtonRemoved(const SwFormToken& rToken);
};
-/* -----------------05.07.99 13:00-------------------
- --------------------------------------------------*/
class SwTOXStylesTabPage : public SfxTabPage
{
FixedLine aFormatFL;
@@ -502,7 +485,6 @@ class SwTOXStylesTabPage : public SfxTabPage
PushButton aEditStyleBT;
SwForm* m_pCurrentForm;
-// void UpdatePattern();
DECL_LINK( EditStyleHdl, Button *);
DECL_LINK( StdHdl, Button * );
@@ -537,3 +519,4 @@ public:
#endif // _SWUI_CNTTAB_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx
index ad3adcce78ca..5a673c5c304d 100644
--- a/sw/source/ui/inc/swuiidxmrk.hxx
+++ b/sw/source/ui/inc/swuiidxmrk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,30 +31,18 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <sfx2/basedlgs.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <vcl/lstbox.hxx>
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
#include <svx/stddlg.hxx>
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <sfx2/childwin.hxx>
#include "toxe.hxx"
#include <svtools/stdctrl.hxx>
@@ -63,10 +52,11 @@ class SwWrtShell;
class SwTOXMgr;
class SwTOXMark;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert mark for index entry
--------------------------------------------------------------------*/
class SwIndexMarkFloatDlg;
class SwIndexMarkModalDlg;
+
class SwIndexMarkDlg : public Window
{
friend class SwIndexMarkFloatDlg;
@@ -173,9 +163,7 @@ public:
sal_Bool IsTOXType(const String& rName)
{return LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos(rName);}
};
-/* -----------------06.10.99 10:11-------------------
- --------------------------------------------------*/
class SwIndexMarkFloatDlg : public SfxModelessDialog
{
SwIndexMarkDlg aDlg;
@@ -188,9 +176,7 @@ class SwIndexMarkFloatDlg : public SfxModelessDialog
sal_Bool bNew=sal_True);
void ReInitDlg(SwWrtShell& rWrtShell);
};
-/* -----------------06.10.99 10:33-------------------
- --------------------------------------------------*/
class SwIndexMarkModalDlg : public SvxStandardDialog
{
SwIndexMarkDlg aDlg;
@@ -201,10 +187,8 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-/* -----------------15.09.99 08:39-------------------
-
- --------------------------------------------------*/
class SwAuthMarkModalDlg;
+
class SwAuthMarkDlg : public Window
{
static sal_Bool bIsFromComponent;
@@ -262,9 +246,7 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-/* -----------------06.10.99 10:11-------------------
- --------------------------------------------------*/
class SwAuthMarkFloatDlg : public SfxModelessDialog
{
SwAuthMarkDlg aDlg;
@@ -277,9 +259,7 @@ class SwAuthMarkFloatDlg : public SfxModelessDialog
sal_Bool bNew=sal_True);
void ReInitDlg(SwWrtShell& rWrtShell);
};
-/* -----------------06.10.99 10:33-------------------
- --------------------------------------------------*/
class SwAuthMarkModalDlg : public SvxStandardDialog
{
SwAuthMarkDlg aDlg;
@@ -290,6 +270,6 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-
#endif // _SWUI_IDXMRK_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swuipardlg.hxx b/sw/source/ui/inc/swuipardlg.hxx
index 74f798d7d6ca..62ea87544fd5 100644
--- a/sw/source/ui/inc/swuipardlg.hxx
+++ b/sw/source/ui/inc/swuipardlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swvset.hxx b/sw/source/ui/inc/swvset.hxx
index 4e6b2a46f856..d8253b3c3b52 100644
--- a/sw/source/ui/inc/swvset.hxx
+++ b/sw/source/ui/inc/swvset.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +27,6 @@
************************************************************************/
#ifndef _SWVSET_HXX
#define _SWVSET_HXX
-#include <tools/list.hxx>
#include <svx/numvset.hxx>
class SwRulerValueSet : public SvxBmpNumValueSet
@@ -39,3 +39,4 @@ class SwRulerValueSet : public SvxBmpNumValueSet
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/swwrtshitem.hxx b/sw/source/ui/inc/swwrtshitem.hxx
index 661cedfc2502..f8e272702e45 100644
--- a/sw/source/ui/inc/swwrtshitem.hxx
+++ b/sw/source/ui/inc/swwrtshitem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/syncbtn.hxx b/sw/source/ui/inc/syncbtn.hxx
index 5022881a4854..c176dc13cb6d 100644
--- a/sw/source/ui/inc/syncbtn.hxx
+++ b/sw/source/ui/inc/syncbtn.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,13 +32,7 @@
#ifdef _SYNCDLG
#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
class SwSyncBtnDlg : public SfxFloatingWindow
{
@@ -51,10 +46,6 @@ public:
};
#endif
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
class SwSyncChildWin : public SfxChildWindow
{
public:
@@ -69,3 +60,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tabledlg.hxx b/sw/source/ui/inc/tabledlg.hxx
index 9f1553a2ccd0..677ab6c951f2 100644
--- a/sw/source/ui/inc/tabledlg.hxx
+++ b/sw/source/ui/inc/tabledlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@ class SwTabCols;
struct TColumn;
/*-------------------------------------------------------
- Tabellendialog
+ table dialog
--------------------------------------------------------- */
class SwTableTabDlg : public SfxTabDialog
{
@@ -53,3 +54,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tablemgr.hxx b/sw/source/ui/inc/tablemgr.hxx
index 844f76833cbc..b8035c681327 100644
--- a/sw/source/ui/inc/tablemgr.hxx
+++ b/sw/source/ui/inc/tablemgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ inline SwTableFUNC::SwTableFUNC(SwFrmFmt &rFmt) :
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tabsh.hxx b/sw/source/ui/inc/tabsh.hxx
index a1e5c37dcc27..49c8a06558a7 100644
--- a/sw/source/ui/inc/tabsh.hxx
+++ b/sw/source/ui/inc/tabsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@ class SwWrtShell;
SW_DLLPUBLIC void ItemSetToTableParam( const SfxItemSet& rSet, SwWrtShell &rSh );
-extern const sal_uInt16 __FAR_DATA aUITableAttrRange[];
+extern const sal_uInt16 aUITableAttrRange[];
SW_DLLPUBLIC const sal_uInt16* SwuiGetUITableAttrRange();
class SwTableShell: public SwBaseShell
@@ -56,3 +57,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tautofmt.hxx b/sw/source/ui/inc/tautofmt.hxx
index bf581291c12e..5ba02135aa62 100644
--- a/sw/source/ui/inc/tautofmt.hxx
+++ b/sw/source/ui/inc/tautofmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,25 +29,15 @@
#define SW_TAUTOFMT_HXX
#include <sfx2/basedlgs.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _VIRDEV_HXX //autogen
#include <vcl/virdev.hxx>
-#endif
class SwTableAutoFmt;
class AutoFmtPreview;
@@ -116,3 +107,4 @@ public:
#endif // SW_AUTOFMT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tblctrl.hxx b/sw/source/ui/inc/tblctrl.hxx
index d96b85f21208..4616174ac0f3 100644
--- a/sw/source/ui/inc/tblctrl.hxx
+++ b/sw/source/ui/inc/tblctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tblnumfm.hxx b/sw/source/ui/inc/tblnumfm.hxx
index b6118f3943fe..ca93e3a0ec07 100644
--- a/sw/source/ui/inc/tblnumfm.hxx
+++ b/sw/source/ui/inc/tblnumfm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tbxanchr.hxx b/sw/source/ui/inc/tbxanchr.hxx
index 9edc1e22fbe2..c27dbcc88b14 100644
--- a/sw/source/ui/inc/tbxanchr.hxx
+++ b/sw/source/ui/inc/tbxanchr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/textcontrolcombo.hxx b/sw/source/ui/inc/textcontrolcombo.hxx
index 08209cd70403..d730a4d701b6 100644
--- a/sw/source/ui/inc/textcontrolcombo.hxx
+++ b/sw/source/ui/inc/textcontrolcombo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef _TEXTCONTROLCOMBO_HXX
#define _TEXTCONTROLCOMBO_HXX
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
#include <vcl/field.hxx>
#include "swdllapi.h"
@@ -64,3 +63,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/textsh.hxx b/sw/source/ui/inc/textsh.hxx
index 5e3358c2b20a..31a545ae65d6 100644
--- a/sw/source/ui/inc/textsh.hxx
+++ b/sw/source/ui/inc/textsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#define _SWTEXTSH_HXX
#include <basesh.hxx>
+#include <unotools/caserotate.hxx>
class AbstractSvxPostItDialog;
class SwFldMgr;
@@ -37,6 +39,7 @@ class SvxHyperlinkItem;
class SwTextShell: public SwBaseShell
{
SwFldMgr* pPostItFldMgr;
+ RotateTransliteration m_aRotateCase;
void InsertSymbol( SfxRequest& );
void InsertHyperlink(const SvxHyperlinkItem& rHlnkItem);
@@ -47,10 +50,6 @@ public:
SFX_DECL_INTERFACE(SW_TEXTSHELL)
TYPEINFO();
-//CHINA001 DECL_LINK( PostItNextHdl, Button * );
-//CHINA001 DECL_LINK( PostItPrevHdl, Button * );
-//CHINA001 DECL_LINK( RedlineNextHdl, Button * );
-//CHINA001 DECL_LINK( RedlinePrevHdl, Button * );
DECL_LINK( RedlineNextHdl, AbstractSvxPostItDialog * );
DECL_LINK( RedlinePrevHdl, AbstractSvxPostItDialog * );
@@ -80,6 +79,7 @@ public:
void ExecAttr(SfxRequest &);
void ExecDB(SfxRequest &);
void ExecTransliteration(SfxRequest &);
+ void ExecRotateTransliteration(SfxRequest &);
void GetAttrState(SfxItemSet &);
@@ -88,3 +88,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/titlepage.hxx b/sw/source/ui/inc/titlepage.hxx
new file mode 100644
index 000000000000..5f102e008201
--- /dev/null
+++ b/sw/source/ui/inc/titlepage.hxx
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _SWTITLEPAGE_HXX
+#define _SWTITLEPAGE_HXX
+
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/tabdlg.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <numberingtypelistbox.hxx>
+
+class Window;
+class SfxItemSet;
+class SwView;
+class SwWrtShell;
+class SwPageDesc;
+
+class SwTitlePageDlg : public SfxModalDialog
+{
+private:
+ FixedLine aMakeInsertFL;
+ RadioButton aUseExistingPagesRB;
+ RadioButton aInsertNewPagesRB;
+ FixedText aPageCountFT;
+ NumericField aPageCountNF;
+ FixedText aPagePagesFT;
+
+ FixedText aPageStartFT;
+ RadioButton aDocumentStartRB;
+ RadioButton aPageStartRB;
+ NumericField aPageStartNF;
+
+ FixedLine aNumberingFL;
+ CheckBox aRestartNumberingCB;
+ FixedText aRestartNumberingFT;
+ NumericField aRestartNumberingNF;
+ CheckBox aSetPageNumberCB;
+ FixedText aSetPageNumberFT;
+ NumericField aSetPageNumberNF;
+
+ FixedLine aPagePropertiesFL;
+ ListBox aPagePropertiesLB;
+ PushButton aPagePropertiesPB;
+
+ FixedLine aBottomFL;
+ OKButton aOkPB;
+ CancelButton aCancelPB;
+ HelpButton aHelpPB;
+
+ SwWrtShell *mpSh;
+
+ const SwFmtPageDesc *mpPageFmtDesc;
+
+ SwPageDesc *mpTitleDesc;
+ const SwPageDesc *mpIndexDesc;
+ const SwPageDesc *mpNormalDesc;
+
+ void FillList();
+
+ sal_uInt16 GetInsertPosition() const;
+
+ DECL_LINK( OKHdl, Button * );
+ DECL_LINK( EditHdl, Button * );
+ DECL_LINK( RestartNumberingHdl, CheckBox* );
+ DECL_LINK( SetPageNumberHdl, CheckBox* );
+ DECL_LINK( UpHdl, NumericField * );
+ DECL_LINK( DownHdl, NumericField * );
+ DECL_LINK( StartPageHdl, RadioButton * );
+public:
+ SwTitlePageDlg( Window *pParent );
+ ~SwTitlePageDlg();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tmpdlg.hxx b/sw/source/ui/inc/tmpdlg.hxx
index f3feddfc89ed..966ec13be1e5 100644
--- a/sw/source/ui/inc/tmpdlg.hxx
+++ b/sw/source/ui/inc/tmpdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,8 @@ class SfxItemSet;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Der Tabdialog Traeger der TabPages
+ Description: the tab dialog carrier of TabPages
--------------------------------------------------------------------*/
-
class SwTemplateDlg: public SfxStyleDialog
{
@@ -45,6 +45,7 @@ class SwTemplateDlg: public SfxStyleDialog
sal_Bool bNewStyle;
DECL_LINK( NumOptionsHdl, PushButton* );
+ DECL_LINK( ApplyHdl, void* );
public:
SwTemplateDlg( Window* pParent,
@@ -61,6 +62,6 @@ public:
virtual short Ok();
};
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/tmplctrl.hxx b/sw/source/ui/inc/tmplctrl.hxx
index 1c684d6c599a..f0579d0ec96c 100644
--- a/sw/source/ui/inc/tmplctrl.hxx
+++ b/sw/source/ui/inc/tmplctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,10 @@
#define _TMPLCTRL_HXX
// include ---------------------------------------------------------------
-
#include <sfx2/stbitem.hxx>
#include <tools/string.hxx>
-
// class BookmarkToolBoxControl -------------------------------------------
-
class SwTemplateControl : public SfxStatusBarControl
{
protected:
@@ -53,6 +51,6 @@ private:
String sTemplate;
};
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/toxmgr.hxx b/sw/source/ui/inc/toxmgr.hxx
index a1cc17d4c470..87eb6100a21f 100644
--- a/sw/source/ui/inc/toxmgr.hxx
+++ b/sw/source/ui/inc/toxmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,10 +37,9 @@ class SwWrtShell;
class SwForm;
/*--------------------------------------------------------------------
- Beschreibung: Manager fuer Verzeichnisfunktionalitaet
+ Description: manager for directory functionality
--------------------------------------------------------------------*/
//one single method will be sufficient to insert AND upate indexes
-
class SW_DLLPUBLIC SwTOXDescription
{
TOXTypes eTOXType;
@@ -183,7 +183,7 @@ public:
void ApplyTo(SwTOXBase& rTOXBase);
};
-// --------------------------------------------------------------------------------
+
class SwTOXMarkDescription
{
TOXTypes eTOXType;
@@ -281,7 +281,7 @@ public:
explicit SwTOXMgr(SwWrtShell* pShell);
//
- // Methoden fuer Verzeichnismarkierungen
+ // methods for directory marks
//
void InsertTOXMark(const SwTOXMarkDescription& rDesc);
@@ -292,7 +292,7 @@ public:
void NextTOXMark(sal_Bool bSame=sal_False);
void PrevTOXMark(sal_Bool bSame=sal_False);
- // Aktuelle TOXmarks holen
+ // get current TOXmarks
sal_uInt16 GetTOXMarks();
sal_uInt16 GetTOXMarkCount();
SwTOXMark* GetTOXMark(sal_uInt16 nId);
@@ -300,7 +300,7 @@ public:
void SetCurTOXMark(sal_uInt16 nId);
//
- // Methoden fuer Verzeichnisse
+ // methods for directories
//
sal_Bool UpdateOrInsertTOX(const SwTOXDescription& rDesc, SwTOXBase** ppBase = 0, const SfxItemSet* pSet = 0);
@@ -309,16 +309,15 @@ public:
};
-
/*--------------------------------------------------------------------
- Beschreibung: Inlines
+ Description: inlines
--------------------------------------------------------------------*/
-
inline sal_uInt16 SwTOXMgr::GetTOXMarkCount()
{ return aCurMarks.Count(); }
-
inline SwTOXMark* SwTOXMgr::GetCurTOXMark()
{ return pCurTOXMark; }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/uiborder.hxx b/sw/source/ui/inc/uiborder.hxx
index 573bef720d49..b734427f0124 100644
--- a/sw/source/ui/inc/uiborder.hxx
+++ b/sw/source/ui/inc/uiborder.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/uiitems.hxx b/sw/source/ui/inc/uiitems.hxx
index 55155e35fe59..d575593053e6 100644
--- a/sw/source/ui/inc/uiitems.hxx
+++ b/sw/source/ui/inc/uiitems.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@ class SwNumRule;
class IntlWrapper;
/*--------------------------------------------------------------------
- Beschreibung: Container fuer FootNote
+ Description: container for FootNote
--------------------------------------------------------------------*/
class SW_DLLPUBLIC SwPageFtnInfoItem : public SfxPoolItem
{
@@ -56,16 +57,14 @@ public:
String &rText,
const IntlWrapper* pIntl = 0 ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
SwPageFtnInfo& GetPageFtnInfo() { return aFtnInfo; }
const SwPageFtnInfo& GetPageFtnInfo() const { return aFtnInfo; }
void SetPageFtnInfo(SwPageFtnInfo& rInf) { aFtnInfo = rInf; }
};
-/*******************************************************************/
-
class SW_DLLPUBLIC SwPtrItem : public SfxPoolItem
{
void* pMisc;
@@ -81,8 +80,6 @@ public:
void* GetValue() const { return pMisc; }
};
-/*******************************************************************/
-
class SW_DLLPUBLIC SwUINumRuleItem : public SfxPoolItem
{
SwNumRule* pRule;
@@ -95,16 +92,13 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual int operator==( const SfxPoolItem& ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
const SwNumRule* GetNumRule() const { return pRule; }
SwNumRule* GetNumRule() { return pRule; }
};
-/* -----------------17.06.98 17:40-------------------
- *
- * --------------------------------------------------*/
class SwBackgroundDestinationItem : public SfxUInt16Item
{
public:
@@ -114,3 +108,5 @@ public:
};
#endif // _UIITEMS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx
index 1fe7e6e5f82e..5f2f87009da6 100644
--- a/sw/source/ui/inc/uinums.hxx
+++ b/sw/source/ui/inc/uinums.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,12 +41,11 @@ class SvStream;
typedef SfxPoolItem* SfxPoolItemPtr;
SV_DECL_PTRARR_DEL( _SwNumFmtsAttrs, SfxPoolItemPtr, 5,0 )
-//------------------------------------------------------------------------
class SW_DLLPUBLIC SwNumRulesWithName
{
String aName;
- // die Formate der NumRule muessen! unabhaengig von einem Document sein
- // (Sie sollen immer vorhanden sein!)
+ // the NumRule's formats _have_ to be independent of a document
+ // (They should always be there!)
class SW_DLLPRIVATE _SwNumFmtGlobal
{
SwNumFmt aFmt;
@@ -83,13 +83,11 @@ public:
void Store( SvStream& );
};
-/********************************************************************
-********************************************************************/
class SwBaseNumRules
{
public:
- enum { nMaxRules = MAX_NUM_RULES }; // zur Zeit 9 definierte Forms
+ enum { nMaxRules = MAX_NUM_RULES }; // currently 9 defined forms
protected:
SwNumRulesWithName *pNumRules[ MAX_NUM_RULES ];
String sFileName;
@@ -112,9 +110,6 @@ public:
};
-/********************************************************************
-
-********************************************************************/
class SwChapterNumRules : public SwBaseNumRules
{
@@ -129,8 +124,10 @@ public:
// INLINE METHODE --------------------------------------------------------
inline const SwNumRulesWithName *SwBaseNumRules::GetRules(sal_uInt16 nIdx) const
{
- ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.);
+ OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert.");
return pNumRules[nIdx];
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index 07d9054438c7..e5199bf5bbf2 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,34 +46,37 @@ class SwTabCols;
class DateTime;
class SfxViewFrame;
-// Umschalten einer Metric
+// switch a metric
SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
-// BoxInfoAttribut fuellen
+// fill BoxInfoAttribut
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
// SfxItemSets <-> PageDesc
void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
-// Auffuellen der Tabs mit DefaultTabs
+// fill tabs with default tabs
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
-// DefaultTabs loeschen aus dem TabStopArray
+// erase DefaultTabs from TabStopArray
//void EraseDefTabs(SvxTabStopItem& rTabs);
-// Abstand zwischen dem 1. und zweitem Element ermitteln
+// determine space between 1st and 2nd element
SW_DLLPUBLIC sal_uInt16 GetTabDist(const SvxTabStopItem& rTabs);
-// erfrage ob im Set eine Sfx-PageDesc-Kombination vorliegt
-// und setze diesen im Set und loesche die Transport Items
-// (PageBreak & PageModel) aus dem Set
+// determine whether a Sfx-PageDesc combination exists in the set
+// and set this in the set and delete the transport items
+// (PageBreak & PageModel) from the set
void SwToSfxPageDescAttr( SfxItemSet& rSet );
void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
SW_DLLPUBLIC FieldUnit GetDfltMetric(sal_Bool bWeb);
void SetDfltMetric(FieldUnit eMetric, sal_Bool bWeb);
+SW_DLLPUBLIC sal_Bool HasCharUnit( sal_Bool bWeb );
+void SetApplyCharUnit(sal_Bool bApplyChar, sal_Bool bWeb);
+
// ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False);
@@ -90,3 +94,5 @@ String GetAppLangDateTimeString( const DateTime& );
bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
#endif // _UITOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/uivwimp.hxx b/sw/source/ui/inc/uivwimp.hxx
index 1e68678cdb72..4c349a047c67 100644
--- a/sw/source/ui/inc/uivwimp.hxx
+++ b/sw/source/ui/inc/uivwimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,9 +53,6 @@ namespace com{ namespace sun{ namespace star {
}
}}}
-/* -----------------------------29.05.00 08:22--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwScannerEventListener : public ::cppu::WeakImplHelper1<
STAR_NMSPC::lang::XEventListener >
{
@@ -73,7 +71,6 @@ public:
};
// --------------------------- Clipboard EventListener ------------------
-
class SwClipboardChangeListener : public ::cppu::WeakImplHelper1<
CLIP_NMSPC::XClipboardListener >
{
@@ -96,11 +93,8 @@ public:
void AddRemoveListener( sal_Bool bAdd );
};
-
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
class SwMailMergeConfigItem;
+
class SwView_Impl
{
STAR_REFERENCE( lang::XEventListener ) xScanEvtLstnr;
@@ -186,3 +180,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx
index 884d647725e5..039769abda5f 100644
--- a/sw/source/ui/inc/unodispatch.hxx
+++ b/sw/source/ui/inc/unodispatch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,13 +36,10 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
#include <list>
-//#ifndef _OSL_MUTEX_HXX_
-//#include <osl/mutex.hxx>
-//#endif
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
class SwView;
-//---------------------------------------------------------------------------------------------------------------------
+
class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3
<
::com::sun::star::frame::XDispatchProviderInterceptor,
@@ -52,7 +50,7 @@ class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3
class DispatchMutexLock_Impl
{
//::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
- vos::OGuard aGuard;
+ osl::SolarGuard aGuard;
DispatchMutexLock_Impl();
public:
DispatchMutexLock_Impl(SwXDispatchProviderInterceptor&);
@@ -132,3 +130,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx
index 4a94628a03ad..aa710f182a6f 100644
--- a/sw/source/ui/inc/unotools.hxx
+++ b/sw/source/ui/inc/unotools.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <actctrl.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
@@ -44,10 +43,8 @@
#include <swunodef.hxx>
#include "swdllapi.h"
-/* -----------------------------15.12.99 09:55--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwOneExampleFrame;
+
class SwFrmCtrlWindow : public Window
{
SwOneExampleFrame* pExampleFrame;
@@ -56,9 +53,7 @@ public:
virtual void Command( const CommandEvent& rCEvt );
};
-/* -----------------------------15.12.99 12:56--------------------------------
- ---------------------------------------------------------------------------*/
class MenuResource : public Resource
{
ResStringArray aMenuArray;
@@ -68,9 +63,7 @@ public:
ResStringArray& GetMenuArray() {return aMenuArray;}
};
-/* -----------------27.07.99 15:20-------------------
- --------------------------------------------------*/
#define EX_SHOW_ONLINE_LAYOUT 0x001
// hard zoom value
@@ -79,6 +72,7 @@ public:
#define EX_SHOW_DEFAULT_PAGE 0x04
class SwView;
+
class SW_DLLPUBLIC SwOneExampleFrame
{
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > _xControl;
@@ -133,3 +127,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx
index 8a0d2b2662af..0e11b99e946a 100644
--- a/sw/source/ui/inc/unotxvw.hxx
+++ b/sw/source/ui/inc/unotxvw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,9 +58,6 @@ class SwView;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener > * XSelectionChangeListenerPtr;
SV_DECL_PTRARR_DEL( SelectionChangeListenerArr, XSelectionChangeListenerPtr, 4, 4 )
-/******************************************************************************
- *
- ******************************************************************************/
class SwXTextView :
public ::com::sun::star::view::XSelectionSupplier,
public ::com::sun::star::lang::XServiceInfo,
@@ -159,10 +157,6 @@ public:
SfxObjectShellLock BuildTmpSelectionDoc();
};
-/* -----------------17.09.98 12:52-------------------
- *
- * --------------------------------------------------*/
-
typedef cppu::WeakImplHelper8<
::com::sun::star::text::XTextViewCursor,
::com::sun::star::lang::XServiceInfo,
@@ -269,6 +263,7 @@ public:
virtual const SwDoc* GetDoc() const;
virtual SwDoc* GetDoc();
};
-#endif
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx
index d9abd8193c2b..fbf1971fe959 100644
--- a/sw/source/ui/inc/usrpref.hxx
+++ b/sw/source/ui/inc/usrpref.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,8 @@
#include "viewopt.hxx"
#include <tools/fldunit.hxx>
-/* -----------------------------28.09.00 09:45--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwMasterUsrPref;
+
class SwContentViewConfig : public utl::ConfigItem
{
SwMasterUsrPref& rParent;
@@ -55,9 +54,7 @@ class SwContentViewConfig : public utl::ConfigItem
void Load();
void SetModified(){ConfigItem::SetModified();}
};
-/* -----------------------------28.09.00 09:45--------------------------------
- ---------------------------------------------------------------------------*/
class SwLayoutViewConfig : public utl::ConfigItem
{
SwMasterUsrPref& rParent;
@@ -73,9 +70,7 @@ class SwLayoutViewConfig : public utl::ConfigItem
void Load();
void SetModified(){ConfigItem::SetModified();}
};
-/* -----------------------------19.01.01 13:06--------------------------------
- ---------------------------------------------------------------------------*/
class SwGridConfig : public utl::ConfigItem
{
SwMasterUsrPref& rParent;
@@ -91,9 +86,7 @@ class SwGridConfig : public utl::ConfigItem
void Load();
void SetModified(){ConfigItem::SetModified();}
};
-/* -----------------------------19.01.01 13:06--------------------------------
- ---------------------------------------------------------------------------*/
class SwCursorConfig : public utl::ConfigItem
{
SwMasterUsrPref& rParent;
@@ -108,9 +101,7 @@ class SwCursorConfig : public utl::ConfigItem
void Load();
void SetModified(){ConfigItem::SetModified();}
};
-/* -----------------------------28.09.00 09:45--------------------------------
- ---------------------------------------------------------------------------*/
class SwWebColorConfig : public utl::ConfigItem
{
SwMasterUsrPref& rParent;
@@ -125,9 +116,7 @@ class SwWebColorConfig : public utl::ConfigItem
void Load();
void SetModified(){ConfigItem::SetModified();}
};
-/* -----------------------------28.09.00 09:45--------------------------------
- ---------------------------------------------------------------------------*/
class SwMasterUsrPref : public SwViewOption
{
friend class SwContentViewConfig;
@@ -155,6 +144,7 @@ class SwMasterUsrPref : public SwViewOption
SwCursorConfig aCursorConfig;
SwWebColorConfig* pWebColorConfig;
+ sal_Bool bApplyCharUnit; // apply_char_unit
public:
SwMasterUsrPref(sal_Bool bWeb);
~SwMasterUsrPref();
@@ -256,6 +246,17 @@ public:
aLayoutConfig.SetModified();
}
+ sal_Bool IsApplyCharUnit() const
+ {
+ return bApplyCharUnit;
+ }
+ void SetApplyCharUnit(sal_Bool bSet, sal_Bool bNoModify = sal_False)
+ {
+ bApplyCharUnit = bSet;
+ if(!bNoModify)
+ aLayoutConfig.SetModified();
+ }
+
sal_Int32 GetDefTab() const { return nDefTab;}
void SetDefTab( sal_Int32 nSet, sal_Bool bNoModify = sal_False )
{
@@ -284,3 +285,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/utlui.hrc b/sw/source/ui/inc/utlui.hrc
index aa7dab24054a..517ac26514a9 100644
--- a/sw/source/ui/inc/utlui.hrc
+++ b/sw/source/ui/inc/utlui.hrc
@@ -42,7 +42,7 @@
#define STR_HYPERCTRL_SEL (RC_UTLUI_BEGIN + 5)
#define STR_HYPERCTRL_HYP (RC_UTLUI_BEGIN + 6)
-// Namene der Inhaltstypen (RC_UTLUI_BEGIN + 7)
+// names of content types (RC_UTLUI_BEGIN + 7)
#define STR_CONTENT_TYPE_FIRST (RC_UTLUI_BEGIN + 8)
#define STR_CONTENT_TYPE_OUTLINE STR_CONTENT_TYPE_FIRST
#define STR_CONTENT_TYPE_TABLE (RC_UTLUI_BEGIN + 9)
@@ -154,15 +154,7 @@
#define DLG_GLOSSARY_DECIDE_DLG (RC_UTLUI_BEGIN + 3)
#define IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4)
-#define IMG_NAVI_ENTRYBMPH (RC_UTLUI_BEGIN + 5)
#define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6)
-#define ILIST_DB_DLG_HC (RC_UTLUI_BEGIN + 7)
-
-#define IMG_ONE_LEFT_HC (RC_UTLUI_BEGIN + 8)
-#define IMG_ONE_RIGHT_HC (RC_UTLUI_BEGIN + 9)
-#define IMG_ALL_LEFT_HC (RC_UTLUI_BEGIN + 10)
-#define IMG_ALL_RIGHT_HC (RC_UTLUI_BEGIN + 11)
-
#define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12)
#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13)
@@ -170,12 +162,6 @@
#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15)
#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
-#define IMG_VIEWLAYOUT_AUTOMATIC_HC (RC_UTLUI_BEGIN + 18)
-#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC (RC_UTLUI_BEGIN + 19)
-#define IMG_VIEWLAYOUT_BOOKMODE_HC (RC_UTLUI_BEGIN + 20)
-#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC (RC_UTLUI_BEGIN + 21)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN_HC (RC_UTLUI_BEGIN + 22)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC (RC_UTLUI_BEGIN + 23)
//local ids of the Database ImageLists
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 61d4d4b8702c..3fa31bb69d44 100755
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include <vcl/timer.hxx>
#include <vcl/field.hxx>
+#include <vcl/floatwin.hxx>
#include <svtools/htmlcfg.hxx>
#include <sfx2/viewfac.hxx>
#include <sfx2/viewsh.hxx>
@@ -127,13 +129,13 @@ enum ShellModes
SHELL_MODE_MEDIA,
SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
SHELL_MODE_FONTWORK,
- SHELL_MODE_POSTIT
+ SHELL_MODE_POSTIT,
+ SHELL_MODE_NAVIGATION
};
/*--------------------------------------------------------------------
- Beschreibung: Anwendung einer Vorlage
+ Description: apply a template
--------------------------------------------------------------------*/
-
struct SwApplyTemplate
{
union
@@ -160,14 +162,12 @@ struct SwApplyTemplate
}
};
-
/*--------------------------------------------------------------------
- Beschreibung: Sicht auf ein Dokument
+ Description: view of a document
--------------------------------------------------------------------*/
-
class SW_DLLPUBLIC SwView: public SfxViewShell
{
- //Messehack (MA,MBA)
+ // exhibition hack (MA,MBA)
friend void lcl_SelectShellForDrop( SwView &rView );
friend class TestTemplateItem;
@@ -176,7 +176,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
friend class SwView_Impl;
friend class SwClipboardChangeListener;
- //suchen & ersetzen
+ // search & replace
static SvxSearchDialog *pSrchDlg;
static SvxSearchItem *pSrchItem;
@@ -184,8 +184,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
static sal_uInt16 nWebInsertCtrlState;
static sal_uInt16 nInsertObjectCtrlState;
static sal_uInt16 nInsertFieldCtrlState;
- static sal_uInt16 nMoveType; // fuer Buttons unter dem Scrollbar (viewmdi)
- static sal_Int32 nActMark; // aktuelle Sprungmarke fuer unbenannte Merker
+ static sal_uInt16 nMoveType; // for buttons below the scrollbar (viewmdi)
+ static sal_Int32 nActMark; // current jump mark for unknown mark
static sal_Bool bExtra;
static sal_Bool bFound;
@@ -196,37 +196,34 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SvxHtmlOptions aHTMLOpt;
- Timer aTimer; //Fuer verzoegerte ChgLnks waehrend
- //einer Aktion
- String aPageStr; //Statusanzeige, aktuelle Seite
+ Timer aTimer; // for delayed ChgLnks during an action
+ String aPageStr; // status view, current page
String sSwViewData,
//and the new cursor position if the user double click in the PagePreView
sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too
sal_uInt16 nNewPage;
- Point aTabColFromDocPos; //Verschieben von Tabellenspalten aus
- //aus dem Dokument heraus.
+ Point aTabColFromDocPos; // moving table colmns out of the document
SwTxtNode * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
- Size aDocSz; // aktuelle Dokumentgroesse
- Rectangle aVisArea; // sichtbarer Bereich
+ Size aDocSz; // current document size
+ Rectangle aVisArea; // visible region
SwEditWin *pEditWin;
SwWrtShell *pWrtShell;
- SfxShell *pShell; //aktuelle SubShell auf dem Dispatcher
+ SfxShell *pShell; // current SubShell at the dispatcher
FmFormShell *pFormShell; // DB-FormShell
- SwView_Impl *pViewImpl; // Impl-Daten fuer UNO + Basic
+ SwView_Impl *pViewImpl; // Impl-data for UNO + Basic
- SwScrollbar *pHScrollbar, // MDI Bedienelemente
+ SwScrollbar *pHScrollbar, // MDI control elements
*pVScrollbar;
- Window *pScrollFill; // Dummy-Window zum Fuellen der rechten
- // unteren Ecke, wenn beide Scrollbars
- // aktiv sind
+ Window *pScrollFill; // dummy window for filling the lower right edge
+ // when both scrollbars are active
SvxRuler *pHRuler,
*pVRuler;
@@ -236,7 +233,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
*pPageDownBtn;
SwNaviImageButton *pNaviBtn;
- SwGlossaryHdl *pGlosHdl; // Henkel Textbausteine
+ SwGlossaryHdl *pGlosHdl; // handle text block
SwDrawBase *pDrawActual;
const SwFrmFmt *pLastTableFormat;
@@ -246,6 +243,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SwPostItMgr *mpPostItMgr;
int nSelectionType;
+ FloatingWindow *mpFieldPopup;
static const int MASTERENUMCOMMANDS = 6;
@@ -253,7 +251,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
sal_uInt16 nPageCnt;
- // Aktueller Drawmode
+ // current draw mode
sal_uInt16 nDrawSfxId;
String sDrawCustom; //some drawing types are marked with strings!
sal_uInt16 nFormSfxId;
@@ -285,11 +283,11 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
bOldShellWasPagePreView : 1,
bIsPreviewDoubleClick : 1, // #i114045#
- bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
+ bMakeSelectionVisible : 1 // transport the bookmark selection
;
- // Methoden fuers Suchen
- // Suchkontext setzen
+ // methods for searching
+ // set search context
SW_DLLPRIVATE sal_Bool SearchAndWrap(sal_Bool bApi = sal_False);
SW_DLLPRIVATE sal_Bool SearchAll(sal_uInt16* pFound = 0);
SW_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
@@ -299,7 +297,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE sal_Bool IsTextTool() const;
- // Bedienelemente verwalten anlegen
+ // create control elements
SW_DLLPRIVATE void CreateBtns();
SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
@@ -308,6 +306,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE DECL_LINK( HtmlOptionsHdl, void * );
+ SW_DLLPRIVATE DECL_LINK( FieldPopupModeEndHdl, FloatingWindow * );
+
inline long GetXScroll() const;
inline long GetYScroll() const;
SW_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
@@ -318,7 +318,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE sal_Bool GetPageScrollUpOffset(SwTwips& rOff) const;
SW_DLLPRIVATE sal_Bool GetPageScrollDownOffset(SwTwips& rOff) const;
- // Scrollbar Movements
+ // scrollbar movements
SW_DLLPRIVATE long PageUp();
SW_DLLPRIVATE long PageDown();
SW_DLLPRIVATE long PageUpCrsr(sal_Bool bSelect);
@@ -330,11 +330,12 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
SW_DLLPRIVATE sal_Bool UpdateScrollbars();
+ SW_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow);
- // Linguistik-Funktionen
+ // linguistics functions
SW_DLLPRIVATE void HyphenateDocument();
SW_DLLPRIVATE sal_Bool IsDrawTextHyphenate();
SW_DLLPRIVATE void HyphenateDrawText();
@@ -353,16 +354,16 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
{ bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
- // Methoden fuers Printing
+ // methods for printing
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SfxTabPage* CreatePrintOptionsPage( Window* pParent,
const SfxItemSet& rSet);
- // fuer Readonly-Umschaltung
+ // for readonly switching
SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
SW_DLLPRIVATE void _CheckReadonlyState();
SW_DLLPRIVATE void _CheckReadonlySelection();
- // Methode fuer PageDesc drehen
+ // method for rotating PageDesc
SW_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
SW_DLLPRIVATE void _SetZoom( const Size &rEditSz,
@@ -386,7 +387,7 @@ protected:
int GetSelectionType() const { return nSelectionType; }
void SetSelectionType(int nSet) { nSelectionType = nSet;}
- // fuer die SwWebView
+ // for SwWebView
void SetShell( SfxShell* pS ) { pShell = pS; }
void SetFormShell( FmFormShell* pSh ) { pFormShell = pSh; }
@@ -419,7 +420,7 @@ public:
void GotFocus() const;
virtual SdrView* GetDrawView() const;
virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
- virtual void ShowCursor( FASTBOOL bOn = sal_True );
+ virtual void ShowCursor( bool bOn = sal_True );
virtual ErrCode DoVerb( long nVerb );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
@@ -441,7 +442,7 @@ public:
bool IsValidSelectionForThesaurus() const;
String GetThesaurusLookUpText( bool bSelection ) const;
- // Shell sofort wechseln -> fuer GetSelectionObject
+ // immediately switch shell -> for GetSelectionObject
void StopShellTimer();
inline SwWrtShell& GetWrtShell () const { return *pWrtShell; }
@@ -454,7 +455,7 @@ public:
void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
#endif
- //Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
+ // hand the handler for text blocks to the shell; create if applicable
SwGlossaryHdl* GetGlosHdl();
inline const Rectangle& GetVisArea() const { return aVisArea; }
@@ -469,7 +470,8 @@ public:
DECL_LINK( SpellError, LanguageType * );
sal_Bool ExecSpellPopup( const Point& rPt );
- sal_Bool ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
+ void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
+
// SMARTTAGS
sal_Bool ExecSmartTagPopup( const Point& rPt );
@@ -505,7 +507,7 @@ public:
sal_Bool HandleWheelCommands( const CommandEvent& );
- // Rahmen einfuegen
+ // insert frames
void InsFrmMode(sal_uInt16 nCols);
void SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
@@ -559,7 +561,7 @@ public:
void StateStatusLine(SfxItemSet&);
- // Funktionen fuer Drawing
+ // functions for drawing
void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const { return pDrawActual; }
void GetDrawState(SfxItemSet &rSet);
@@ -569,7 +571,7 @@ public:
inline sal_Bool IsDrawSelMode() { return bDrawSelMode; }
void SetSelDrawSlot();
inline void FlipDrawSelMode() { bDrawSelMode = !bDrawSelMode; }
- void NoRotate(); // Rotate-Mode abschalten
+ void NoRotate(); // turn off rotate mode
sal_Bool EnterDrawTextMode(const Point& aDocPos);
void LeaveDrawCreate() { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
sal_Bool IsDrawMode() { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
@@ -583,30 +585,30 @@ public:
void StateTabWin(SfxItemSet&);
- // Attribute haben sich geaendert
+ // attributes have changed
DECL_LINK( AttrChangedNotify, SwWrtShell * );
// form control has been activated
DECL_LINK( FormControlActivated, FmFormShell* );
- // Links bearbeiten
+ // edit links
void EditLinkDlg();
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
void InsertCaption(const InsCaptionOpt *pOpt);
- // Async Aufruf durch Core
+ // Async call by Core
void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
- // Shell rausreichen
+ // hand over Shell
SfxShell *GetCurShell() { return pShell; }
SwDocShell *GetDocShell();
inline const SwDocShell *GetDocShell() const;
inline FmFormShell *GetFormShell() { return pFormShell; }
inline const FmFormShell *GetFormShell() const { return pFormShell; }
- //damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
+ // so that in the SubShells' DTors pShell can be reset if applicable
void ResetSubShell() { pShell = 0; }
virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False );
@@ -671,7 +673,6 @@ public:
};
// ----------------- inline Methoden ----------------------
-
inline long SwView::GetXScroll() const
{
return aVisArea.GetWidth() * nScrollX / 100L;
@@ -687,11 +688,10 @@ inline const SwDocShell *SwView::GetDocShell() const
return ((SwView*)this)->GetDocShell();
}
-//***********************************************************
-
SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions,
sal_Bool bPreview);
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/viewlayoutctrl.hxx b/sw/source/ui/inc/viewlayoutctrl.hxx
index 999f4b845636..fd02906129a8 100644
--- a/sw/source/ui/inc/viewlayoutctrl.hxx
+++ b/sw/source/ui/inc/viewlayoutctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,9 @@
#define _VIEWLAYOUTCTRL_HXX
// include ---------------------------------------------------------------
-
#include <sfx2/stbitem.hxx>
// class SwViewLayoutControl ----------------------------------------------
-
class SwViewLayoutControl : public SfxStatusBarControl
{
private:
@@ -54,3 +53,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wformsh.hxx b/sw/source/ui/inc/wformsh.hxx
index abd98d510e65..38e587ff5e35 100644
--- a/sw/source/ui/inc/wformsh.hxx
+++ b/sw/source/ui/inc/wformsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wfrmsh.hxx b/sw/source/ui/inc/wfrmsh.hxx
index dfe5bd5f422f..a141842440f2 100644
--- a/sw/source/ui/inc/wfrmsh.hxx
+++ b/sw/source/ui/inc/wfrmsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wgrfsh.hxx b/sw/source/ui/inc/wgrfsh.hxx
index b53743885d66..eaf5e4625007 100644
--- a/sw/source/ui/inc/wgrfsh.hxx
+++ b/sw/source/ui/inc/wgrfsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wlistsh.hxx b/sw/source/ui/inc/wlistsh.hxx
index e3503a54e448..dd3fe48ac9ba 100644
--- a/sw/source/ui/inc/wlistsh.hxx
+++ b/sw/source/ui/inc/wlistsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,3 +41,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wolesh.hxx b/sw/source/ui/inc/wolesh.hxx
index 87b48db5593e..6d714580b8e4 100644
--- a/sw/source/ui/inc/wolesh.hxx
+++ b/sw/source/ui/inc/wolesh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx
index a228b8bdea77..5c6dbabea04f 100644
--- a/sw/source/ui/inc/wordcountdialog.hxx
+++ b/sw/source/ui/inc/wordcountdialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define SW_WORDCOUNTDIALOG_HXX
#include <sfx2/basedlgs.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <layout/layout.hxx>
#include <layout/layout-pre.hxx>
struct SwDocStat;
@@ -41,12 +40,16 @@ class SwWordCountDialog : public SfxModalDialog
FixedInfo aCurrentWordFI;
FixedText aCurrentCharacterFT;
FixedInfo aCurrentCharacterFI;
+ FixedText aCurrentCharacterExcludingSpacesFT;
+ FixedInfo aCurrentCharacterExcludingSpacesFI;
FixedLine aDocFL;
FixedText aDocWordFT;
FixedInfo aDocWordFI;
FixedText aDocCharacterFT;
FixedInfo aDocCharacterFI;
+ FixedText aDocCharacterExcludingSpacesFT;
+ FixedInfo aDocCharacterExcludingSpacesFI;
FixedLine aBottomFL;
@@ -63,3 +66,5 @@ public:
#include <layout/layout-post.hxx>
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx
index 297c343a7391..2e8588c23c15 100644
--- a/sw/source/ui/inc/workctrl.hxx
+++ b/sw/source/ui/inc/workctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,15 +31,13 @@
#include <sfx2/tbxctrl.hxx>
#include <vcl/toolbox.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
class PopupMenu;
class SwView;
-// doppelter Eintrag! hrc und hxx
-// diese Ids bestimmen, was die Buttons unter dem Scrollbar tun
+// double entry! hrc and hxx
+// these Ids say what the buttons below the scrollbar are doing
#define NID_START 20000
#define NID_NEXT 20000
#define NID_PREV 20001
@@ -137,7 +136,6 @@ class SwScrollNaviPopup : public SfxPopupWindow
FixedLine aSeparator;
FixedInfo aInfoField;
ImageList aIList;
- ImageList aIListH;
String sQuickHelp[2 * NID_COUNT];
@@ -170,7 +168,6 @@ class SwNaviImageButton : public ImageButton
{
SwScrollNaviPopup* pPopup;
Image aImage;
- Image aImageH;
String sQuickText;
SfxPopupWindow* pPopupWindow;
SfxPopupWindow* pFloatingWindow;
@@ -189,7 +186,7 @@ class SwNaviImageButton : public ImageButton
};
//----------------------------------------------------------------------------
-// Die ImageButtons muessen sich bei Bedarf den HelpText selbst setzen
+// ImageButtons have to set the HelpText themselves if needed
//----------------------------------------------------------------------------
class SwHlpImageButton : public ImageButton
@@ -202,9 +199,7 @@ class SwHlpImageButton : public ImageButton
virtual void RequestHelp( const HelpEvent& rHEvt );
};
-/* -----------------26.11.2002 09:25-----------------
- *
- * --------------------------------------------------*/
+
class SwPreviewZoomControl : public SfxToolBoxControl
{
public:
@@ -223,3 +218,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wrap.hxx b/sw/source/ui/inc/wrap.hxx
index 6ca664ea5d84..34913202199b 100644
--- a/sw/source/ui/inc/wrap.hxx
+++ b/sw/source/ui/inc/wrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,21 +31,13 @@
#include <sfx2/tabdlg.hxx>
#include <sfx2/basedlgs.hxx>
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
class Window;
class SfxItemSet;
@@ -63,7 +56,7 @@ public:
/*--------------------------------------------------------------------
- Beschreibung: Umlauf-TabPage
+ Description: circulation TabPage
--------------------------------------------------------------------*/
class SwWrapTabPage: public SfxTabPage
@@ -149,3 +142,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 010c3792f258..634cd97966c4 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <sortopt.hxx>
#include <swurl.hxx>
#include <IMark.hxx>
+#include "navmgr.hxx"
class Window;
class OutputDevice;
@@ -68,17 +70,17 @@ namespace com { namespace sun { namespace star { namespace util {
typedef sal_Int32 SelectionType;
namespace nsSelectionType
{
- const SelectionType SEL_TXT = CNT_TXT; // Text, niemals auch Rahmen 0x0001
- const SelectionType SEL_GRF = CNT_GRF; // Grafik 0x0002
- const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010
- const SelectionType SEL_FRM = 0x000020; // Rahmen, keine Inhaltsform
- const SelectionType SEL_NUM = 0x000040; // NumListe
- const SelectionType SEL_TBL = 0x000080; // Cursor steht in Tabelle
- const SelectionType SEL_TBL_CELLS = 0x000100; // Tabellenzellen sind selektiert
- const SelectionType SEL_DRW = 0x000200; // Zeichenobjekte (Rechteck, Kreis...)
- const SelectionType SEL_DRW_TXT = 0x000400; // Draw-Textobjekte im Editmode
- const SelectionType SEL_BEZ = 0x000800; // Bezierobjekte editieren
- const SelectionType SEL_DRW_FORM = 0x001000; // Zeichenobjekte: DB-Forms
+ const SelectionType SEL_TXT = CNT_TXT; // text, never frames too 0x0001
+ const SelectionType SEL_GRF = CNT_GRF; // graphic 0x0002
+ const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010
+ const SelectionType SEL_FRM = 0x000020; // frame, no content type
+ const SelectionType SEL_NUM = 0x000040; // NumList
+ const SelectionType SEL_TBL = 0x000080; // cursor is in table
+ const SelectionType SEL_TBL_CELLS = 0x000100; // table cells are selected
+ const SelectionType SEL_DRW = 0x000200; // drawing objects (rectangle, circle...)
+ const SelectionType SEL_DRW_TXT = 0x000400; // draw-textobjects in edit mode
+ const SelectionType SEL_BEZ = 0x000800; // edit ornament objects
+ const SelectionType SEL_DRW_FORM = 0x001000; // drawing objects: DB-Forms
const SelectionType SEL_FOC_FRM_CTRL = 0x002000; // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by it's clients.
const SelectionType SEL_MEDIA = 0x004000; // Media object
const SelectionType SEL_EXTRUDED_CUSTOMSHAPE = 0x008000; // extruded custom shape
@@ -113,11 +115,10 @@ public:
SELECTFUNC fnEndDrag;
SELECTFUNC fnKillSel;
- // Alle Selektionen aufheben
+ // reset all selections
long ResetSelect( const Point *, sal_Bool );
- //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down
- //zurueck, falls ein Stack aufgebaut ist
+ // resets the cursorstack after movement with PageUp/-Down if a stack is built up
inline void ResetCursorStack();
SelectionType GetSelectionType() const;
@@ -129,7 +130,7 @@ public:
void EndSelect();
sal_Bool IsInSelect() const { return bInSelect; }
void SetInSelect(sal_Bool bSel = sal_True) { bInSelect = bSel; }
- // Liegt eine Text- oder Rahmenselektion vor?
+ // is there a text- or frameselection?
sal_Bool HasSelection() const { return SwCrsrShell::HasSelection() ||
IsMultiSelection() || IsSelFrmMode() || IsObjSelected(); }
sal_Bool Pop( sal_Bool bOldCrsr = sal_True );
@@ -160,40 +161,38 @@ public:
void EnterSelFrmMode(const Point *pStartDrag = 0);
void LeaveSelFrmMode();
sal_Bool IsSelFrmMode() const { return bLayoutMode; }
- // Selektion von Rahmen aufheben
+ // reset selection of frames
void UnSelectFrm();
void Invalidate();
- // Tabellenzellen selektieren fuer Bearbeiten von Formeln in der Ribbonbar
+ // select table cells for editing of formulas in the ribbonbar
inline void SelTblCells( const Link &rLink, sal_Bool bMark = sal_True );
inline void EndSelTblCells();
- //Wortweisen oder zeilenweisen Selektionsmodus verlassen. Wird
- //in der Regel in MB-Up gerufen.
+ // leave per word or per line selection mode. Is usually called in MB-Up.
sal_Bool IsExtSel() const { return bSelWrd || bSelLn; }
- // erfrage, ob der akt. fnDrag - Pointer auf BeginDrag gesetzt ist
- // Wird fuer MouseMove gebraucht, um die Bugs 55592/55931 zu umgehen.
+ // query whether the active fnDrag pointer is set to BeginDrag
+ // is needed for MouseMove to work around bugs 55592/55931
inline sal_Bool Is_FnDragEQBeginDrag() const;
- //Basisabfragen
+ // base requests
sal_Bool IsInWrd() { return IsInWord(); }
sal_Bool IsSttWrd() { return IsStartWord(); }
sal_Bool IsEndWrd();
sal_Bool IsSttOfPara() const { return IsSttPara(); }
sal_Bool IsEndOfPara() const { return IsEndPara(); }
- //Word bzw. Satz selektieren.
+ // select word / sentense
sal_Bool SelNearestWrd();
sal_Bool SelWrd (const Point * = 0, sal_Bool bProp=sal_False );
- // --> FME 2004-07-30 #i32329# Enhanced selection
+ // #i32329# Enhanced selection
void SelSentence (const Point * = 0, sal_Bool bProp=sal_False );
void SelPara (const Point * = 0, sal_Bool bProp=sal_False );
- // <--
long SelAll();
- //Basiscursortravelling
+ // basecursortravelling
typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool SimpleMove( FNSimpleMove, sal_Bool bSelect );
@@ -231,16 +230,15 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool BwdSentence( sal_Bool bSelect = sal_False )
{ return SimpleMove( &SwWrtShell::_BwdSentence, bSelect ); }
- // --> FME 2004-07-30 #i20126# Enhanced table selection
+ // #i20126# Enhanced table selection
sal_Bool SelectTableRowCol( const Point& rPt, const Point* pEnd = 0, bool bRowDrag = false );
- // <--
sal_Bool SelectTableRow();
sal_Bool SelectTableCol();
sal_Bool SelectTableCell();
sal_Bool SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr = 0 );
- // Spaltenweise Spruenge
+ // per column jumps
sal_Bool StartOfColumn ( sal_Bool bSelect = sal_False );
sal_Bool EndOfColumn ( sal_Bool bSelect = sal_False );
sal_Bool StartOfNextColumn ( sal_Bool bSelect = sal_False );
@@ -248,18 +246,18 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool StartOfPrevColumn ( sal_Bool bSelect = sal_False );
sal_Bool EndOfPrevColumn ( sal_Bool bSelect = sal_False );
- // setze den Cursor auf die Seite "nPage" an den Anfang
- // zusaetzlich zu der gleichnamigen Implementierung in crsrsh.hxx
- // werden hier alle bestehenden Selektionen vor dem Setzen des
- // Cursors aufgehoben
+ // set the cursor to page "nPage" at the beginning
+ // additionally to a identically named implementation in crsrsh.hxx
+ // here all existing selections are being reset before setting the
+ // cursor
sal_Bool GotoPage( sal_uInt16 nPage, sal_Bool bRecord );
- //setzen des Cursors; merken der alten Position fuer Zurueckblaettern.
+ // setting the cursor; remember the old position for turning back
DECL_LINK( ExecFlyMac, void * );
sal_Bool PageCrsr(SwTwips lOffset, sal_Bool bSelect);
- // Felder Update
+ // update fields
void UpdateInputFlds( SwInputFieldList* pLst = 0, sal_Bool bOnlyInSel = sal_False );
void NoEdit(sal_Bool bHideCrsr = sal_True);
@@ -272,14 +270,13 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// change current data base and notify
void ChgDBData(const SwDBData& SwDBData);
- // Loeschen
+ // delete
long DelToEndOfLine();
long DelToStartOfLine();
long DelLine();
long DelLeft();
- // loescht auch Rahmen bzw. setzt den Cursor in den Rahmen,
- // wenn bDelFrm == sal_False ist
+ // also deletes the frame or sets the cursor in the frame when bDelFrm == sal_False
long DelRight();
long DelToEndOfPara();
long DelToStartOfPara();
@@ -288,10 +285,10 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
long DelNxtWord();
long DelPrvWord();
- // Prueft, ob eine Wortselektion vorliegt.
- // Gemaess den Regeln fuer intelligentes Cut / Paste
- // werden umgebende Spaces rausgeschnitten.
- // Liefert Art der Wortselektion zurueck (siehe enum)
+ // checks whether a word selection exists.
+ // According to the rules for intelligent Cut / Paste
+ // surrounding spaces are cut out.
+ // returns type of word selection (see enum)
enum word {
NO_WORD = 0,
WORD_SPACE_BEFORE = 1,
@@ -300,10 +297,10 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
};
int IntelligentCut(int nSelectionType, sal_Bool bCut = sal_True);
- // Editieren
+ // edit
void Insert(SwField &);
void Insert(const String &);
- // Graphic
+ // graphic
void Insert( const String &rPath, const String &rFilter,
const Graphic &, SwFlyFrmAttrMgr * = 0,
sal_Bool bRule = sal_False );
@@ -316,11 +313,11 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void SplitNode( sal_Bool bAutoFormat = sal_False, sal_Bool bCheckTableStart = sal_True );
sal_Bool CanInsert();
- // Verzeichnisse
+ // indexes
void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
sal_Bool UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
- // Numerierung und Bullets
+ // numbering and bullets
/**
Turns on numbering or bullets.
@@ -333,28 +330,29 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void BulletOn();
//OLE
- void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 fuer Clipboard
+ void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
const svt::EmbeddedObjectRef&,
- SvGlobalName *pName = 0, // != 0 entspr. Object erzeugen.
+ SvGlobalName *pName = 0, // != 0 create object accordingly
sal_Bool bActivate = sal_True,
- sal_uInt16 nSlotId = 0); // SlotId fuer Dialog
+ sal_uInt16 nSlotId = 0); // SlotId for dialog
sal_Bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrmFmt **pFlyFrmFmt = 0 );
- void LaunchOLEObj( long nVerb = 0 ); // Server starten
+ void LaunchOLEObj( long nVerb = 0 ); // start server
sal_Bool IsOLEObj() const { return GetCntType() == CNT_OLE;}
virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
const SwRect *pFlyPrtRect = 0,
- const SwRect *pFlyFrmRect = 0 );
+ const SwRect *pFlyFrmRect = 0,
+ const bool bNoTxtFrmPrtAreaChanged = false );
virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt,
const SwRect &rFrm );
- // Vorlagen und Formate
+ // styles and formats
- // enum gibt an, was geschehen soll, wenn das Style nicht gefunden wurde
- enum GetStyle { GETSTYLE_NOCREATE, // keins anlegen
- GETSTYLE_CREATESOME, // falls auf PoolId mapt anlegen
- GETSTYLE_CREATEANY }; // ggfs Standard returnen
+ // enum tells when should happen when the style was not found
+ enum GetStyle { GETSTYLE_NOCREATE, // create none
+ GETSTYLE_CREATESOME, // if on PoolId create mapt
+ GETSTYLE_CREATEANY }; // return standard if applicable
SwTxtFmtColl* GetParaStyle(const String &rCollName,
GetStyle eCreate = GETSTYLE_NOCREATE);
@@ -366,7 +364,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
String GetCurPageStyle( const sal_Bool bCalcFrm = sal_True ) const;
- // Aktuelle Vorlage anhand der geltenden Attribute aendern
+ // change current style using the attributes in effect
void QuickUpdateStyle();
enum DoType { UNDO, REDO, REPEAT };
@@ -376,7 +374,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
String GetRepeatString() const;
sal_uInt16 GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const;
- //Suchen oder Ersetzen
+ // search and replace
sal_uLong SearchPattern(const com::sun::star::util::SearchOptions& rSearchOpt,
sal_Bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnde,
@@ -397,23 +395,23 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar = ' ' );
- // Aktion vor Cursorbewegung
- // Hebt gfs. Selektionen auf, triggert Timer und GCAttr()
+ // action ahead of cursor movement
+ // resets selection if applicable, triggers timer and GCAttr()
void MoveCrsr( sal_Bool bWithSelect = sal_False );
- // Eingabefelder updaten
+ // update input fields
sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, ByteString* pWindowState = 0);
// update DropDown fields
sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, ByteString* pWindowState = 0);
- //"Handler" fuer Anederungen an der DrawView - fuer Controls.
+ //"Handler" for changes at DrawView - for controls.
virtual void DrawSelChanged( );
- // springe zum Bookmark und setze die "Selections-Flags" wieder richtig
+ // jump to bookmark and set the "selctions-flags" correctly again
sal_Bool GotoMark( const ::sw::mark::IMark* const pMark );
sal_Bool GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart );
sal_Bool GotoMark( const ::rtl::OUString& rName );
- sal_Bool GoNextBookmark(); // sal_True, wenn's noch eine gab
+ sal_Bool GoNextBookmark(); // sal_True when there still was one
sal_Bool GoPrevBookmark();
bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
@@ -424,46 +422,44 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// on graphics
sal_Bool SelectNextPrevHyperlink( sal_Bool bNext = sal_True );
- // Zugehoerige SwView ermitteln
+ // determine corresponding SwView
const SwView& GetView() const { return rView; }
SwView& GetView() { return rView; }
- //Weil es sonst keiner macht, gibt es hier eine ExecMacro()
+ // Because nobody else is doing it, here is a ExecMacro()
void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
- // rufe ins dunkle Basic/JavaScript
+ // call into the dark Basic/JavaScript
sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
sal_Bool bCheckPtr = sal_False, SbxArray* pArgs = 0,
const Link* pCallBack = 0 );
- // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem.
- // Fuehre die vor definierten Aktionen aus.
+ // a click at the given field. the cursor is on it.
+ // execute the predefined actions.
void ClickToField( const SwField& rFld );
void ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter = URLLOAD_NOFILTER );
sal_Bool ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter = URLLOAD_NOFILTER );
inline sal_Bool IsInClickToEdit() const ;
- // fall ein URL-Button selektiert ist, dessen URL returnen, ansonsten
- // einen LeerString
+ // if a URL-Button is selected, return its URL; otherwise an empty string
sal_Bool GetURLFromButton( String& rURL, String& rDescr ) const;
void NavigatorPaste( const NaviContentBookmark& rBkmk,
const sal_uInt16 nAction );
- // die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
+ // Core creates a selection, SttSelect has to be called
virtual void NewCoreSelection();
virtual void ApplyViewOptions( const SwViewOption &rOpt );
- // autom. Update von Vorlagen
+ // automatic update of styles
void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet);
void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet);
- // Link fuers einfuegen von Bereichen uebers Drag&Drop/Clipboard
+ // link for inserting ranges via Drag&Drop/Clipboard
DECL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData* );
- //ctoren, der erstere ist eine Art kontrollierter copy ctor fuer weitere
- //Sichten auf ein Dokument
+ // ctor, the first one is a kind of a controlled copy ctor for more views of a document
SwWrtShell( SwWrtShell&, Window *pWin, SwView &rShell);
SwWrtShell( SwDoc& rDoc, Window *pWin, SwView &rShell,
const SwViewOption *pViewOpt = 0);
@@ -473,6 +469,21 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
String GetSelDescr() const;
+ SwNavigationMgr& GetNavigationMgr();
+ void addCurrentPosition();
+ sal_Bool GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL,
+ sal_Bool bSelFrame = sal_True );
+ sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr );
+ void GotoOutline( sal_uInt16 nIdx );
+ sal_Bool GotoOutline( const String& rName );
+ sal_Bool GotoRegion( const String& rName );
+ sal_Bool GotoRefMark( const String& rRefMark, sal_uInt16 nSubType = 0,
+ sal_uInt16 nSeqNo = 0 );
+ sal_Bool GotoNextTOXBase( const String* pName = 0);
+ sal_Bool GotoTable( const String& rName );
+ sal_Bool GotoFld( const SwFmtFld& rFld );
+ const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False);
+
private:
SW_DLLPRIVATE void OpenMark();
@@ -498,7 +509,7 @@ private:
{}
} *pModeStack;
- // Cursor bei PageUp / -Down mitnehmen
+ // carry cursor along when PageUp / -Down
enum PageMove
{
MV_NO,
@@ -529,6 +540,7 @@ private:
} *pCrsrStack;
SwView &rView;
+ SwNavigationMgr aNavigationMgr;
Point aDest;
sal_Bool bDestOnStack;
@@ -536,21 +548,20 @@ private:
SW_DLLPRIVATE sal_Bool PushCrsr(SwTwips lOffset, sal_Bool bSelect);
SW_DLLPRIVATE sal_Bool PopCrsr(sal_Bool bUpdate, sal_Bool bSelect = sal_False);
- // ENDE Cursor bei PageUp / -Down mitnehmen
+ // take END cursor along when PageUp / -Down
SW_DLLPRIVATE sal_Bool _SttWrd();
SW_DLLPRIVATE sal_Bool _EndWrd();
SW_DLLPRIVATE sal_Bool _NxtWrd();
SW_DLLPRIVATE sal_Bool _PrvWrd();
- // --> OD 2008-08-06 #i92468#
+ // #i92468#
SW_DLLPRIVATE sal_Bool _NxtWrdForDelete();
SW_DLLPRIVATE sal_Bool _PrvWrdForDelete();
- // <--
SW_DLLPRIVATE sal_Bool _FwdSentence();
SW_DLLPRIVATE sal_Bool _BwdSentence();
sal_Bool _FwdPara();
SW_DLLPRIVATE sal_Bool _BwdPara();
- // Selektionen
+ // selections
sal_Bool bIns :1;
sal_Bool bInSelect :1;
sal_Bool bExtMode :1;
@@ -562,7 +573,7 @@ private:
sal_Bool bSelWrd :1;
sal_Bool bSelLn :1;
sal_Bool bIsInClickToEdit:1;
- sal_Bool bClearMark :1; // Selektion fuer ChartAutoPilot nicht loeschen
+ sal_Bool bClearMark :1; // don't delete selection for ChartAutoPilot
sal_Bool mbRetainSelection :1; // Do not remove selections
Point aStart;
@@ -570,7 +581,7 @@ private:
SELECTFUNC fnLeaveSelect;
- //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down zurueck.
+ // resets the cursor stack after movement by PageUp/-Down
SW_DLLPRIVATE void _ResetCursorStack();
SW_DLLPRIVATE void SttDragDrop(Timer *);
@@ -588,13 +599,12 @@ private:
SW_DLLPRIVATE long ExtSelWrd(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long ExtSelLn(const Point *, sal_Bool bProp=sal_False );
- //Verschieben von Text aus Drag and Drop; Point ist
- //Destination fuer alle Selektionen.
+ // move text from Drag and Drop; Point is destination for all selections.
SW_DLLPRIVATE long MoveText(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long BeginFrmDrag(const Point *, sal_Bool bProp=sal_False );
- //nach SSize/Move eines Frames Update; Point ist Destination.
+ // after SSize/Move of a frame update; Point is destination.
SW_DLLPRIVATE long UpdateLayoutFrm(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long SttLeaveSelect(const Point *, sal_Bool bProp=sal_False );
@@ -650,3 +660,5 @@ inline sal_Bool SwWrtShell::Is_FnDragEQBeginDrag() const
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wtabsh.hxx b/sw/source/ui/inc/wtabsh.hxx
index 5ab809821de8..fbb5b4d9c57f 100644
--- a/sw/source/ui/inc/wtabsh.hxx
+++ b/sw/source/ui/inc/wtabsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,3 +41,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wtextsh.hxx b/sw/source/ui/inc/wtextsh.hxx
index cc03de602400..b94199828613 100644
--- a/sw/source/ui/inc/wtextsh.hxx
+++ b/sw/source/ui/inc/wtextsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/wview.hxx b/sw/source/ui/inc/wview.hxx
index 2b36bbf97dce..c76d8bd7d5e1 100644
--- a/sw/source/ui/inc/wview.hxx
+++ b/sw/source/ui/inc/wview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,10 +31,6 @@
#include "swdllapi.h"
#include "view.hxx"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
class SW_DLLPUBLIC SwWebView: public SwView
{
protected:
@@ -49,3 +46,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/zoomctrl.hxx b/sw/source/ui/inc/zoomctrl.hxx
index 05880e12189e..29818393d9a2 100644
--- a/sw/source/ui/inc/zoomctrl.hxx
+++ b/sw/source/ui/inc/zoomctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index 66c2b7d67b7e..4ffc8f7af846 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include <rsc/rscsfx.hxx>
#include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
-#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/text/XTextSectionsSupplier.hpp>
#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
@@ -52,9 +52,7 @@
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <cnttab.hxx>
#include <poolfmt.hxx>
#include <unoprnms.hxx>
@@ -63,21 +61,11 @@
#include <docsh.hxx>
#include <swmodule.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _INDEX_HRC
#include <index.hrc>
-#endif
-#ifndef _CNTTAB_HRC
#include <cnttab.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include <swuicnttab.hxx>
#include <unomid.h>
@@ -102,14 +90,11 @@ using ::rtl::OUString;
#endif
#define SW_PROP_NAME_STR(nId) SwGetPropName((nId)).pName
-/* -----------------04.11.99 11:28-------------------
-
- --------------------------------------------------*/
void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo,
uno::Reference< XPropertySet > & xProps,
const char* pPropName, const String& rValue)
{
- OUString uPropName(C2U(pPropName));
+ OUString uPropName(rtl::OUString::createFromAscii(pPropName));
if(xInfo->hasPropertyByName(uPropName))
{
uno::Any aValue;
@@ -117,17 +102,19 @@ void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo,
xProps->setPropertyValue(uPropName, aValue);
}
}
+
void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo,
uno::Reference< XPropertySet > & xProps,
sal_uInt16 nId, const String& rValue)
{
lcl_SetProp( xInfo, xProps, SW_PROP_NAME_STR(nId), rValue);
}
+
void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo,
uno::Reference< XPropertySet > & xProps,
sal_uInt16 nId, sal_Int16 nValue )
{
- OUString uPropName(C2U(SW_PROP_NAME_STR(nId)));
+ OUString uPropName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(nId)));
if(xInfo->hasPropertyByName(uPropName))
{
uno::Any aValue;
@@ -141,7 +128,7 @@ void lcl_SetBOOLProp(
uno::Reference< beans::XPropertySet > & xProps,
sal_uInt16 nId, sal_Bool bValue )
{
- OUString uPropName(C2U(SW_PROP_NAME_STR(nId)));
+ OUString uPropName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(nId)));
if(xInfo->hasPropertyByName(uPropName))
{
uno::Any aValue;
@@ -149,7 +136,7 @@ void lcl_SetBOOLProp(
xProps->setPropertyValue(uPropName, aValue);
}
}
-//-----------------------------------------------------------------------------
+
IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
{
try
@@ -191,21 +178,18 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
}
catch(Exception&)
{
- DBG_ERROR("::CreateExample() - exception caught");
+ OSL_FAIL("::CreateExample() - exception caught");
}
return 0;
}
-/* --------------------------------------------------
-
- --------------------------------------------------*/
void SwMultiTOXTabDialog::CreateOrUpdateExample(
TOXTypes nTOXIndex, sal_uInt16 nPage, sal_uInt16 nCurrentLevel)
{
if(!pExampleFrame || !pExampleFrame->IsInitialized())
return;
- const char* __FAR_DATA IndexServiceNames[] =
+ const char* IndexServiceNames[] =
{
"com.sun.star.text.DocumentIndex",
"com.sun.star.text.UserIndex",
@@ -218,7 +202,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
try
{
- DBG_ASSERT(pxIndexSectionsArr[nTOXIndex] &&
+ OSL_ENSURE(pxIndexSectionsArr[nTOXIndex] &&
pxIndexSectionsArr[nTOXIndex]->xContainerSection.is(),
"Section not created");
uno::Reference< frame::XModel > & xModel = pExampleFrame->GetModel();
@@ -243,7 +227,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
uno::Reference< text::XTextRange > xRg(xCrsr, uno::UNO_QUERY);
xCrsr->getText()->insertTextContent(xRg, xContent, sal_False);
}
- OUString uIsVisible(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_VISIBLE)));
+ OUString uIsVisible(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_VISIBLE)));
for(sal_uInt16 i = 0 ; i <= TOX_AUTHORITIES; i++)
{
uno::Reference< beans::XPropertySet > xSectPr(pxIndexSectionsArr[i]->xContainerSection, uno::UNO_QUERY);
@@ -269,10 +253,10 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
//stylenames
sal_uInt16 nContentOptions = rDesc.GetContentOptions();
- if(xInfo->hasPropertyByName(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES))))
+ if(xInfo->hasPropertyByName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES))))
{
sal_Bool bOn = 0!=(nContentOptions&nsSwTOXElement::TOX_TEMPLATE );
- uno::Any aStyleNames(xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES))));
+ uno::Any aStyleNames(xIdxProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES))));
uno::Reference< container::XIndexReplace > xAcc;
aStyleNames >>= xAcc;
@@ -329,8 +313,6 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_STAR_CALC, 0 != (nsSwTOOElements::TOO_CALC &nOLEOptions ));
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_STAR_DRAW, 0 != (nsSwTOOElements::TOO_DRAW_IMPRESS&nOLEOptions));
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_OTHER_EMBEDDED_OBJECTS, 0 != (nsSwTOOElements::TOO_OTHER|nOLEOptions ));
-
- //lcl_SetBOOLProp(xInfo, xIdxProps, , rDesc.IsLevelFromChapter());
}
const SwForm* pForm = GetForm(eCurrentTOXType);
if(bInitialCreate || !nPage || nPage == TOX_PAGE_ENTRY)
@@ -347,7 +329,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
nEndLevel = pForm->GetFormMax() - 1;
}
- if(xInfo->hasPropertyByName(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT))))
+ if(xInfo->hasPropertyByName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT))))
{
for(sal_uInt16 nCurrLevel = nStartLevel; nCurrLevel <= nEndLevel; nCurrLevel++)
{
@@ -371,7 +353,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
case TOKEN_ENTRY_NO :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenEntryNumber"));
- // fuer Inhaltsverzeichnis Numerierung
+ // numbering for content index
break;
case TOKEN_ENTRY_TEXT :
case TOKEN_ENTRY :
@@ -440,12 +422,12 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
pValues[nTokenIndex] = aPropVals;
nTokenIndex++;
- aIt++; // #i24377#
+ ++aIt; // #i24377#
}
aSequPropVals.realloc(nTokenIndex);
- uno::Any aFormatAccess = xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)));
- DBG_ASSERT(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0),
+ uno::Any aFormatAccess = xIdxProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)));
+ OSL_ENSURE(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0),
"wrong property type");
@@ -485,32 +467,13 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
pForm->GetTemplate(i + nOffset));
}
}
-/*
- const String& GetAutoMarkURL() const { return sAutoMarkURL;}
- const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;}
-
- String GetAuthBrackets() const {return sAuthBrackets;}
- sal_Bool IsAuthSequence() const {return bIsAuthSequence;}
- sal_Bool IsSortByDocument()const {return bSortByDocument ;}
-
- SwTOXSortKey GetSortKey1() const {return eSortKey1;}
- SwTOXSortKey GetSortKey2() const {return eSortKey2;}
- SwTOXSortKey GetSortKey3() const {return eSortKey3;}
-*/
- //
pxIndexSectionsArr[nTOXIndex]->xDocumentIndex->update();
-//#if OSL_DEBUG_LEVEL > 1
-// uno::Reference< frame::XStorable > xStor(xModel, uno::UNO_QUERY);
-// String sURL("file:///e|/temp/sw/idxexample.sdw");
-// uno::Sequence< beans::PropertyValue > aArgs(0);
-// xStor->storeToURL(S2U(sURL), aArgs);
-//#endif
-
}
catch(Exception&)
{
- DBG_ERROR("::CreateExample() - exception caught");
+ OSL_FAIL("::CreateExample() - exception caught");
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 905caaf6f0ef..d5c2838e18ee 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,20 +58,14 @@
#include <authfld.hxx>
#include <swtypes.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _BASESH_HXX
#include <basesh.hxx>
-#endif
#include <outline.hxx>
#include <cnttab.hxx>
#include <swuicnttab.hxx>
#include <formedt.hxx>
#include <poolfmt.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <uitool.hxx>
#include <fmtcol.hxx>
#include <fldbas.hxx>
@@ -81,34 +76,18 @@
#include <swmodule.hxx>
#include <modcfg.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _INDEX_HRC
#include <index.hrc>
-#endif
-#ifndef _CNTTAB_HRC
#include <cnttab.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include <sfx2/filedlghelper.hxx>
-#ifndef _TOXHLP_HXX
#include <toxwrap.hxx>
-#endif
#include <chpfld.hxx>
-#ifndef _UTLUI_HRC
#include "utlui.hrc"
-#endif
#include <sfx2/app.hxx>
@@ -121,8 +100,8 @@ using ::rtl::OUString;
using namespace ::sfx2;
#include <svtools/editbrowsebox.hxx>
-static const sal_Unicode aDeliStart = '['; //fuer die form
-static const sal_Unicode aDeliEnd = ']'; //fuer die form
+static const sal_Unicode aDeliStart = '['; // for the form
+static const sal_Unicode aDeliEnd = ']'; // for the form
#define POS_GRF 0
#define POS_OLE 1
@@ -132,10 +111,6 @@ static const sal_Unicode aDeliEnd = ']'; //fuer die form
#define IDX_FILE_EXTENSION String::CreateFromAscii( \
RTL_CONSTASCII_STRINGPARAM( "*.sdi" ))
-
-/* -----------------14.06.99 13:10-------------------
-
- --------------------------------------------------*/
String lcl_CreateAutoMarkFileDlg( const String& rURL,
const String& rFileString, sal_Bool bOpen )
{
@@ -168,9 +143,7 @@ String lcl_CreateAutoMarkFileDlg( const String& rURL,
rLastSaveDir = sSaveDir;
return sRet;
}
-/* -----------------------------19.01.00 11:09--------------------------------
- ---------------------------------------------------------------------------*/
struct AutoMarkEntry
{
String sSearch;
@@ -218,8 +191,6 @@ class SwEntryBrowseBox : public SwEntryBrowseBox_Base
protected:
virtual sal_Bool SeekRow( long nRow );
-// virtual void PaintField( OutputDevice& rDev, const awt::Rectangle& rRect,
-// sal_uInt16 nColumnId ) const;
virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const;
virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol);
virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol);
@@ -257,9 +228,7 @@ public:
~SwAutoMarkDlg_Impl();
};
-/* -----------------04.11.99 11:02-------------------
- --------------------------------------------------*/
sal_uInt16 CurTOXType::GetFlatIndex() const
{
sal_uInt16 nRet = static_cast< sal_uInt16 >(eType);
@@ -269,14 +238,9 @@ sal_uInt16 CurTOXType::GetFlatIndex() const
}
return nRet;
}
-/*************************************************************************
-*************************************************************************/
#define EDIT_MINWIDTH 15
-/* -----------------14.06.99 12:12-------------------
-
- --------------------------------------------------*/
SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX,
@@ -362,7 +326,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
}
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_TOX_SELECT, SwTOXSelectTabPage::Create, 0);
AddTabPage(TP_TOX_STYLES, SwTOXStylesTabPage::Create, 0);
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
@@ -389,9 +353,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
if(aNewPos.X() < 0)
SetPosPixel(aOldPos);
}
-/*-- 14.06.99 13:11:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMultiTOXTabDialog::~SwMultiTOXTabDialog()
{
SW_MOD()->GetModuleConfig()->SetShowIndexPreview(aShowExampleCB.IsChecked());
@@ -409,9 +371,7 @@ SwMultiTOXTabDialog::~SwMultiTOXTabDialog()
delete pMgr;
delete pExampleFrame;
}
-/*-- 14.06.99 13:11:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if( TP_BACKGROUND == nId )
@@ -435,9 +395,7 @@ void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
((SwTOXSelectTabPage&)rPage).SelectType((TOXTypes)nInitialTOXType);
}
}
-/*-- 14.06.99 13:11:40---------------------------------------------------
- -----------------------------------------------------------------------*/
short SwMultiTOXTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
@@ -468,9 +426,7 @@ short SwMultiTOXTabDialog::Ok()
return nRet;
}
-/* -----------------16.06.99 11:59-------------------
- --------------------------------------------------*/
SwForm* SwMultiTOXTabDialog::GetForm(CurTOXType eType)
{
sal_uInt16 nIndex = eType.GetFlatIndex();
@@ -478,9 +434,7 @@ SwForm* SwMultiTOXTabDialog::GetForm(CurTOXType eType)
pFormArr[nIndex] = new SwForm(eType.eType);
return pFormArr[nIndex];
}
-/* -----------------09.09.99 11:29-------------------
- --------------------------------------------------*/
SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType)
{
sal_uInt16 nIndex = eType.GetFlatIndex();
@@ -520,9 +474,7 @@ SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType)
}
return *pDescArr[nIndex];
}
-/* -----------------09.09.99 11:36-------------------
- --------------------------------------------------*/
SwTOXDescription* SwMultiTOXTabDialog::CreateTOXDescFromTOXBase(
const SwTOXBase*pCurTOX)
{
@@ -551,10 +503,6 @@ SwTOXDescription* SwMultiTOXTabDialog::CreateTOXDescFromTOXBase(
return pDesc;
}
-/* -----------------------------29.12.99 09:53--------------------------------
-
- ---------------------------------------------------------------------------*/
-
IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
{
if(aShowExampleCB.IsChecked())
@@ -635,28 +583,20 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
return 0;
}
-
-/* -----------------05.07.99 09:49-------------------
-
- --------------------------------------------------*/
sal_Bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const String& rName)
{
SwTxtFmtColl* pColl = rSh.GetParaStyle(rName);
- //if(pColl && pColl->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei
if(pColl && ! pColl->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei
return sal_True;
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
if(nId != USHRT_MAX &&
- //rSh.GetTxtCollFromPool(nId)->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei
! rSh.GetTxtCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei
return sal_True;
return sal_False;
}
-/* -----------------14.07.99 16:01-------------------
- --------------------------------------------------*/
class SwIndexTreeLB : public SvTreeListBox
{
const HeaderBar* pHeaderBar;
@@ -668,9 +608,7 @@ public:
virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
void SetHeaderBar(const HeaderBar* pHB) {pHeaderBar = pHB;}
};
-/* -----------------14.07.99 16:03-------------------
- --------------------------------------------------*/
long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
{
long nData = (long)pEntry->GetUserData();
@@ -684,9 +622,7 @@ long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
nData += pTab->GetPos();
return nData;
}
-/* -----------------25.08.99 11:14-------------------
- --------------------------------------------------*/
void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt )
{
SvLBoxEntry* pEntry = FirstSelected();
@@ -721,9 +657,6 @@ void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt )
SvTreeListBox::KeyInput(rKEvt);
}
-/* -----------------16.07.99 10:01-------------------
-
- --------------------------------------------------*/
class SwHeaderTree : public Control
{
HeaderBar aStylesHB;
@@ -737,9 +670,7 @@ public:
virtual void GetFocus();
};
-/* -----------------16.07.99 10:11-------------------
- --------------------------------------------------*/
SwHeaderTree::SwHeaderTree(Window* pParent, const ResId rResId) :
Control(pParent, rResId),
aStylesHB( this, ResId(HB_STYLES, *rResId.GetResMgr())),
@@ -756,17 +687,13 @@ SwHeaderTree::SwHeaderTree(Window* pParent, const ResId rResId) :
aStylesTLB.SetSizePixel(aTLBSize);
aStylesTLB.SetHeaderBar(&aStylesHB);
}
-/* -----------------25.08.99 10:38-------------------
- --------------------------------------------------*/
void SwHeaderTree::GetFocus()
{
Control::GetFocus();
aStylesTLB.GrabFocus();
}
-/* -----------------13.07.99 15:29-------------------
- --------------------------------------------------*/
class SwAddStylesDlg_Impl : public SfxModalDialog
{
OKButton aOk;
@@ -789,9 +716,7 @@ public:
SwAddStylesDlg_Impl(Window* pParent, SwWrtShell& rWrtSh, String rStringArr[]);
~SwAddStylesDlg_Impl();
};
-/* -----------------13.07.99 15:39-------------------
- --------------------------------------------------*/
SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
SwWrtShell& rWrtSh, String rStringArr[]) :
SfxModalDialog(pParent, SW_RES(DLG_ADD_IDX_STYLES)),
@@ -813,9 +738,6 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
aLeftPB.SetAccessibleRelationMemberOf(&aStylesFL);
aRightPB.SetAccessibleRelationMemberOf(&aStylesFL);
- aLeftPB.SetModeImage( Image( SW_RES( IMG_ALL_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
- aRightPB.SetModeImage( Image( SW_RES( IMG_ALL_RIGHT_HC ) ), BMP_COLOR_HIGHCONTRAST );
-
aOk.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, OkHdl));
aLeftPB.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl));
aRightPB.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl));
@@ -835,7 +757,6 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
SwIndexTreeLB& rTLB = aHeaderTree.GetTreeListBox();
rTLB.SetStyle(rTLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT);
- //aStylesTLB.SetSelectHdl(LINK(this, SwAddStylesDlg_Impl, SelectHdl));
rTLB.GetModel()->SetSortMode(SortAscending);
for(i = 0; i < MAXLEVEL; ++i)
{
@@ -879,15 +800,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
rTLB.GetModel()->Resort();
}
-/* -----------------13.07.99 15:39-------------------
-
- --------------------------------------------------*/
SwAddStylesDlg_Impl::~SwAddStylesDlg_Impl()
{
}
-/* -----------------13.07.99 15:39-------------------
- --------------------------------------------------*/
IMPL_LINK(SwAddStylesDlg_Impl, OkHdl, OKButton*, EMPTYARG)
{
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
@@ -912,17 +828,13 @@ IMPL_LINK(SwAddStylesDlg_Impl, OkHdl, OKButton*, EMPTYARG)
EndDialog(RET_OK);
return 0;
}
-/* -----------------16.07.99 09:27-------------------
- --------------------------------------------------*/
IMPL_LINK(SwAddStylesDlg_Impl, HeaderDragHdl, HeaderBar*, EMPTYARG)
{
aHeaderTree.GetTreeListBox().Invalidate();
return 0;
}
-/* -----------------13.07.99 15:39-------------------
- --------------------------------------------------*/
IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn)
{
sal_Bool bLeft = pBtn == &aLeftPB;
@@ -950,9 +862,6 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn)
return 0;
}
-/*-- 14.06.99 13:11:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrSet) :
SfxTabPage(pParent, SW_RES(TP_TOX_SELECT), rAttrSet),
@@ -971,7 +880,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aCreateFromFL( this, SW_RES(FL_CREATEFROM )),
aFromHeadingsCB( this, SW_RES(CB_FROMHEADINGS )),
-// aChapterDlgPB( this, SW_RES(PB_CHAPTERDLG )),//#outline level,removed by zhaojianwei
aAddStylesCB( this, SW_RES(CB_ADDSTYLES )),
aAddStylesPB( this, SW_RES(PB_ADDSTYLES )),
@@ -1053,7 +961,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aTypeLB.SetSelectHdl(LINK(this, SwTOXSelectTabPage, TOXTypeHdl));
aAddStylesPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, AddStylesHdl));
- //aChapterDlgPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, ChapterHdl));//#outline level,removed by zhaojianwei
PopupMenu* pMenu = aAutoMarkPB.GetPopupMenu();
pMenu->SetActivateHdl(LINK(this, SwTOXSelectTabPage, MenuEnableHdl));
@@ -1084,17 +991,13 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aTypeLB.SelectEntryPos(0);
aTitleED.SaveValue();
}
-/*-- 14.06.99 13:11:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTOXSelectTabPage::~SwTOXSelectTabPage()
{
delete pIndexRes;
delete pIndexEntryWrapper;
}
-/* -----------------21.10.99 17:03-------------------
- --------------------------------------------------*/
void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh)
{
sal_uInt16 nUserTypeCount = rSh.GetTOXTypeCount(TOX_USER);
@@ -1106,22 +1009,18 @@ void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh)
for(sal_uInt16 nUser = 1; nUser < nUserTypeCount; nUser++)
{
nPos = aTypeLB.InsertEntry(rSh.GetTOXType(TOX_USER, nUser)->GetTypeName(), nPos);
- sal_uInt32 nEntryData = nUser << 8;
+ sal_uIntPtr nEntryData = nUser << 8;
nEntryData |= TO_USER;
aTypeLB.SetEntryData(nPos, (void*)nEntryData);
}
}
}
-/* -----------------14.06.99 13:10-------------------
- --------------------------------------------------*/
sal_Bool SwTOXSelectTabPage::FillItemSet( SfxItemSet& )
{
return sal_True;
}
-/* -----------------25.08.99 14:31-------------------
- --------------------------------------------------*/
long lcl_TOXTypesToUserData(CurTOXType eType)
{
sal_uInt16 nRet = TOX_INDEX;
@@ -1142,7 +1041,7 @@ long lcl_TOXTypesToUserData(CurTOXType eType)
}
return nRet;
}
-//-----------------------------------------------------------------
+
void SwTOXSelectTabPage::SelectType(TOXTypes eSet)
{
CurTOXType eCurType (eSet, 0);
@@ -1154,10 +1053,6 @@ void SwTOXSelectTabPage::SelectType(TOXTypes eSet)
TOXTypeHdl(&aTypeLB);
}
-/*-- 14.06.99 13:10:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-//-----------------------------------------------------------------
CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
{
CurTOXType eRet;
@@ -1176,13 +1071,11 @@ CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
case TO_OBJECT : eRet.eType = TOX_OBJECTS; break;
case TO_TABLE : eRet.eType = TOX_TABLES; break;
case TO_AUTHORITIES : eRet.eType = TOX_AUTHORITIES; break;
- default: DBG_ERROR("what a type?");
+ default: OSL_FAIL("what a type?");
}
return eRet;
}
-/* -----------------02.09.99 08:16-------------------
- --------------------------------------------------*/
void SwTOXSelectTabPage::ApplyTOXDescription()
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1231,7 +1124,6 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
if(TOX_CONTENT == aCurType.eType)
{
aFromHeadingsCB.Check( 0 != (nCreateType & nsSwTOXElement::TOX_OUTLINELEVEL) );
- //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei
aAddStylesCB.SetText(sAddStyleContent);
aAddStylesPB.Enable(aAddStylesCB.IsChecked());
}
@@ -1289,7 +1181,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
for( long nCnt = 0; nCnt < aSortAlgorithmLB.GetEntryCount(); ++nCnt )
{
const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData( (sal_uInt16)nCnt );
- DBG_ASSERT(pEntryData, "no entry data available");
+ OSL_ENSURE(pEntryData, "no entry data available");
if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm())
{
aSortAlgorithmLB.SelectEntryPos( (sal_uInt16)nCnt );
@@ -1297,9 +1189,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
}
}
}
-/* -----------------09.09.99 11:57-------------------
- --------------------------------------------------*/
void SwTOXSelectTabPage::FillTOXDescription()
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1406,13 +1296,11 @@ void SwTOXSelectTabPage::FillTOXDescription()
rDesc.SetLanguage(aLanguageLB.GetSelectLanguage());
const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData(
aSortAlgorithmLB.GetSelectEntryPos() );
- DBG_ASSERT(pEntryData, "no entry data available");
+ OSL_ENSURE(pEntryData, "no entry data available");
if(pEntryData)
rDesc.SetSortAlgorithm(*pEntryData);
}
-/* -----------------05.07.99 15:09-------------------
- --------------------------------------------------*/
void SwTOXSelectTabPage::Reset( const SfxItemSet& )
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1445,16 +1333,12 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet& )
TOXTypeHdl(&aTypeLB);
CheckBoxHdl(&aAddStylesCB);
}
-/*-- 14.06.99 13:10:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTOXSelectTabPage::ActivatePage( const SfxItemSet& )
{
//nothing to do
}
-/*-- 14.06.99 13:11:00---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwTOXSelectTabPage::DeactivatePage( SfxItemSet* _pSet )
{
if(_pSet)
@@ -1463,16 +1347,12 @@ int SwTOXSelectTabPage::DeactivatePage( SfxItemSet* _pSet )
FillTOXDescription();
return LEAVE_PAGE;
}
-/* -----------------14.06.99 13:10-------------------
- --------------------------------------------------*/
SfxTabPage* SwTOXSelectTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet)
{
return new SwTOXSelectTabPage(pParent, rAttrSet);
}
-/* -----------------14.06.99 13:10-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1495,7 +1375,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aAreaFL.Show( 0 != (nType & (TO_CONTENT|TO_ILLUSTRATION|TO_USER|TO_INDEX|TO_TABLE|TO_OBJECT)) );
aFromHeadingsCB.Show( 0 != (nType & (TO_CONTENT)) );
- // aChapterDlgPB.Show( 0 != (nType & (TO_CONTENT)) );//#outline level,removed by zhaojianwei
aAddStylesCB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) );
aAddStylesPB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) );
@@ -1527,13 +1406,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aSortAlgorithmFT.Show(bEnableSortLanguage);
aSortAlgorithmLB.Show(bEnableSortLanguage);
- //if(nType & TO_CONTENT) //#outline level,removed by zhaojianwei
- //{
- //Point aPos(aAddStylesPB.GetPosPixel());
- //aPos.X() = aChapterDlgPB.GetPosPixel().X();
- //aAddStylesPB.SetPosPixel(aPos);
- //}
- //else if( nType & TO_ILLUSTRATION )//<-removed end.
// initialize button positions
//#i111993# add styles button has two different positions
@@ -1570,8 +1442,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aKeyAsEntryCB.Show( 0 != (nType & TO_INDEX) );
aFromFileCB.Show( 0 != (nType & TO_INDEX) );
aAutoMarkPB.Show( 0 != (nType & TO_INDEX) );
-// aCreateAutoMarkPB.Show(nType &TO_INDEX);
-// aEditAutoMarkPB.Show(nType & TO_INDEX);
aIdxOptionsFL.Show( 0 != (nType & TO_INDEX) );
@@ -1592,9 +1462,7 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
ModifyHdl(0);
return 0;
}
-/* -----------------30.11.99 12:48-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, ModifyHdl, void*, EMPTYARG)
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1605,9 +1473,7 @@ IMPL_LINK(SwTOXSelectTabPage, ModifyHdl, void*, EMPTYARG)
}
return 0;
}
-/* -----------------05.07.99 10:13-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox )
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -1621,7 +1487,6 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox )
pBox->Check(sal_True);
}
aAddStylesPB.Enable(aAddStylesCB.IsChecked());
- //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei
}
if(TOX_USER == aCurType.eType)
{
@@ -1637,9 +1502,7 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox )
ModifyHdl(0);
return 0;
};
-/* -----------------14.07.99 14:21-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, RadioButtonHdl, RadioButton*, EMPTYARG )
{
sal_Bool bEnable = aFromCaptionsRB.IsChecked();
@@ -1650,9 +1513,7 @@ IMPL_LINK(SwTOXSelectTabPage, RadioButtonHdl, RadioButton*, EMPTYARG )
ModifyHdl(0);
return 0;
}
-/* -----------------------------06.06.01 09:33--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox)
{
Locale aLcl( SvxCreateLocale( aLanguageLB.GetSelectLanguage() ) );
@@ -1691,12 +1552,10 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox)
ModifyHdl(0);
return 0;
};
-/* -----------------14.06.99 13:10-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox)
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
switch((long)pBox->GetEntryData( pBox->GetSelectEntryPos() ))
{
case AREA_DOCUMENT : break;
@@ -1705,47 +1564,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox)
return 0;
}
-//#outline level, removed by zhaojianwei
-//It is no longer used!
-///* -----------------14.06.99 13:10-------------------
-//
-// --------------------------------------------------*/
-//IMPL_LINK(SwTOXSelectTabPage, ChapterHdl, PushButton*, pButton)
-//{
-// SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
-// SwWrtShell& rSh = pTOXDlg->GetWrtShell();
-//
-// SfxItemSet aTmp(rSh.GetView().GetPool(), FN_PARAM_1, FN_PARAM_1);
-// SwOutlineTabDialog* pDlg = new SwOutlineTabDialog(pButton, &aTmp, rSh);
-//
-// if(RET_OK == pDlg->Execute())
-// {
-// CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
-// SwForm* pForm = ((SwMultiTOXTabDialog*)GetTabDialog())->GetForm(aCurType);
-// // jetzt muss ueberprueft werden, ob dem sdbcx::Index Ueberschriftenvorlagen
-// // zugewiesen wurden
-// String sStr;
-// for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
-// {
-// sal_Bool bNum = !SwMultiTOXTabDialog::IsNoNum(rSh, pForm->GetTemplate( i + 1 ));
-// if(bNum)
-// {
-// //es gibt getrennte Resourcebereiche fuer die Inhaltsverzeichnisse
-// if(i < 5)
-// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT1 + i), sStr );
-// else
-// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT6 + i - 5), sStr );
-// pForm->SetTemplate( i + 1, sStr );
-// }
-// }
-//
-// }
-// delete pDlg;
-// return 0;
-//}
-/* -----------------14.06.99 13:10-------------------
-
- --------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton)
{
SwAddStylesDlg_Impl* pDlg = new SwAddStylesDlg_Impl(pButton,
@@ -1756,9 +1574,6 @@ IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton)
ModifyHdl(0);
return 0;
}
-/* -----------------------------19.01.00 10:59--------------------------------
-
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu)
{
@@ -1797,9 +1612,6 @@ IMPL_LINK(SwTOXSelectTabPage, MenuExecuteHdl, Menu*, pMenu)
return 0;
}
-/* -----------------16.06.99 10:46-------------------
-
- --------------------------------------------------*/
class SwTOXEdit : public Edit
{
SwFormToken aFormToken;
@@ -1838,19 +1650,18 @@ public:
void AdjustSize();
};
-//---------------------------------------------------
void SwTOXEdit::RequestHelp( const HelpEvent& rHEvt )
{
if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt))
Edit::RequestHelp(rHEvt);
}
-//---------------------------------------------------
+
void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
{
const Selection& rSel = GetSelection();
sal_uInt16 nTextLen = GetText().Len();
- if( (rSel.A() == rSel.B() &&
- !rSel.A() ) || rSel.A() == nTextLen )
+ if((rSel.A() == rSel.B() &&
+ !rSel.A()) || rSel.A() == nTextLen )
{
sal_Bool bCall = sal_False;
KeyCode aCode = rKEvt.GetKeyCode();
@@ -1871,9 +1682,7 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
}
Edit::KeyInput(rKEvt);
}
-/* -----------------16.07.99 12:41-------------------
- --------------------------------------------------*/
void SwTOXEdit::AdjustSize()
{
Size aSize(GetSizePixel());
@@ -1883,8 +1692,6 @@ void SwTOXEdit::AdjustSize()
SetSizePixel(aSize);
}
-//---------------------------------------------------
-//---------------------------------------------------
class SwTOXButton : public PushButton
{
SwFormToken aFormToken;
@@ -1955,7 +1762,6 @@ public:
break;
}
}
-//<---
sal_uInt16 GetChapterInfo() const{ return aFormToken.nChapterFormat;}
void SetOutlineLevel( sal_uInt16 nSet ) { aFormToken.nOutlineLevel = nSet;}//i53420
@@ -1963,7 +1769,7 @@ public:
void SetLinkEnd()
{
- DBG_ASSERT(TOKEN_LINK_START == aFormToken.eTokenType,
+ OSL_ENSURE(TOKEN_LINK_START == aFormToken.eTokenType,
"call SetLinkEnd for link start only!");
aFormToken.eTokenType = TOKEN_LINK_END;
aFormToken.sText.AssignAscii(SwForm::aFormLinkEnd);
@@ -1971,7 +1777,7 @@ public:
}
void SetLinkStart()
{
- DBG_ASSERT(TOKEN_LINK_END == aFormToken.eTokenType,
+ OSL_ENSURE(TOKEN_LINK_END == aFormToken.eTokenType,
"call SetLinkStart for link start only!");
aFormToken.eTokenType = TOKEN_LINK_START;
aFormToken.sText.AssignAscii(SwForm::aFormLinkStt);
@@ -1979,7 +1785,6 @@ public:
}
};
-//---------------------------------------------------
void SwTOXButton::KeyInput( const KeyEvent& rKEvt )
{
sal_Bool bCall = sal_False;
@@ -2005,23 +1810,19 @@ void SwTOXButton::KeyInput( const KeyEvent& rKEvt )
else
PushButton::KeyInput(rKEvt);
}
-//---------------------------------------------------
+
void SwTOXButton::RequestHelp( const HelpEvent& rHEvt )
{
if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt))
Button::RequestHelp(rHEvt);
}
-/* -----------------------------23.12.99 14:28--------------------------------
- ---------------------------------------------------------------------------*/
SwIdxTreeListBox::SwIdxTreeListBox(SwTOXEntryTabPage* pPar, const ResId& rResId) :
SvTreeListBox(pPar, rResId),
pParent(pPar)
{
}
-/* -----------------------------23.12.99 14:19--------------------------------
- ---------------------------------------------------------------------------*/
void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
{
if( rHEvt.GetMode() & HELPMODE_QUICK )
@@ -2059,7 +1860,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
else
SvTreeListBox::RequestHelp(rHEvt);
}
-//---------------------------------------------------
+
SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet) :
SfxTabPage(pParent, SW_RES(TP_TOX_ENTRY), rAttrSet),
aLevelFT(this, SW_RES(FT_LEVEL )),
@@ -2146,15 +1947,6 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
aTokenWIN.SetAccessibleRelationMemberOf(&aEntryFL);
aTokenWIN.SetAccessibleRelationLabeledBy(&aTokenFT);
- Image aSortUpHC(SW_RES(IMG_SORTUP_HC ));
- aFirstSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
- aSecondSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
- aThirdSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
-
- Image aSortDownHC(SW_RES(IMG_SORTDOWN_HC ));
- aFirstSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST);
- aSecondSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST);
- aThirdSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST);
FreeResource();
sLevelStr = aLevelFT.GetText();
@@ -2167,7 +1959,6 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
aLastTOXType.eType = (TOXTypes)USHRT_MAX;
aLastTOXType.nIndex = 0;
- //aLevelGBSize = aLevelGB.GetSizePixel();
aLevelFLSize = aLevelFT.GetSizePixel();
SetExchangeSupport();
@@ -2223,7 +2014,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
(aRelToStyleIdxPos.Y() - aAlphaDelimCB.GetPosPixel().Y());
aEditStylePB.Enable(sal_False);
-//get position for Numbering and other stuff
+ //get position for Numbering and other stuff
aChapterEntryFTPosition = aChapterEntryFT.GetPosPixel();
aEntryOutlineLevelFTPosition = aEntryOutlineLevelFT.GetPosPixel();
nBiasToEntryPoint = aEntryOutlineLevelNF.GetPosPixel().X() -
@@ -2259,7 +2050,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
aSecondKeyLB.SelectEntryPos(0);
aThirdKeyLB.SelectEntryPos(0);
}
-/* -----------------30.11.99 13:37-------------------
+/* --------------------------------------------------
pVoid is used as signal to change all levels of the example
--------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid)
@@ -2278,23 +2069,16 @@ IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid)
return 0;
}
-/*-- 16.06.99 10:47:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwTOXEntryTabPage::~SwTOXEntryTabPage()
{
}
-/*-- 16.06.99 10:47:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwTOXEntryTabPage::FillItemSet( SfxItemSet& )
{
// nothing to do
return sal_True;
}
-/*-- 16.06.99 10:47:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTOXEntryTabPage::Reset( const SfxItemSet& )
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -2319,27 +2103,21 @@ void SwTOXEntryTabPage::Reset( const SfxItemSet& )
aRelToStyleCB.Check(m_pCurrentForm->IsRelTabPos());
aCommaSeparatedCB.Check(m_pCurrentForm->IsCommaSeparated());
}
-/*-- 16.06.99 10:47:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_ChgWidth(Window& rWin, long nDiff)
{
Size aTempSz(rWin.GetSizePixel());
aTempSz.Width() += nDiff;
rWin.SetSizePixel(aTempSz);
}
-/* ----------------------------------------------------------------------
- -----------------------------------------------------------------------*/
void lcl_ChgXPos(Window& rWin, long nDiff)
{
Point aTempPos(rWin.GetPosPixel());
aTempPos.X() += nDiff;
rWin.SetPosPixel(aTempPos);
}
-/* ----------------------------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -2386,7 +2164,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
{
const SwTOXSortKey* pKey = pFType->GetSortKey(0);
aFirstKeyLB.SelectEntryPos(
- aFirstKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+ aFirstKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
aFirstSortUpRB.Check(pKey->bSortAscending);
aFirstSortDownRB.Check(!pKey->bSortAscending);
}
@@ -2394,7 +2172,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
{
const SwTOXSortKey* pKey = pFType->GetSortKey(1);
aSecondKeyLB.SelectEntryPos(
- aSecondKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+ aSecondKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
aSecondSortUpRB.Check(pKey->bSortAscending);
aSecondSortDownRB.Check(!pKey->bSortAscending);
}
@@ -2402,7 +2180,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
{
const SwTOXSortKey* pKey = pFType->GetSortKey(2);
aThirdKeyLB.SelectEntryPos(
- aThirdKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField));
+ aThirdKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField));
aThirdSortUpRB.Check(pKey->bSortAscending);
aThirdSortDownRB.Check(!pKey->bSortAscending);
}
@@ -2425,13 +2203,11 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
if(nDiff)
{
-// lcl_ChgWidth(aLevelFL, nDiff);
lcl_ChgWidth(aLevelFT, nDiff);
lcl_ChgWidth(aLevelLB, nDiff);
lcl_ChgXPos(aCharStyleFT, nDiff);
lcl_ChgXPos(aCharStyleLB, nDiff);
lcl_ChgWidth(aCharStyleLB, -nDiff);
- // lcl_ChgXPos(aEditStylePB, -nDiff);
lcl_ChgXPos(aFillCharFT, nDiff);
lcl_ChgXPos(aFillCharCB, nDiff);
lcl_ChgXPos(aTabPosFT, nDiff);
@@ -2514,8 +2290,6 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
aRelToStyleCB.SetPosPixel( bToxIsIndex ? aRelToStyleIdxPos
: aRelToStylePos );
-// aRecalcTabCB.Show( aCurType.eType == TOX_CONTENT);
-
aMainEntryStyleFT.Show( bToxIsIndex );
aMainEntryStyleLB.Show( bToxIsIndex );
aAlphaDelimCB.Show( bToxIsIndex );
@@ -2527,9 +2301,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
aTokenWIN.SetInvalid();
LevelHdl(&aLevelLB);
}
-/* -----------------30.11.99 15:04-------------------
- --------------------------------------------------*/
void SwTOXEntryTabPage::UpdateDescriptor()
{
WriteBackLevel();
@@ -2569,24 +2341,18 @@ void SwTOXEntryTabPage::UpdateDescriptor()
if(aCommaSeparatedCB.IsVisible())
pCurrentForm->SetCommaSeparated(aCommaSeparatedCB.IsChecked());
}
-/*-- 16.06.99 10:47:34---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwTOXEntryTabPage::DeactivatePage( SfxItemSet* /*pSet*/)
{
UpdateDescriptor();
return LEAVE_PAGE;
}
-/*-- 16.06.99 10:47:34---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage* SwTOXEntryTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet)
{
return new SwTOXEntryTabPage(pParent, rAttrSet);
}
-/*-- 16.06.99 10:47:35---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, EditStyleHdl, PushButton*, pBtn)
{
if( LISTBOX_ENTRY_NOTFOUND != aCharStyleLB.GetSelectEntryPos())
@@ -2605,9 +2371,7 @@ IMPL_LINK(SwTOXEntryTabPage, EditStyleHdl, PushButton*, pBtn)
}
return 0;
}
-/* -----------------04.10.99 11:34-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton)
{
sal_Bool bInsert = pButton == &aAuthInsertPB;
@@ -2625,7 +2389,7 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton)
else
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
+ OSL_ENSURE(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
if( WINDOW_EDIT != pCtrl->GetType() )
{
//fill it into the ListBox
@@ -2637,18 +2401,16 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton)
ModifyHdl(0);
return 0;
}
-/* -----------------------------17.01.00 13:44--------------------------------
- ---------------------------------------------------------------------------*/
void SwTOXEntryTabPage::PreTokenButtonRemoved(const SwFormToken& rToken)
{
//fill it into the ListBox
sal_uInt32 nData = rToken.nAuthorityField;
String sTemp(SW_RES(STR_AUTH_FIELD_START + nData));
sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTemp);
- aAuthFieldsLB.SetEntryData(nPos, (void*)(nData));
+ aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(nData));
}
-/*-- 16.06.99 10:47:35---------------------------------------------------
+/*-----------------------------------------------------------------------
This function inizializes the default value in the Token
put here the UI dependent initializations
@@ -2707,9 +2469,7 @@ IMPL_LINK(SwTOXEntryTabPage, InsertTokenHdl, PushButton*, pBtn)
ModifyHdl(0);
return 0;
}
-/* -----------------------------14.01.00 11:53--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, AllLevelsHdl, PushButton*, EMPTYARG)
{
//get current level
@@ -2725,9 +2485,6 @@ IMPL_LINK(SwTOXEntryTabPage, AllLevelsHdl, PushButton*, EMPTYARG)
return 0;
}
-/* -----------------02.12.99 12:40-------------------
-
- --------------------------------------------------*/
void SwTOXEntryTabPage::WriteBackLevel()
{
if(aTokenWIN.IsValid())
@@ -2738,9 +2495,7 @@ void SwTOXEntryTabPage::WriteBackLevel()
m_pCurrentForm->SetPattern(nLastLevel + 1, sNewToken );
}
}
-/*-- 16.06.99 10:47:35---------------------------------------------------
- -----------------------------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
{
if(bInLevelHdl)
@@ -2758,7 +2513,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
{
String sTmp(SW_RES(STR_AUTH_FIELD_START + i));
sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTmp);
- aAuthFieldsLB.SetEntryData(nPos, (void*)(i));
+ aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(i));
}
// #i21237#
@@ -2771,12 +2526,12 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
if(TOKEN_AUTHORITY == aToken.eTokenType)
{
sal_uInt32 nSearch = aToken.nAuthorityField;
- sal_uInt16 nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*) nSearch );
- DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
+ sal_uInt16 nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*)(sal_uIntPtr)nSearch );
+ OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
aAuthFieldsLB.RemoveEntry(nLstBoxPos);
}
- aIt++; // #i21237#
+ ++aIt; // #i21237#
}
aAuthFieldsLB.SelectEntryPos(0);
}
@@ -2784,9 +2539,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
pBox->GrabFocus();
return 0;
}
-/* -----------------20.10.99 13:16-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, SortKeyHdl, RadioButton*, pButton)
{
sal_Bool bEnable = &aSortContentRB == pButton;
@@ -2805,16 +2558,13 @@ IMPL_LINK(SwTOXEntryTabPage, SortKeyHdl, RadioButton*, pButton)
aThirdSortDownRB.Enable(bEnable);
return 0;
}
-/* -----------------01.07.99 12:21-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
{
if(pToken->sCharStyleName.Len())
aCharStyleLB.SelectEntry(pToken->sCharStyleName);
else
aCharStyleLB.SelectEntry(sNoCharStyle);
- //StyleSelectHdl(&aCharStyleLB);
String sEntry = aCharStyleLB.GetSelectEntry();
aEditStylePB.Enable(sEntry != sNoCharStyle);
@@ -2837,15 +2587,7 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
aChapterEntryLB.SelectEntryPos(2);
break;
}
-//<---
//i53420
-//move into position the fixed text
-// aEntryOutlineLevelFT.SetPosPixel( aEntryOutlineLevelFTPosition );
-// // then the entry
-// Point aPoint;
-// aPoint.Y() = aEntryOutlineLevelFTPosition.Y();
-// aPoint.X() = aEntryOutlineLevelFTPosition.X() + nBiasToEntryPoint;
-// aEntryOutlineLevelNF.SetPosPixel( aPoint );
aEntryOutlineLevelNF.SetValue(pToken->nOutlineLevel);
}
@@ -2853,14 +2595,6 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
//i53420
if(pToken->eTokenType == TOKEN_ENTRY_NO)
{
-//move into position the fixed text
-// aEntryOutlineLevelFT.SetPosPixel( aChapterEntryFTPosition );
-// // then the entry
-// Point aPoint;
-// aPoint.Y() = aChapterEntryFTPosition.Y();
-// aPoint.X() = aChapterEntryFTPosition.X() + nBiasToEntryPoint;
-// aEntryOutlineLevelNF.SetPosPixel( aPoint );
-
aEntryOutlineLevelNF.SetValue(pToken->nOutlineLevel);
sal_uInt16 nFormat = 0;
if( pToken->nChapterFormat == CF_NUM_NOPREPST_TITLE )
@@ -2941,9 +2675,7 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
return 0;
}
-/* -----------------01.07.99 12:36-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
{
String sEntry = pBox->GetSelectEntry();
@@ -2952,7 +2684,7 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
if(sEntry == sNoCharStyle)
sEntry.Erase();
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl)
{
if(WINDOW_EDIT == pCtrl->GetType())
@@ -2964,16 +2696,14 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
ModifyHdl(0);
return 0;
}
-/* -----------------------------11.01.00 12:54--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox)
{
sal_uInt16 nPos = pBox->GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
((SwTOXButton*)pCtrl)->SetChapterInfo(nPos);
@@ -2987,7 +2717,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField)
const sal_uInt16 nLevel = static_cast<sal_uInt8>(pField->GetValue());
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
((SwTOXButton*)pCtrl)->SetOutlineLevel(nLevel);
@@ -3002,7 +2732,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
{
((SwTOXButton*)pCtrl)->SetEntryNumberFormat(nPos);//i89791
@@ -3012,13 +2742,10 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
return 0;
}
-/* -----------------19.08.99 15:37-------------------
-
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+ OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
"no active style::TabStop control?");
if( pCtrl && WINDOW_EDIT != pCtrl->GetType() )
@@ -3029,13 +2756,11 @@ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
ModifyHdl(0);
return 0;
}
-/* -----------------09.09.99 15:37-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+ OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
"no active style::TabStop control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
@@ -3051,14 +2776,11 @@ IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox)
return 0;
}
-/*-- 16.06.99 10:47:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox)
{
//the most right style::TabStop is usually right aligned
Control* pCurCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(WINDOW_EDIT != pCurCtrl->GetType() &&
+ OSL_ENSURE(WINDOW_EDIT != pCurCtrl->GetType() &&
((SwTOXButton*)pCurCtrl)->GetFormToken().eTokenType == TOKEN_TAB_STOP,
"no style::TabStop selected!");
@@ -3072,9 +2794,7 @@ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox)
ModifyHdl(0);
return 0;
}
-/* -----------------16.06.99 11:00-------------------
- --------------------------------------------------*/
void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh)
{
SwDocShell* pDocSh = rSh.GetView().GetDocShell();
@@ -3092,9 +2812,7 @@ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh)
aMainEntryStyleLB.SelectEntry( SwStyleNameMapper::GetUIName(
RES_POOLCHR_IDX_MAIN_ENTRY, aEmptyStr ));
}
-/* -----------------------------23.12.99 14:23--------------------------------
- ---------------------------------------------------------------------------*/
String SwTOXEntryTabPage::GetLevelHelp(sal_uInt16 nLevel) const
{
String sRet;
@@ -3111,9 +2829,6 @@ String SwTOXEntryTabPage::GetLevelHelp(sal_uInt16 nLevel) const
}
return sRet;
}
-/* -----------------16.06.99 15:18-------------------
-
- --------------------------------------------------*/
SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) :
Window( pParent, rResId ),
@@ -3148,50 +2863,37 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) :
aLeftScrollWin.SetClickHdl(aLink);
aRightScrollWin.SetClickHdl(aLink);
}
-/* -----------------01.07.99 12:17-------------------
- --------------------------------------------------*/
SwTokenWindow::~SwTokenWindow()
{
-// for(sal_uInt16 i = GetItemCount(); i ; i--)
-// RemoveItem(i - 1);
-
- for( sal_uInt32 n = 0; n < aControlList.Count(); ++n )
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- Control* pControl = aControlList.GetObject( n );
+ Control* pControl = (*it);
pControl->SetGetFocusHdl( Link() );
pControl->SetLoseFocusHdl( Link() );
- }
-
- for( sal_uLong i = aControlList.Count(); i; )
- {
- Control* pControl = aControlList.Remove( --i );
delete pControl;
}
}
-/* -----------------16.06.99 13:56-------------------
- --------------------------------------------------*/
void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
{
SetActiveControl(0);
bValid = sal_True;
+
if(pForm)
{
//apply current level settings to the form
- for( sal_uLong i = aControlList.Count(); i; )
- {
- Control* pControl = aControlList.Remove( --i );
- delete pControl;
- }
+ for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter)
+ delete (*iter);
+
+ aControlList.clear();
}
+
nLevel = nL;
pForm = &rForm;
//now the display
if(nLevel < MAXLEVEL || rForm.GetTOXType() == TOX_AUTHORITIES)
{
- Size aToolBoxSize = GetSizePixel();
-
// #i21237#
SwFormTokens aPattern = pForm->GetPattern(nLevel + 1);
SwFormTokens::iterator aIt = aPattern.begin();
@@ -3204,7 +2906,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
if(TOKEN_TEXT == aToken.eTokenType)
{
- DBG_ASSERT(!bLastWasText, "text following text is invalid");
+ OSL_ENSURE(!bLastWasText, "text following text is invalid");
Control* pCtrl = InsertItem(aToken.sText, aToken);
bLastWasText = sal_True;
if(!GetActiveControl())
@@ -3240,7 +2942,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
bLastWasText = sal_False;
}
- aIt++; // #i21237#
+ ++aIt; // #i21237#
}
if(!bLastWasText)
{
@@ -3254,9 +2956,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
}
AdjustScrolling();
}
-/* -----------------19.08.99 13:00-------------------
- --------------------------------------------------*/
void SwTokenWindow::SetActiveControl(Control* pSet)
{
if( pSet != pActiveCtrl )
@@ -3278,28 +2978,30 @@ void SwTokenWindow::SetActiveControl(Control* pSet)
}
}
-/* -----------------17.06.99 09:53-------------------
-
- --------------------------------------------------*/
Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rToken)
{
Control* pRet = 0;
- Control* pLast = aControlList.Last();
Size aControlSize(GetOutputSizePixel());
- Point aControlPos;
- if( pLast )
+ Point aControlPos;
+
+ if(!aControlList.empty())
{
+ Control* pLast = *(aControlList.rbegin());
+
aControlSize = pLast->GetSizePixel();
aControlPos = pLast->GetPosPixel();
aControlPos.X() += aControlSize.Width();
}
+
if(TOKEN_TEXT == rToken.eTokenType)
{
SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken);
pEdit->SetPosPixel(aControlPos);
- aControlList.Insert(pEdit, aControlList.Count());
+
+ aControlList.push_back(pEdit);
+
pEdit->SetText(rText);
- Size aEditSize(aControlSize);
+ Size aEditSize(aControlSize);
aEditSize.Width() = pEdit->GetTextWidth(rText) + EDIT_MINWIDTH;
pEdit->SetSizePixel(aEditSize);
pEdit->SetModifyHdl(LINK(this, SwTokenWindow, EditResize ));
@@ -3312,14 +3014,15 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT
{
SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, rToken);
pButton->SetPosPixel(aControlPos);
- aControlList.Insert(pButton, aControlList.Count());
- Size aEditSize(aControlSize);
+
+ aControlList.push_back(pButton);
+
+ Size aEditSize(aControlSize);
aEditSize.Width() = pButton->GetTextWidth(rText) + 5;
-// pButton->SetControlBackground(aCtrlColor);
-// pButton->SetControlForeground(aTextColor);
pButton->SetSizePixel(aEditSize);
pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl));
pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl));
+
if(TOKEN_AUTHORITY != rToken.eTokenType)
pButton->SetText(aButtonTexts[rToken.eTokenType]);
else
@@ -3329,22 +3032,25 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT
(ToxAuthorityField)rToken.nAuthorityField));
pButton->SetText(sTmp.Copy(0, 2));
}
+
pButton->Show();
pRet = pButton;
}
+
return pRet;
}
-/* -----------------16.07.99 11:50-------------------
- --------------------------------------------------*/
void SwTokenWindow::InsertAtSelection(
const String& rText,
const SwFormToken& rToken)
{
- DBG_ASSERT(pActiveCtrl, "no active control!");
+ OSL_ENSURE(pActiveCtrl, "no active control!");
+
if(!pActiveCtrl)
return;
+
SwFormToken aToInsertToken(rToken);
+
if(TOKEN_LINK_START == aToInsertToken.eTokenType)
{
//determine if start or end of hyperlink is appropriate
@@ -3356,17 +3062,22 @@ void SwTokenWindow::InsertAtSelection(
//<insert> LS
//<insert> LE
//<insert>
- sal_Bool bPreStartLinkFound = sal_False; //
+ sal_Bool bPreStartLinkFound = sal_False;
sal_Bool bPreEndLinkFound = sal_False;
- const Control* pControl = aControlList.First();
+ const Control* pControl = 0;
const Control* pExchange = 0;
- while( pControl && pActiveCtrl != pControl )
+
+ ctrl_const_iterator it = aControlList.begin();
+ for( ; it != aControlList.end() && pActiveCtrl != (*it); ++it )
{
+ pControl = *it;
+
if( WINDOW_EDIT != pControl->GetType())
{
const SwFormToken& rNewToken =
((SwTOXButton*)pControl)->GetFormToken();
+
if( TOKEN_LINK_START == rNewToken.eTokenType )
{
bPreStartLinkFound = sal_True;
@@ -3383,19 +3094,22 @@ void SwTokenWindow::InsertAtSelection(
}
}
}
- pControl = aControlList.Next();
}
- sal_Bool bPostLinkEndFound = sal_False;
- sal_Bool bPostLinkStartFound = sal_False;
+ bool bPostLinkStartFound = false;
+
if(!bPreStartLinkFound && !bPreEndLinkFound)
- while(pControl)
+ {
+ for( ; it != aControlList.end(); ++it )
{
+ pControl = *it;
+
if( pControl != pActiveCtrl &&
WINDOW_EDIT != pControl->GetType())
{
const SwFormToken& rNewToken =
((SwTOXButton*)pControl)->GetFormToken();
+
if( TOKEN_LINK_START == rNewToken.eTokenType )
{
if(bPostLinkStartFound)
@@ -3410,15 +3124,11 @@ void SwTokenWindow::InsertAtSelection(
bPostLinkStartFound = sal_False;
pExchange = 0;
}
- else
- {
- bPostLinkEndFound = sal_True;
- }
break;
}
}
- pControl = aControlList.Next();
}
+ }
if(bPreStartLinkFound)
{
@@ -3428,7 +3138,7 @@ void SwTokenWindow::InsertAtSelection(
if(bPostLinkStartFound)
{
- DBG_ASSERT(pExchange, "no control to exchange?");
+ OSL_ENSURE(pExchange, "no control to exchange?");
if(pExchange)
{
((SwTOXButton*)pExchange)->SetLinkEnd();
@@ -3438,7 +3148,8 @@ void SwTokenWindow::InsertAtSelection(
if(bPreEndLinkFound)
{
- DBG_ASSERT(pExchange, "no control to exchange?");
+ OSL_ENSURE(pExchange, "no control to exchange?");
+
if(pExchange)
{
((SwTOXButton*)pExchange)->SetLinkStart();
@@ -3449,15 +3160,20 @@ void SwTokenWindow::InsertAtSelection(
//if the active control is text then insert a new button at the selection
//else replace the button
- sal_uInt32 nActivePos = aControlList.GetPos(pActiveCtrl);
- sal_uInt32 nInsertPos = nActivePos;
+ ctrl_iterator iterActive = std::find(aControlList.begin(),
+ aControlList.end(), pActiveCtrl);
+
+ ctrl_iterator iterInsert = iterActive;
Size aControlSize(GetOutputSizePixel());
+
if( WINDOW_EDIT == pActiveCtrl->GetType())
{
- nInsertPos++;
- Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection();
+ ++iterInsert;
+
+ Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection();
aSel.Justify();
+
String sEditText = ((SwTOXEdit*)pActiveCtrl)->GetText();
String sLeft = sEditText.Copy( 0, static_cast< sal_uInt16 >(aSel.A()) );
String sRight = sEditText.Copy( static_cast< sal_uInt16 >(aSel.B()),
@@ -3468,7 +3184,9 @@ void SwTokenWindow::InsertAtSelection(
SwFormToken aTmpToken(TOKEN_TEXT);
SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken);
- aControlList.Insert(pEdit, nActivePos + 1);
+
+ iterInsert = aControlList.insert(iterInsert, pEdit);
+
pEdit->SetText(sRight);
pEdit->SetSizePixel(aControlSize);
pEdit->AdjustSize();
@@ -3479,18 +3197,23 @@ void SwTokenWindow::InsertAtSelection(
}
else
{
- aControlList.Remove(pActiveCtrl);
+ aControlList.erase(iterActive);
pActiveCtrl->Hide();
delete pActiveCtrl;
}
//now the new button
SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken);
- aControlList.Insert(pButton, nInsertPos);
+
+ aControlList.insert(iterInsert, pButton);
+
pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl));
pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl));
+
if(TOKEN_AUTHORITY != aToInsertToken.eTokenType)
+ {
pButton->SetText(aButtonTexts[aToInsertToken.eTokenType]);
+ }
else
{
//use the first two chars as symbol
@@ -3499,7 +3222,7 @@ void SwTokenWindow::InsertAtSelection(
pButton->SetText(sTmp.Copy(0, 2));
}
- Size aEditSize(GetOutputSizePixel());
+ Size aEditSize(GetOutputSizePixel());
aEditSize.Width() = pButton->GetTextWidth(rText) + 5;
pButton->SetSizePixel(aEditSize);
pButton->Check(sal_True);
@@ -3508,101 +3231,112 @@ void SwTokenWindow::InsertAtSelection(
AdjustPositions();
}
-/* -----------------19.08.99 12:42-------------------
- --------------------------------------------------*/
void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall )
{
if(bInternalCall && TOX_AUTHORITIES == pForm->GetTOXType())
m_pParent->PreTokenButtonRemoved(pDel->GetFormToken());
- sal_uInt32 nActivePos = aControlList.GetPos(pDel);
- DBG_ASSERT(nActivePos != 0xffffffff, "Control does not exist!");
+ ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel);
+
+ OSL_ENSURE(it != aControlList.end(), "Control does not exist!");
+
// the two neighbours of the box must be merged
// the properties of the right one will be lost
- DBG_ASSERT(nActivePos && nActivePos < aControlList.Count() - 1,
+ OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1,
"Button at first or last position?");
- aControlList.Seek(nActivePos - 1);
- Control* pLeftEdit = aControlList.GetCurObject();
- aControlList.Seek(nActivePos + 1);
- Control* pRightEdit = aControlList.GetCurObject();
+
+ ctrl_iterator itLeft = it, itRight = it;
+ --itLeft;
+ ++itRight;
+ Control *pLeftEdit = *itLeft;
+ Control *pRightEdit = *itRight;
+
String sTemp(((SwTOXEdit*)pLeftEdit)->GetText());
sTemp += ((SwTOXEdit*)pRightEdit)->GetText();
((SwTOXEdit*)pLeftEdit)->SetText(sTemp);
((SwTOXEdit*)pLeftEdit)->AdjustSize();
- aControlList.Remove(pRightEdit);
+ aControlList.erase(itRight);
delete pRightEdit;
- aControlList.Remove(pDel);
+ aControlList.erase(it);
pActiveCtrl->Hide();
delete pActiveCtrl;
+
SetActiveControl(pLeftEdit);
AdjustPositions();
if(aModifyHdl.IsSet())
aModifyHdl.Call(0);
}
-/* -----------------16.07.99 12:39-------------------
-
- --------------------------------------------------*/
void SwTokenWindow::AdjustPositions()
{
- if(aControlList.Count() > 1)
+ if(aControlList.size() > 1)
{
- Control* pCtrl = aControlList.First();
- Point aNextPos = pCtrl->GetPosPixel();
+ ctrl_iterator it = aControlList.begin();
+ Control* pCtrl = *it;
+ ++it;
+
+ Point aNextPos = pCtrl->GetPosPixel();
aNextPos.X() += pCtrl->GetSizePixel().Width();
- while(0 != (pCtrl = aControlList.Next()))
+
+ for(; it != aControlList.end(); ++it)
{
+ pCtrl = *it;
pCtrl->SetPosPixel(aNextPos);
aNextPos.X() += pCtrl->GetSizePixel().Width();
}
+
AdjustScrolling();
}
};
-/* -----------------------------16.08.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
void SwTokenWindow::MoveControls(long nOffset)
{
// move the complete list
- Control* pCtrl = aControlList.First();
- do
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
+ Control *pCtrl = *it;
+
Point aPos = pCtrl->GetPosPixel();
aPos.X() += nOffset;
+
pCtrl->SetPosPixel(aPos);
- }while(0 != (pCtrl = aControlList.Next()));
+ }
}
-/* -----------------------------14.01.00 13:03--------------------------------
- ---------------------------------------------------------------------------*/
void SwTokenWindow::AdjustScrolling()
{
- if(aControlList.Count() > 1)
+ if(aControlList.size() > 1)
{
//validate scroll buttons
- Control* pLastCtrl = aControlList.Last();
- Control* pFirstCtrl = aControlList.First();
+ Control* pFirstCtrl = *(aControlList.begin());
+ Control* pLastCtrl = *(aControlList.rbegin());
+
long nSpace = aCtrlParentWin.GetSizePixel().Width();
long nWidth = pLastCtrl->GetPosPixel().X() - pFirstCtrl->GetPosPixel().X()
+ pLastCtrl->GetSizePixel().Width();
- sal_Bool bEnable = nWidth > nSpace;
+ bool bEnable = nWidth > nSpace;
+
//the active control must be visible
if(bEnable && pActiveCtrl)
{
- Point aActivePos(pActiveCtrl->GetPosPixel());
+ Point aActivePos(pActiveCtrl->GetPosPixel());
+
long nMove = 0;
+
if(aActivePos.X() < 0)
nMove = -aActivePos.X();
else if((aActivePos.X() + pActiveCtrl->GetSizePixel().Width()) > nSpace)
nMove = -(aActivePos.X() + pActiveCtrl->GetSizePixel().Width() - nSpace);
+
if(nMove)
MoveControls(nMove);
- aLeftScrollWin.Enable(aControlList.First()->GetPosPixel().X() < 0);
- Control* pCtrl = aControlList.Last();
- aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace);
+
+ aLeftScrollWin.Enable(pFirstCtrl->GetPosPixel().X() < 0);
+
+ aRightScrollWin.Enable((pLastCtrl->GetPosPixel().X() + pLastCtrl->GetSizePixel().Width()) > nSpace);
}
else
{
@@ -3610,150 +3344,178 @@ void SwTokenWindow::AdjustScrolling()
{
//if the control fits into the space then the first control must be at postion 0
long nFirstPos = pFirstCtrl->GetPosPixel().X();
+
if(nFirstPos != 0)
MoveControls(-nFirstPos);
}
- aRightScrollWin.Enable(sal_False);
- aLeftScrollWin.Enable(sal_False);
+
+ aRightScrollWin.Enable(false);
+ aLeftScrollWin.Enable(false);
}
}
}
-/* -----------------------------14.01.00 13:57--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn )
{
- if(aControlList.Count())
- {
- const long nSpace = aCtrlParentWin.GetSizePixel().Width();
+ if(aControlList.empty())
+ return 0;
+
+ const long nSpace = aCtrlParentWin.GetSizePixel().Width();
#if OSL_DEBUG_LEVEL > 1
//find all start/end positions and print it
String sMessage(String::CreateFromAscii("Space: "));
sMessage += String::CreateFromInt32(nSpace);
sMessage += String::CreateFromAscii(" | ");
- Control* pDebugCtrl = aControlList.First();
- do
+
+ for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
+ Control *pDebugCtrl = *it;
+
long nDebugXPos = pDebugCtrl->GetPosPixel().X();
long nDebugWidth = pDebugCtrl->GetSizePixel().Width();
+
sMessage += String::CreateFromInt32( nDebugXPos );
sMessage += String::CreateFromAscii(" ");
sMessage += String::CreateFromInt32(nDebugXPos + nDebugWidth);
sMessage += String::CreateFromAscii(" | ");
-
- }while(0 != (pDebugCtrl = aControlList.Next()));
+ }
#endif
- long nMove = 0;
- if(pBtn == &aLeftScrollWin)
+ long nMove = 0;
+ if(pBtn == &aLeftScrollWin)
+ {
+ //find the first completely visible control (left edge visible)
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- //find the first completely visible control (left edge visible)
- for(sal_uInt16 i = 0; i < aControlList.Count(); i++ )
+ Control *pCtrl = *it;
+
+ long nXPos = pCtrl->GetPosPixel().X();
+
+ if (nXPos >= 0)
{
- Control* pCtrl = aControlList.GetObject(i);
- long nXPos = pCtrl->GetPosPixel().X();
- if(nXPos >= 0)
+ if (it == aControlList.begin())
{
- if(!i)
- //move the current control to the left edge
- nMove = -nXPos;
- else
- //move the left neighbor to the start position
- nMove = -aControlList.GetObject(i - 1)->GetPosPixel().X();
- break;
+ //move the current control to the left edge
+ nMove = -nXPos;
}
+ else
+ {
+ //move the left neighbor to the start position
+ ctrl_iterator itLeft = it;
+ --itLeft;
+ Control *pLeft = *itLeft;
+
+ nMove = -pLeft->GetPosPixel().X();
+ }
+
+ break;
}
}
- else
+ }
+ else
+ {
+ //find the first completely visible control (right edge visible)
+ for (ctrl_reverse_iterator it = aControlList.rbegin(); it != aControlList.rend(); ++it)
{
- //find the first completely visible control (left edge visible)
- for(sal_uLong i = aControlList.Count(); i; i-- )
+ Control *pCtrl = *it;
+
+ long nCtrlWidth = pCtrl->GetSizePixel().Width();
+ long nXPos = pCtrl->GetPosPixel().X() + nCtrlWidth;
+
+ if (nXPos <= nSpace)
{
- Control* pCtrl = aControlList.GetObject(i - 1);
- long nCtrlWidth = pCtrl->GetSizePixel().Width();
- long nXPos = pCtrl->GetPosPixel().X() + nCtrlWidth;
- if(nXPos <= nSpace)
+ if (it != aControlList.rbegin())
{
- if( i < aControlList.Count())
- {
- //move the right neighbor to the right edge right aligned
- Control* pRight = aControlList.GetObject(i);
- nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width();
- }
- break;
+ //move the right neighbor to the right edge right aligned
+ ctrl_reverse_iterator itRight = it;
+ --it;
+ Control *pRight = *itRight;
+ nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width();
}
- }
- //move it left until it's completely visible
+ break;
+ }
}
- if(nMove)
+
+ //move it left until it's completely visible
+ }
+
+ if(nMove)
+ {
+ // move the complete list
+
+ Control *pCtrl = 0;
+
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- // move the complete list
- Control* pCtrl = aControlList.First();
- do
- {
- Point aPos = pCtrl->GetPosPixel();
- aPos.X() += nMove;
- pCtrl->SetPosPixel(aPos);
- }while(0 != (pCtrl = aControlList.Next()));
- aLeftScrollWin.Enable(aControlList.First()->GetPosPixel().X() < 0);
- pCtrl = aControlList.Last();
- aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace);
+ pCtrl = *it;
+
+ Point aPos = pCtrl->GetPosPixel();
+ aPos.X() += nMove;
+ pCtrl->SetPosPixel(aPos);
+ }
+
+ pCtrl = *(aControlList.begin());
+ aLeftScrollWin.Enable(pCtrl->GetPosPixel().X() < 0);
+
+ pCtrl = *(aControlList.rbegin());
+ aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace);
#if OSL_DEBUG_LEVEL > 1
- sMessage.AppendAscii("Move: ");
- sMessage += String::CreateFromInt32(nMove);
- GetParent()->GetParent()->GetParent()->SetText(sMessage);
+ sMessage.AppendAscii("Move: ");
+ sMessage += String::CreateFromInt32(nMove);
+ GetParent()->GetParent()->GetParent()->SetText(sMessage);
#endif
- }
}
+
return 0;
}
-/* -----------------17.06.99 11:59-------------------
- --------------------------------------------------*/
String SwTokenWindow::GetPattern() const
{
String sRet;
- const Control* pControl = ((SwTokenWindow*)this)->aControlList.First();
- while(pControl)
+
+ for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType()
- ? ((SwTOXEdit*)pControl)->GetFormToken()
- : ((SwTOXButton*)pControl)->GetFormToken();
+ const Control *pCtrl = *it;
+
+ const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT
+ ? ((SwTOXEdit*)pCtrl)->GetFormToken()
+ : ((SwTOXButton*)pCtrl)->GetFormToken();
//TODO: prevent input of TOX_STYLE_DELIMITER in KeyInput
sRet += rNewToken.GetString();
-
- pControl = ((SwTokenWindow*)this)->aControlList.Next();
}
+
return sRet;
}
-/* -----------------19.08.99 11:27-------------------
+/* --------------------------------------------------
Description: Check if a control of the specified
TokenType is already contained in the list
--------------------------------------------------*/
sal_Bool SwTokenWindow::Contains(FormTokenType eSearchFor) const
{
- sal_Bool bRet = sal_False;
- const Control* pControl = ((SwTokenWindow*)this)->aControlList.First();
- while(pControl)
+ bool bRet = false;
+
+ for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType()
- ? ((SwTOXEdit*)pControl)->GetFormToken()
- : ((SwTOXButton*)pControl)->GetFormToken();
+ const Control *pCtrl = *it;
- if(eSearchFor == rNewToken.eTokenType)
+ const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT
+ ? ((SwTOXEdit*)pCtrl)->GetFormToken()
+ : ((SwTOXButton*)pCtrl)->GetFormToken();
+
+ if (eSearchFor == rNewToken.eTokenType)
{
- bRet = sal_True;
+ bRet = true;
break;
}
- pControl = ((SwTokenWindow*)this)->aControlList.Next();
}
+
return bRet;
}
-//---------------------------------------------------
+
sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl,
const SwFormToken& rToken,
const HelpEvent& rHEvt)
@@ -3775,8 +3537,6 @@ sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl,
Rectangle aItemRect( aPos, pCtrl->GetSizePixel() );
if(rToken.eTokenType == TOKEN_TAB_STOP )
{
-// sEntry += '\n';
-// sEntry += rToken.nTabStopPosition;
}
else
{
@@ -3801,9 +3561,7 @@ sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl,
}
return bRet;
}
-/* -----------------------------14.01.00 12:22--------------------------------
- ---------------------------------------------------------------------------*/
void SwTokenWindow::Resize()
{
Size aCompleteSize(GetOutputSizePixel());
@@ -3821,9 +3579,6 @@ void SwTokenWindow::Resize()
aCtrlParentWin.SetSizePixel(aMiddleSize);
}
-/* -----------------16.06.99 15:23-------------------
-
- --------------------------------------------------*/
IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit)
{
((SwTOXEdit*)pEdit)->AdjustSize();
@@ -3832,106 +3587,120 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit)
aModifyHdl.Call(0);
return 0;
}
-/* -----------------16.06.99 15:56-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*, pEdit)
{
- sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pEdit);
- if( (nPos && !pEdit->IsNextControl()) ||
- (nPos < aControlList.Count() - 1 && pEdit->IsNextControl()))
+ ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pEdit);
+
+ if (it == aControlList.end())
+ return 0;
+
+ ctrl_iterator itTest = it;
+ ++itTest;
+
+ if ((it != aControlList.begin() && !pEdit->IsNextControl()) ||
+ (itTest != aControlList.end() && pEdit->IsNextControl()))
{
- aControlList.Seek(nPos);
- Control* pNextPrev = pEdit->IsNextControl() ? aControlList.Next() : aControlList.Prev();
- nPos += pEdit->IsNextControl() ? 1 : -1;
- pNextPrev->GrabFocus();
- ((SwTOXButton*)pNextPrev)->Check();
+ ctrl_iterator iterFocus = it;
+ pEdit->IsNextControl() ? ++iterFocus : --iterFocus;
+
+ Control *pCtrlFocus = *iterFocus;
+ pCtrlFocus->GrabFocus();
+ reinterpret_cast<SwTOXButton*>(pCtrlFocus)->Check();
+
AdjustScrolling();
}
+
return 0;
}
-/* -----------------17.06.99 08:58-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
{
- for(sal_uInt16 i = 0; i < aControlList.Count(); i++)
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- Control* pControl = aControlList.First();
- while(pControl)
- {
- if(WINDOW_EDIT != pControl->GetType() )
- ((SwTOXButton*)pControl)->Check(sal_False);
- pControl = aControlList.Next();
- }
+ Control *pCtrl = *it;
+
+ if (pCtrl && pCtrl->GetType() != WINDOW_EDIT)
+ reinterpret_cast<SwTOXButton*>(pCtrl)->Check(false);
}
+
SetActiveControl(pEdit);
+
return 0;
}
-/* -----------------17.06.99 10:05-------------------
- --------------------------------------------------*/
IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn )
{
- sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pBtn);
- if( (nPos && !pBtn->IsNextControl()) ||
- (nPos < aControlList.Count() - 1 && pBtn->IsNextControl()))
+ ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pBtn);
+
+ if (it == aControlList.end())
+ return 0;
+
+ ctrl_iterator itTest = it;
+ ++itTest;
+
+ if (!pBtn->IsNextControl() || (itTest != aControlList.end() && pBtn->IsNextControl()))
{
- aControlList.Seek(nPos);
- sal_Bool bNext = pBtn->IsNextControl();
- Control* pNextPrev = bNext ? aControlList.Next() : aControlList.Prev();
- pNextPrev->GrabFocus();
- Selection aSel(0, 0);
- if(!bNext)
+ bool isNext = pBtn->IsNextControl();
+
+ ctrl_iterator iterFocus = it;
+ isNext ? ++iterFocus : --iterFocus;
+
+ Control *pCtrlFocus = *iterFocus;
+ pCtrlFocus->GrabFocus();
+ Selection aSel(0,0);
+
+ if (!isNext)
{
- sal_uInt16 nLen = ((SwTOXEdit*)pNextPrev)->GetText().Len();
+ sal_uInt16 nLen = reinterpret_cast<SwTOXEdit*>(pCtrlFocus)->GetText().Len();
+
aSel.A() = nLen;
aSel.B() = nLen;
}
- ((SwTOXEdit*)pNextPrev)->SetSelection(aSel);
- pBtn->Check(sal_False);
+
+ reinterpret_cast<SwTOXEdit*>(pCtrlFocus)->SetSelection(aSel);
+
+ pBtn->Check(false);
+
AdjustScrolling();
}
+
return 0;
}
-/* -----------------17.06.99 10:04-------------------
-
- --------------------------------------------------*/
IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
{
- for(sal_uInt16 i = 0; i < aControlList.Count(); i++)
+ for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
- Control* pControl = aControlList.First();
- while(pControl)
- {
- if(WINDOW_EDIT != pControl->GetType() )
- ((SwTOXButton*)pControl)->Check(pBtn == pControl);
- pControl = aControlList.Next();
- }
+ Control *pControl = *it;
+
+ if (pControl && WINDOW_EDIT != pControl->GetType())
+ reinterpret_cast<SwTOXButton*>(pControl)->Check(pBtn == pControl);
}
+
SetActiveControl(pBtn);
+
return 0;
}
-/* -----------------------------28.01.2002 12:22------------------------------
- ---------------------------------------------------------------------------*/
void SwTokenWindow::GetFocus()
{
if(GETFOCUS_TAB & GetGetFocusFlags())
{
- Control* pFirst = aControlList.First();
- if(pFirst)
- {
- pFirst->GrabFocus();
- SetActiveControl(pFirst);
- AdjustScrolling();
- }
+ if (!aControlList.empty())
+ {
+ Control *pFirst = *aControlList.begin();
+
+ if (pFirst)
+ {
+ pFirst->GrabFocus();
+ SetActiveControl(pFirst);
+ AdjustScrolling();
+ }
+ }
}
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrSet ) :
SfxTabPage(pParent, SW_RES(TP_TOX_STYLES), rAttrSet),
aFormatFL(this, SW_RES(FL_FORMAT )),
@@ -3948,8 +3717,6 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS
SetExchangeSupport( sal_True );
- aAssignBT.SetModeImage( Image( SW_RES( IMG_ONE_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
-
aEditStyleBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, EditStyleHdl));
aAssignBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, AssignHdl));
aStdBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, StdHdl));
@@ -3962,43 +3729,35 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS
aEditStyleBT.SetAccessibleRelationMemberOf(&aFormatFL);
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
SwTOXStylesTabPage::~SwTOXStylesTabPage()
{
delete m_pCurrentForm;
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwTOXStylesTabPage::FillItemSet( SfxItemSet& )
{
return sal_True;
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
void SwTOXStylesTabPage::Reset( const SfxItemSet& rSet )
{
ActivatePage(rSet);
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
{
m_pCurrentForm = new SwForm(GetForm());
aParaLayLB.Clear();
aLevelLB.Clear();
- // kein Hyperlink fuer Benutzerverzeichnisse
+ // not hyperlink for user directories
sal_uInt16 i, nSize = m_pCurrentForm->GetFormMax();
- // form-Pattern anzeigen ohne Titel
+ // display form pattern without title
- //1. TemplateEntry anzeigen
+ // display 1st TemplateEntry
String aStr( SW_RES( STR_TITLE ));
if( m_pCurrentForm->GetTemplate( 0 ).Len() )
{
@@ -4032,7 +3791,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
aLevelLB.InsertEntry( aCpy );
}
- // Templates initialisieren
+ // initialise templates
const SwTxtFmtColl *pColl;
SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell();
const sal_uInt16 nSz = rSh.GetTxtFmtCollCount();
@@ -4041,7 +3800,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
if( !(pColl = &rSh.GetTxtFmtColl( i ))->IsDefault() )
aParaLayLB.InsertEntry( pColl->GetName() );
- // Pool-Collections abfragen und fuer das Verzeichnis setzen
+ // query pool collections and set them for the directory
for( i = 0; i < m_pCurrentForm->GetFormMax(); ++i )
{
aStr = m_pCurrentForm->GetTemplate( i );
@@ -4052,45 +3811,37 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
EnableSelectHdl(&aParaLayLB);
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
+
int SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/ )
{
GetForm() = *m_pCurrentForm;
return LEAVE_PAGE;
}
-/* -----------------25.03.99 15:17-------------------
- *
- * --------------------------------------------------*/
SfxTabPage* SwTOXStylesTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwTOXStylesTabPage(pParent, rAttrSet);
}
-/* -----------------26.03.99 12:47-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwTOXStylesTabPage, EditStyleHdl, Button *, pBtn )
{
if( LISTBOX_ENTRY_NOTFOUND != aParaLayLB.GetSelectEntryPos())
{
SfxStringItem aStyle(SID_STYLE_EDIT, aParaLayLB.GetSelectEntry());
SfxUInt16Item aFamily(SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA);
-// SwPtrItem aShell(FN_PARAM_WRTSHELL, pWrtShell);
Window* pDefDlgParent = Application::GetDefDialogParent();
Application::SetDefDialogParent( pBtn );
SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell();
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(
SID_STYLE_EDIT, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_MODAL,
- &aStyle, &aFamily/*, &aShell*/, 0L);
+ &aStyle, &aFamily, 0L);
Application::SetDefDialogParent( pDefDlgParent );
}
return 0;
}
/*--------------------------------------------------------------------
- Beschreibung: Vorlagen zuweisen
+ Description: allocate templates
--------------------------------------------------------------------*/
IMPL_LINK( SwTOXStylesTabPage, AssignHdl, Button *, EMPTYARG )
{
@@ -4118,9 +3869,7 @@ IMPL_LINK( SwTOXStylesTabPage, AssignHdl, Button *, EMPTYARG )
}
return 0;
}
-/* -----------------26.03.99 09:10-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwTOXStylesTabPage, StdHdl, Button *, EMPTYARG )
{
sal_uInt16 nPos = aLevelLB.GetSelectEntryPos();
@@ -4137,9 +3886,7 @@ IMPL_LINK( SwTOXStylesTabPage, StdHdl, Button *, EMPTYARG )
}
return 0;
}
-/* -----------------26.03.99 09:11-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK_INLINE_START( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG )
{
String aTmpName( aParaLayLB.GetSelectEntry() );
@@ -4151,12 +3898,12 @@ IMPL_LINK_INLINE_START( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG )
return 0;
}
IMPL_LINK_INLINE_END( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG )
+
/*--------------------------------------------------------------------
- Beschreibung: nur wenn selektiert enable
+ Description: enable only when selected
--------------------------------------------------------------------*/
IMPL_LINK( SwTOXStylesTabPage, EnableSelectHdl, ListBox *, EMPTYARG )
{
- //UpdatePattern();
aStdBT.Enable(aLevelLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND);
SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell();
@@ -4167,9 +3914,7 @@ IMPL_LINK( SwTOXStylesTabPage, EnableSelectHdl, ListBox *, EMPTYARG )
aEditStyleBT.Enable(aParaLayLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND );
return 0;
}
-/* -----------------------------18.01.00 16:54--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTOXStylesTabPage, ModifyHdl, void*, EMPTYARG)
{
SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
@@ -4180,9 +3925,7 @@ IMPL_LINK(SwTOXStylesTabPage, ModifyHdl, void*, EMPTYARG)
}
return 0;
}
-/******************************************************************************
-******************************************************************************/
#define ITEM_SEARCH 1
#define ITEM_ALTERNATIVE 2
#define ITEM_PRIM_KEY 3
@@ -4223,9 +3966,9 @@ SwEntryBrowseBox::SwEntryBrowseBox(Window* pParent, const ResId& rId,
xCheckController = new ::svt::CheckBoxCellController(&aCellCheckBox);
//////////////////////////////////////////////////////////////////////
- // HACK: BrowseBox invalidiert nicht ihre Childs, wie es eigentlich sein sollte.
- // Deshalb wird WB_CLIPCHILDREN zurueckgesetzt, wodurch das Invalidieren
- // der Childs erzwungen wird.
+ // HACK: BrowseBox doesn't invalidate its childs, how it should be.
+ // That's why WB_CLIPCHILDREN is reset in order to enforce the
+ // childs' invalidation
WinBits aStyle = GetStyle();
if( aStyle & WB_CLIPCHILDREN )
{
@@ -4251,17 +3994,13 @@ SwEntryBrowseBox::SwEntryBrowseBox(Window* pParent, const ResId& rId,
HIB_STDSTYLE, HEADERBAR_APPEND );
}
-/* -----------------------------19.01.00 11:29--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwEntryBrowseBox::SeekRow( long nRow )
{
nCurrentRow = nRow;
return sal_True;
}
-/* -----------------------------19.01.00 15:32--------------------------------
- ---------------------------------------------------------------------------*/
String SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
{
const String* pRet = &aEmptyStr;
@@ -4282,9 +4021,6 @@ String SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
return *pRet;
}
-/* -----------------------------19.01.00 11:29--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
const Rectangle& rRect, sal_uInt16 nColumnId) const
{
@@ -4292,16 +4028,12 @@ void SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
rDev.DrawText( rRect, sPaint, nStyle );
}
-/* -----------------------------19.01.00 14:51--------------------------------
- ---------------------------------------------------------------------------*/
::svt::CellController* SwEntryBrowseBox::GetController(long /*nRow*/, sal_uInt16 nCol)
{
return nCol < ITEM_CASE ? xController : xCheckController;
}
-/* -----------------------------19.01.00 15:36--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwEntryBrowseBox::SaveModified()
{
SetModified();
@@ -4345,9 +4077,7 @@ sal_Bool SwEntryBrowseBox::SaveModified()
}
return sal_True;
}
-/* -----------------------------19.01.00 14:32--------------------------------
- ---------------------------------------------------------------------------*/
void SwEntryBrowseBox::InitController(
::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol)
{
@@ -4366,9 +4096,7 @@ void SwEntryBrowseBox::InitController(
rTxt == sYes );
}
}
-/* -----------------------------19.01.00 12:19--------------------------------
- ---------------------------------------------------------------------------*/
void SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
{
AutoMarkEntry* pToInsert = 0;
@@ -4421,9 +4149,7 @@ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
aEntryArr.Insert(pToInsert, aEntryArr.Count());
RowInserted(0, aEntryArr.Count() + 1, sal_True);
}
-/* -----------------------------19.01.00 12:19--------------------------------
- ---------------------------------------------------------------------------*/
void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr)
{
//check if the current controller is modified
@@ -4463,9 +4189,7 @@ void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr)
rOutStr.WriteByteStringLine( sWrite, eTEnc );
}
}
-/* -----------------------------21.01.00 11:49--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwEntryBrowseBox::IsModified()const
{
if(bModified)
@@ -4481,9 +4205,7 @@ sal_Bool SwEntryBrowseBox::IsModified()const
pController = xCheckController;
return pController ->IsModified();
}
-/* -----------------------------19.01.00 11:29--------------------------------
- ---------------------------------------------------------------------------*/
SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(Window* pParent, const String& rAutoMarkURL,
const String& rAutoMarkType, sal_Bool bCreate) :
ModalDialog(pParent, SW_RES(DLG_CREATE_AUTOMARK)),
@@ -4518,15 +4240,11 @@ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(Window* pParent, const String& rAutoMarkU
if(bError)
EndDialog(RET_CANCEL);
}
-/* -----------------------------19.01.00 11:12--------------------------------
- ---------------------------------------------------------------------------*/
SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl()
{
}
-/* -----------------------------19.01.00 16:43--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwAutoMarkDlg_Impl, OkHdl, OKButton*, EMPTYARG)
{
sal_Bool bError = sal_False;
@@ -4551,3 +4269,4 @@ IMPL_LINK(SwAutoMarkDlg_Impl, OkHdl, OKButton*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc
index 4a3457b3ce81..b6170bf53176 100644
--- a/sw/source/ui/index/cnttab.hrc
+++ b/sw/source/ui/index/cnttab.hrc
@@ -223,8 +223,6 @@
#define LB_LANGUAGE 146
#define FT_SORTALG 147
#define LB_SORTALG 148
-#define IMG_SORTUP_HC 149
-#define IMG_SORTDOWN_HC 150
#define ST_NO_BRACKET 151
#define FT_LEVEL_OL 152
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 98e40aa4f9aa..821a2c7d4505 100755..100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -964,16 +964,6 @@ TabPage TP_TOX_ENTRY
Border = TRUE;
DropDown = TRUE;
};
- Image IMG_SORTUP_HC
- {
- ImageBitmap = Bitmap{File = "sch10712.bmp"; };
- MaskColor = IMAGE_MASK_COLOR ;
- };
- Image IMG_SORTDOWN_HC
- {
- ImageBitmap = Bitmap{File = "sch10713.bmp"; };
- MaskColor = IMAGE_MASK_COLOR ;
- };
ImageRadioButton RB_SORTUP1
{
HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTUP1";
diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx
index 24a3c7ddf91e..8b27ef6b1f5f 100644
--- a/sw/source/ui/index/idxmrk.cxx
+++ b/sw/source/ui/index/idxmrk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <hintids.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#define _SVSTDARR_STRINGSSORT
#include <svl/svstdarr.hxx>
#include <comphelper/processfactory.hxx>
@@ -43,9 +42,7 @@
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <svl/stritem.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/dispatch.hxx>
#include <svl/eitem.hxx>
#include <svtools/txtcmp.hxx>
@@ -56,20 +53,12 @@
#include <idxmrk.hxx>
#include <txttxmrk.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <multmrk.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
-#ifndef _CMDID_H
+#include <swundo.hxx> // for Undo-Ids
#include <cmdid.h>
-#endif
-#ifndef _INDEX_HRC
#include <index.hrc>
-#endif
-#ifndef _IDXMRK_HRC
#include <idxmrk.hrc>
-#endif
#include <swmodule.hxx>
#include <fldmgr.hxx>
#include <fldbas.hxx>
@@ -79,10 +68,6 @@
#include <ndtxt.hxx>
#include <breakit.hxx>
-
-/* -----------------07.09.99 08:15-------------------
-
- --------------------------------------------------*/
SFX_IMPL_CHILDWINDOW(SwInsertIdxMarkWrapper, FN_INSERT_IDX_ENTRY_DLG)
SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow,
@@ -92,17 +77,15 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow,
SfxChildWindow(pParentWindow, nId)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pAbstDlg = pFact->CreateIndexMarkFloatDlg( DLG_INSIDXMARK , pBindings, this, pParentWindow, pInfo );
- DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
pWindow = pAbstDlg->GetWindow();
pWindow->Show(); // at this point,because before pSh has to be initialized in ReInitDlg()
// -> Show() will invoke StateChanged() and save pos
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
}
-/* -----------------07.09.99 09:14-------------------
- --------------------------------------------------*/
SfxChildWinInfo SwInsertIdxMarkWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
@@ -115,10 +98,6 @@ void SwInsertIdxMarkWrapper::ReInitDlg(SwWrtShell& rWrtShell)
pAbstDlg->ReInitDlg(rWrtShell);
}
-
-/* -----------------07.09.99 08:15-------------------
-
- --------------------------------------------------*/
SFX_IMPL_CHILDWINDOW(SwInsertAuthMarkWrapper, FN_INSERT_AUTH_ENTRY_DLG)
SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow,
@@ -128,26 +107,23 @@ SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow,
SfxChildWindow(pParentWindow, nId)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pAbstDlg = pFact->CreateAuthMarkFloatDlg( DLG_INSAUTHMARK, pBindings, this, pParentWindow, pInfo );
- DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
pWindow = pAbstDlg->GetWindow();
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
}
-/* -----------------07.09.99 09:14-------------------
- --------------------------------------------------*/
SfxChildWinInfo SwInsertAuthMarkWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
return aInfo;
}
-/* -----------------19.10.99 11:16-------------------
- --------------------------------------------------*/
void SwInsertAuthMarkWrapper::ReInitDlg(SwWrtShell& rWrtShell)
{
pAbstDlg->ReInitDlg(rWrtShell);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src
index fb2680797c7e..31c2ee7037f8 100644
--- a/sw/source/ui/index/idxmrk.src
+++ b/sw/source/ui/index/idxmrk.src
@@ -440,7 +440,6 @@ String STR_IDXMRK_EDIT
};
String STR_IDXMRK_INSERT
{
- /* ### ACHTUNG: Neuer Text in Resource? Verzeichniseintrag einfügen : Verzeichniseintrag einf³gen */
Text [ en-US ] = "Insert Index Entry" ;
};
diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx
index 0433f83a2a18..7b49b69fc027 100644
--- a/sw/source/ui/index/multmrk.cxx
+++ b/sw/source/ui/index/multmrk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,8 +88,8 @@ void SwMultiTOXMarkDlg::Apply()
rMgr.SetCurTOXMark(nPos);
}
-/*-----------------25.02.94 22:06-------------------
- dtor ueberladen
+/*--------------------------------------------------
+ overload dtor
--------------------------------------------------*/
@@ -96,3 +97,4 @@ SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 74fbc4383f96..18daaa1be444 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,7 @@
#include <wrtsh.hxx>
#include <view.hxx>
#include <multmrk.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <cmdid.h>
#include <index.hrc>
#include <idxmrk.hrc>
@@ -72,7 +73,6 @@
#include <breakit.hxx>
#include <SwRewriter.hxx>
-#include "swuiidxmrk.hxx"
#include <unomid.h>
@@ -95,7 +95,7 @@ using namespace ::comphelper;
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Dialog zum Einfuegen einer Verzeichnismarkierung
+ Description: dialog to insert a directory selection
--------------------------------------------------------------------*/
SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
sal_Bool bNewDlg,
@@ -198,7 +198,6 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
aPrevSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, PrevSameHdl));
aNextBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextHdl));
aNextSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextSameHdl));
- //aTypeDCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, ModifyHdl));
aTypeDCB.SetSelectHdl(LINK(this,SwIndexMarkDlg, ModifyHdl));
aKeyDCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl));
aKey2DCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl));
@@ -214,16 +213,8 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
if(bNewMark)
{
aDelBT.Hide();
-
- {
- ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMPH ) );
- aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ), BMP_COLOR_HIGHCONTRAST );
- }
-
- {
- ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMP ) );
- aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ), BMP_COLOR_NORMAL );
- }
+ ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMP ) );
+ aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ) );
}
else
{
@@ -236,55 +227,52 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
}
/*--------------------------------------------------------------------
- Beschreibung: Controls neu initialisieren mit der aktuellen
- Markierung
+ Description: Newly initialise controls with the new selection
--------------------------------------------------------------------*/
-
-
void SwIndexMarkDlg::InitControls()
{
- DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
- // Inhalts-Verzeichnis
+ OSL_ENSURE(pSh && pTOXMgr, "no shell?");
+ // contents index
const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0);
- ASSERT(pType, "Kein Verzeichnistyp !!");
+ OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
String sTmpTypeSelection;
if(aTypeDCB.GetSelectEntryCount())
sTmpTypeSelection = aTypeDCB.GetSelectEntry();
aTypeDCB.Clear();
aTypeDCB.InsertEntry(pType->GetTypeName());
- // Stichwort-Verzeichnis
+ // keyword index
pType = pTOXMgr->GetTOXType(TOX_INDEX, 0);
- ASSERT(pType, "Kein Verzeichnistyp !!");
+ OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
aTypeDCB.InsertEntry(pType->GetTypeName());
- // Benutzerverzeichnisse
+ // user index
sal_uInt16 nCount = pSh->GetTOXTypeCount(TOX_USER);
sal_uInt16 i;
for( i = 0; i < nCount; ++i )
aTypeDCB.InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() );
- // KeyWords Primary einlesen
+ // read keywords primary
SvStringsSort aArr;
nCount = pSh->GetTOIKeys( TOI_PRIMARY, aArr );
for(i=0; i < nCount; ++i)
aKeyDCB.InsertEntry( *aArr[ i ] );
- // KeyWords Secondary einlesen
+ // read keywords secondary
nCount = pSh->GetTOIKeys( TOI_SECONDARY, aArr );
for(i=0; i < nCount; ++i)
aKey2DCB.InsertEntry( *aArr[ i ] );
UpdateLanguageDependenciesForPhoneticReading();
- // Aktueller Eintrag
+ // current entry
const SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
if( pMark && !bNewMark)
{
// Controls-Handling
- // nur wenn mehr als eins vorhanden
- // wenn gleich landet es auf dem gleichen Eintrag
+ // onyl if there are more than one
+ // if equal it lands at the same entry
pSh->SttCrsrMove();
const SwTOXMark* pMoveMark;
@@ -328,7 +316,7 @@ void SwIndexMarkDlg::InitControls()
UpdateDialog();
}
else
- { // aktuelle Selektion (1.Element) anzeigen ????
+ { // display current selection (first element) ????
sal_uInt16 nCnt = pSh->GetCrsrCnt();
if (nCnt < 2)
{
@@ -336,8 +324,8 @@ void SwIndexMarkDlg::InitControls()
aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
aEntryED.SetText(aOrgStr);
- //alle gleichen Eintraege aufzunehmen darf nur im Body und auch da nur
- //bei vorhandener einfacher Selektion erlaubt werden
+ //to include all equal entries may only be allowed in the body and even there
+ //only when a simple selection exists
const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
aApplyToAllCB.Show();
aSearchCaseSensitiveCB.Show();
@@ -347,7 +335,7 @@ void SwIndexMarkDlg::InitControls()
SearchTypeHdl(&aApplyToAllCB);
}
- // Verzeichnistyp ist default
+ // index type is default
if( sTmpTypeSelection.Len() &&
LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos( sTmpTypeSelection ) )
aTypeDCB.SelectEntry(sTmpTypeSelection);
@@ -370,19 +358,19 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading()
//get the current language
if(!bNewMark) //if dialog is opened to iterate existing marks
{
- ASSERT(pTOXMgr, "need TOXMgr")
+ OSL_ENSURE(pTOXMgr, "need TOXMgr");
if(!pTOXMgr)
return;
SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
- ASSERT(pMark, "need current SwTOXMark");
+ OSL_ENSURE(pMark, "need current SwTOXMark");
if(!pMark)
return;
SwTxtTOXMark* pTxtTOXMark = pMark->GetTxtTOXMark();
- ASSERT(pTxtTOXMark, "need current SwTxtTOXMark");
+ OSL_ENSURE(pTxtTOXMark, "need current SwTxtTOXMark");
if(!pTxtTOXMark)
return;
const SwTxtNode* pTxtNode = pTxtTOXMark->GetpTxtNd();
- ASSERT(pTxtNode, "need current SwTxtNode");
+ OSL_ENSURE(pTxtNode, "need current SwTxtNode");
if(!pTxtNode)
return;
xub_StrLen nTextIndex = *pTxtTOXMark->GetStart();
@@ -396,7 +384,6 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading()
{
case SCRIPTTYPE_ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
case SCRIPTTYPE_COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break;
- //case SCRIPTTYPE_LATIN:
default:nWhich = RES_CHRATR_LANGUAGE; break;
}
SfxItemSet aLangSet(pSh->GetAttrPool(), nWhich, nWhich);
@@ -404,13 +391,6 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading()
nLangForPhoneticReading = ((const SvxLanguageItem&)aLangSet.Get(nWhich)).GetLanguage();
}
- /*
- //enable phonetic reading dependent on the current language
- {
- lang::Locale aLocale( SvxCreateLocale( LanguageType( nLangForPhoneticReading ) ) );
- bIsPhoneticReadingEnabled = xExtendedIndexEntrySupplier->usePhoneticEntry( aLocale );
- }
- */
}
String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText )
@@ -422,13 +402,12 @@ String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText )
return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, aLocale);
}
-/* -----------------07.09.99 10:43-------------------
+/* --------------------------------------------------
Change the content of aEntryED if text is selected
--------------------------------------------------*/
-
void SwIndexMarkDlg::Activate()
{
- // aktuelle Selektion (1.Element) anzeigen ????
+ // display current selection (first element) ????
if(bNewMark)
{
sal_uInt16 nCnt = pSh->GetCrsrCnt();
@@ -438,8 +417,8 @@ void SwIndexMarkDlg::Activate()
aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
aEntryED.SetText(aOrgStr);
- //alle gleichen Eintraege aufzunehmen darf nur im Body und auch da nur
- //bei vorhandener einfacher Selektion erlaubt werden
+ //to include all equal entries may only be allowed in the body and even there
+ //only when a simple selection exists
const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
aApplyToAllCB.Show();
aSearchCaseSensitiveCB.Show();
@@ -453,7 +432,7 @@ void SwIndexMarkDlg::Activate()
}
/*--------------------------------------------------------------------
- Beschreibung: Ok-Button auswerten
+ Description: evaluate Ok-Button
--------------------------------------------------------------------*/
void SwIndexMarkDlg::Apply()
{
@@ -463,10 +442,8 @@ void SwIndexMarkDlg::Apply()
}
/*--------------------------------------------------------------------
- Beschreibung: Aenderungen uebernehmen
+ Description: apply changes
--------------------------------------------------------------------*/
-
-
void SwIndexMarkDlg::InsertUpdate()
{
pSh->StartUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT);
@@ -504,7 +481,7 @@ void SwIndexMarkDlg::InsertUpdate()
}
/*--------------------------------------------------------------------
- Beschreibung: Marke einfuegen
+ Description: insert mark
--------------------------------------------------------------------*/
static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool bCaseSensitive)
{
@@ -542,7 +519,7 @@ void SwIndexMarkDlg::InsertMark()
switch(nPos)
{
case POS_CONTENT : break;
- case POS_INDEX: // Stichwortverzeichnismarke
+ case POS_INDEX: // keyword index mark
{
UpdateKeyBoxes();
String aPrim(aKeyDCB.GetText());
@@ -555,7 +532,7 @@ void SwIndexMarkDlg::InsertMark()
aDesc.SetPhoneticReadingOfSecKey(aPhoneticED2.GetText());
}
break;
- default: // Userdefinedverz.-Marke
+ default: // Userdefined index mark
{
String aName(aTypeDCB.GetSelectEntry());
aDesc.SetTOUName(aName);
@@ -568,8 +545,8 @@ void SwIndexMarkDlg::InsertMark()
sal_Bool bCaseSensitive = aSearchCaseSensitiveCB.IsChecked();
pSh->StartAllAction();
- // hier muessen alle gleichen Strings selektiert werden
- // damit der Eintrag auf alle gleichen Strings angewandt wird
+ // all equal strings have to be selected here so that the
+ // entry is apllied to all equal strings
if(bApplyAll)
{
lcl_SelectSameStrings(*pSh, bWordOnly, bCaseSensitive);
@@ -584,10 +561,8 @@ void SwIndexMarkDlg::InsertMark()
}
/*--------------------------------------------------------------------
- Beschreibung: Marke Updaten
+ Description: update mark
--------------------------------------------------------------------*/
-
-
void SwIndexMarkDlg::UpdateMark()
{
String aAltText(aEntryED.GetText());
@@ -628,17 +603,15 @@ void SwIndexMarkDlg::UpdateMark()
}
/*--------------------------------------------------------------------
- Beschreibung: Neue Keys eintragen
+ Description: insert new keys
--------------------------------------------------------------------*/
-
-
void SwIndexMarkDlg::UpdateKeyBoxes()
{
String aKey(aKeyDCB.GetText());
sal_uInt16 nPos = aKeyDCB.GetEntryPos(aKey);
if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
- { // neuen Key erzeugen
+ { // create new key
aKeyDCB.InsertEntry(aKey);
}
@@ -646,13 +619,11 @@ void SwIndexMarkDlg::UpdateKeyBoxes()
nPos = aKey2DCB.GetEntryPos(aKey);
if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
- { // neuen Key erzeugen
+ { // create new key
aKey2DCB.InsertEntry(aKey);
}
}
-/* -----------------13.10.99 15:10-------------------
- --------------------------------------------------*/
class SwNewUserIdxDlg : public ModalDialog
{
OKButton aOKPB;
@@ -708,9 +679,7 @@ IMPL_LINK( SwIndexMarkDlg, NewUserIdxHdl, Button*, EMPTYARG)
delete pDlg;
return 0;
}
-/* -----------------------------17.01.00 12:18--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, SearchTypeHdl, CheckBox*, pBox)
{
sal_Bool bEnable = pBox->IsChecked() && pBox->IsEnabled();
@@ -718,9 +687,7 @@ IMPL_LINK( SwIndexMarkDlg, SearchTypeHdl, CheckBox*, pBox)
aSearchCaseSensitiveCB.Enable(bEnable);
return 0;
}
-/* -----------------07.09.99 10:30-------------------
- --------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, InsertHdl, Button *, pButton )
{
Apply();
@@ -729,9 +696,7 @@ IMPL_LINK( SwIndexMarkDlg, InsertHdl, Button *, pButton )
CloseHdl(pButton);
return 0;
}
-/* -----------------07.09.99 10:29-------------------
- --------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, CloseHdl, Button *, EMPTYARG )
{
if(bNewMark)
@@ -746,14 +711,15 @@ IMPL_LINK( SwIndexMarkDlg, CloseHdl, Button *, EMPTYARG )
}
return 0;
}
+
/*--------------------------------------------------------------------
- Beschreibung: VerzeichnisTyp auswaehlen nur bei Einfuegen
+ Description: select index type only when inserting
--------------------------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox )
{
if(&aTypeDCB == pBox)
{
- // Verzeichnistyp setzen
+ // set index type
sal_uInt16 nPos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry());
sal_Bool bLevelEnable = sal_False,
bKeyEnable = sal_False,
@@ -824,11 +790,6 @@ IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG )
{
InsertUpdate();
@@ -838,7 +799,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG )
-
IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG )
{
InsertUpdate();
@@ -848,7 +808,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG )
-
IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG )
{
InsertUpdate();
@@ -858,7 +817,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG )
-
IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG )
{
InsertUpdate();
@@ -869,7 +827,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG )
-
IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG )
{
bDel = sal_True;
@@ -887,15 +844,13 @@ IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: Dialoganzeige erneuern
+ Description: renew dialog view
--------------------------------------------------------------------*/
-
-
void SwIndexMarkDlg::UpdateDialog()
{
- DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
+ OSL_ENSURE(pSh && pTOXMgr, "no shell?");
SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
- ASSERT(pMark, "Keine aktuelle Markierung");
+ OSL_ENSURE(pMark, "no current marker");
if(!pMark)
return;
@@ -904,7 +859,7 @@ void SwIndexMarkDlg::UpdateDialog()
aOrgStr = pMark->GetText();
aEntryED.SetText(aOrgStr);
- // Verzeichnistyp setzen
+ // set index type
sal_Bool bLevelEnable = sal_True,
bKeyEnable = sal_False,
bKey2Enable = sal_False,
@@ -948,10 +903,10 @@ void SwIndexMarkDlg::UpdateDialog()
aPhoneticFT2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
aPhoneticED2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
- // Verzeichnis-Typ setzen
+ // set index type
aTypeDCB.SelectEntry(pMark->GetTOXType()->GetTypeName());
- // Next - Prev - Buttons setzen
+ // set Next - Prev - Buttons
pSh->SttCrsrMove();
if( aPrevBT.IsVisible() )
{
@@ -995,7 +950,6 @@ void SwIndexMarkDlg::UpdateDialog()
/*--------------------------------------------------------------------
Remind wether the edit boxes for Phonetic reading are changed manually
--------------------------------------------------------------------*/
-
IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit )
{
if(&aPhoneticED0 == pEdit)
@@ -1014,9 +968,8 @@ IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit )
}
/*--------------------------------------------------------------------
- Beschreibung: Enable Disable des 2. Schluessels
+ Description: Enable Disable of the 2nd key
--------------------------------------------------------------------*/
-
IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox )
{
if(&aKeyDCB == pBox)
@@ -1072,19 +1025,15 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox )
return 0;
}
-/*-----------------25.02.94 21:19-------------------
- dtor ueberladen
+/*--------------------------------------------------
+ overload dtor
--------------------------------------------------*/
-
-
SwIndexMarkDlg::~SwIndexMarkDlg()
{
delete pTOXMgr;
ViewShell::SetCareWin( 0 );
}
-/* -----------------07.09.99 08:41-------------------
- --------------------------------------------------*/
void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark)
{
pSh = &rWrtShell;
@@ -1101,9 +1050,7 @@ void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark)
}
InitControls();
}
-/* -----------------06.10.99 10:00-------------------
- --------------------------------------------------*/
SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent,
@@ -1116,9 +1063,7 @@ SfxModelessDialog(_pBindings, pChild, pParent, SvtCJKOptions().IsCJKFontEnabled(
aDlg.ReInitDlg(*::GetActiveWrtShell());
Initialize(pInfo);
}
-/* -----------------06.10.99 10:27-------------------
- --------------------------------------------------*/
void SwIndexMarkFloatDlg::Activate()
{
SfxModelessDialog::Activate();
@@ -1130,9 +1075,6 @@ void SwIndexMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell)
aDlg.ReInitDlg( rWrtShell );
}
-/* -----------------06.10.99 10:35-------------------
-
- --------------------------------------------------*/
SwIndexMarkModalDlg::SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) :
SvxStandardDialog(pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_EDIT_IDXMARK_CJK):SW_RES(DLG_EDIT_IDXMARK)),
aDlg(this, sal_False, SW_RES(WIN_DLG), SvtCJKOptions().IsCJKFontEnabled()?DLG_EDIT_IDXMARK_CJK:DLG_EDIT_IDXMARK, rSh)
@@ -1140,16 +1082,12 @@ SvxStandardDialog(pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_EDIT_ID
FreeResource();
aDlg.ReInitDlg(rSh, pCurTOXMark);
}
-/* -----------------06.10.99 10:46-------------------
- --------------------------------------------------*/
void SwIndexMarkModalDlg::Apply()
{
aDlg.Apply();
}
-/* -----------------16.09.99 14:19-------------------
- --------------------------------------------------*/
class SwCreateAuthEntryDlg_Impl : public ModalDialog
{
FixedLine aEntriesFL;
@@ -1187,9 +1125,7 @@ public:
void SetCheckNameHdl(const Link& rLink) {aShortNameCheckLink = rLink;}
};
-/*-- 15.09.99 08:43:24---------------------------------------------------
- -----------------------------------------------------------------------*/
struct TextInfo
{
sal_uInt16 nToxField;
@@ -1302,23 +1238,17 @@ SwAuthMarkDlg::SwAuthMarkDlg( Window *pParent,
aEntryLB.SetSelectHdl(LINK(this, SwAuthMarkDlg, CompEntryHdl));
}
}
-/*-- 15.09.99 08:43:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwAuthMarkDlg::~SwAuthMarkDlg()
{
}
-/*-- 15.09.99 08:43:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAuthMarkDlg::ReInitDlg(SwWrtShell& rWrtShell)
{
pSh = &rWrtShell;
InitControls();
}
-/* -----------------15.09.99 08:57-------------------
- --------------------------------------------------*/
IMPL_LINK( SwAuthMarkDlg, CloseHdl, PushButton *, EMPTYARG )
{
if(bNewEntry)
@@ -1333,9 +1263,7 @@ IMPL_LINK( SwAuthMarkDlg, CloseHdl, PushButton *, EMPTYARG )
}
return 0;
}
-/* -----------------06.12.99 13:54-------------------
- --------------------------------------------------*/
static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32 nLen, const String& rColumnTitle)
{
String sRet;
@@ -1352,9 +1280,7 @@ static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32
}
return sRet;
}
-/* -----------------------------07.12.99 15:39--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox)
{
String sEntry(pBox->GetSelectEntry());
@@ -1401,17 +1327,14 @@ IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox)
return 0;
}
-/* -----------------15.09.99 08:57-------------------
-
- --------------------------------------------------*/
IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG )
{
//insert or update the SwAuthorityField...
if(pSh)
{
sal_Bool bDifferent = sal_False;
- DBG_ASSERT(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
- DBG_ASSERT(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
+ OSL_ENSURE(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
+ OSL_ENSURE(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
//check if the entry already exists with different content
const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
@@ -1458,9 +1381,7 @@ IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG )
CloseHdl(0);
return 0;
}
-/* -----------------17.09.99 13:06-------------------
- --------------------------------------------------*/
IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton)
{
sal_Bool bCreate = pButton == &aCreateEntryPB;
@@ -1492,7 +1413,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton)
}
if(bCreate)
{
- DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND ==
+ OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND ==
aEntryLB.GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]),
"entry exists!");
aEntryLB.InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]);
@@ -1505,9 +1426,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton)
}
return 0;
}
-/* -----------------------------20.12.99 14:26--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton)
{
sal_Bool bFromComp = (pButton == &aFromComponentRB);
@@ -1571,9 +1490,7 @@ IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton)
CompEntryHdl(&aEntryLB);
return 0;
}
-/* -----------------15.10.2002 13:16-----------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit)
{
Link aAllowed = LINK(this, SwAuthMarkDlg, IsEntryAllowedHdl);
@@ -1587,9 +1504,7 @@ IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit)
}
return 0;
};
-/* -----------------------------20.12.99 15:11--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit)
{
String sEntry = pEdit->GetText();
@@ -1611,14 +1526,12 @@ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit)
}
return bAllowed;
}
-/* -----------------21.09.99 14:19-------------------
- --------------------------------------------------*/
void SwAuthMarkDlg::InitControls()
{
- DBG_ASSERT(pSh, "Shell nicht da?");
+ OSL_ENSURE(pSh, "no shell?");
SwField* pField = pSh->GetCurFld();
- ASSERT(bNewEntry || pField, "Keine aktuelle Markierung");
+ OSL_ENSURE(bNewEntry || pField, "no current marker");
if(bNewEntry)
{
ChangeSourceHdl(aFromComponentRB.IsChecked() ? &aFromComponentRB : &aFromDocContentRB);
@@ -1633,7 +1546,7 @@ void SwAuthMarkDlg::InitControls()
const SwAuthEntry* pEntry = ((SwAuthorityFieldType*)pField->GetTyp())->
GetEntryByHandle(((SwAuthorityField*)pField)->GetHandle());
- DBG_ASSERT(pEntry, "No authority entry found");
+ OSL_ENSURE(pEntry, "No authority entry found");
if(!pEntry)
return;
for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
@@ -1643,17 +1556,13 @@ void SwAuthMarkDlg::InitControls()
aAuthorFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR));
aTitleFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_TITLE));
}
-/* -----------------------------05.09.2002 09:44------------------------------
- ---------------------------------------------------------------------------*/
void SwAuthMarkDlg::Activate()
{
aOKBT.Enable(!pSh->HasReadonlySel());
Window::Activate();
}
-/* -----------------16.09.99 14:27-------------------
- --------------------------------------------------*/
SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent,
const String pFields[],
SwWrtShell& rSh,
@@ -1799,15 +1708,12 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent,
long nHeightDiff = - aFLSz.Height();
aFLSz.Height() = aTL1.Y();
nHeightDiff += aFLSz.Height();
-// aEntriesFL.SetSizePixel(aFLSz);
Size aDlgSize(GetSizePixel());
aDlgSize.Height() += nHeightDiff;
SetSizePixel(aDlgSize);
}
-/* -----------------16.09.99 14:47-------------------
- --------------------------------------------------*/
SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl()
{
for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
@@ -1818,20 +1724,18 @@ SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl()
delete pTypeListBox;
delete pIdentifierBox;
}
-/* -----------------16.09.99 14:27-------------------
- --------------------------------------------------*/
String SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const
{
String sRet;
if( AUTH_FIELD_AUTHORITY_TYPE == eField )
{
- DBG_ASSERT(pTypeListBox, "No ListBox");
+ OSL_ENSURE(pTypeListBox, "No ListBox");
sRet = String::CreateFromInt32(pTypeListBox->GetSelectEntryPos());
}
else if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode)
{
- DBG_ASSERT(pIdentifierBox, "No ComboBox");
+ OSL_ENSURE(pIdentifierBox, "No ComboBox");
sRet = pIdentifierBox->GetText();
}
else
@@ -1848,9 +1752,7 @@ String SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const
}
return sRet;
}
-/* -----------------21.09.99 13:54-------------------
- --------------------------------------------------*/
IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox*, pBox)
{
const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
@@ -1876,9 +1778,6 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox*, pBox)
}
return 0;
}
-/* -----------------------------20.12.99 15:07--------------------------------
-
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit)
{
@@ -1890,17 +1789,13 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit)
}
return 0;
}
-/* -----------------------------20.12.99 15:54--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox*, pBox)
{
aOKBT.Enable(m_bNameAllowed && pBox->GetSelectEntryCount());
return 0;
};
-/* -----------------06.10.99 10:00-------------------
- --------------------------------------------------*/
SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent,
@@ -1912,12 +1807,10 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
FreeResource();
Initialize(pInfo);
SwWrtShell* pWrtShell = ::GetActiveWrtShell();
- DBG_ASSERT(pWrtShell, "No shell?");
+ OSL_ENSURE(pWrtShell, "No shell?");
aDlg.ReInitDlg(*pWrtShell);
}
-/* -----------------06.10.99 10:27-------------------
- --------------------------------------------------*/
void SwAuthMarkFloatDlg::Activate()
{
SfxModelessDialog::Activate();
@@ -1929,9 +1822,6 @@ void SwAuthMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell)
aDlg.ReInitDlg( rWrtShell );
}
-/* -----------------06.10.99 10:35-------------------
-
- --------------------------------------------------*/
SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) :
SvxStandardDialog(pParent, SW_RES(DLG_EDIT_AUTHMARK)),
aDlg(this, SW_RES(WIN_DLG), sal_False)
@@ -1939,11 +1829,10 @@ SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) :
FreeResource();
aDlg.ReInitDlg(rSh);
}
-/* -----------------06.10.99 10:46-------------------
- --------------------------------------------------*/
void SwAuthMarkModalDlg::Apply()
{
aDlg.InsertHdl(0);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 76b06194b9e6..8646089981c8 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@
#include <globals.hrc>
/*--------------------------------------------------------------------
- Beschreibung: Handhabung der Verzeichnisse durch TOXMgr
+ Description: handle indexes with TOXMgr
--------------------------------------------------------------------*/
@@ -52,7 +53,7 @@ SwTOXMgr::SwTOXMgr(SwWrtShell* pShell):
}
/*--------------------------------------------------------------------
- Beschreibung: Aktuelle TOXMarks behandeln
+ Description: handle current TOXMarks
--------------------------------------------------------------------*/
@@ -82,12 +83,10 @@ void SwTOXMgr::DeleteTOXMark()
pSh->DeleteTOXMark( pCurTOXMark );
pSh->SetModified();
}
- // zur naechsten wandern
+ // go to next one
pCurTOXMark = pNext;
}
-/* -----------------20.08.99 10:48-------------------
- --------------------------------------------------*/
void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
{
SwTOXMark* pMark = 0;
@@ -95,8 +94,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
{
case TOX_CONTENT:
{
- ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
- ungueltiger Level InsertTOCMark);
+ OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+ "invalid InsertTOCMark level");
pMark = new SwTOXMark(pSh->GetTOXType(TOX_CONTENT, 0));
pMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) );
@@ -130,8 +129,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
break;
case TOX_USER:
{
- ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
- ungueltiger Level InsertTOCMark);
+ OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+ "invalid InsertTOCMark level");
sal_uInt16 nId = rDesc.GetTOUName() ?
GetUserTypeID(*rDesc.GetTOUName()) : 0;
pMark = new SwTOXMark(pSh->GetTOXType(TOX_USER, nId));
@@ -148,13 +147,13 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
pSh->EndAllAction();
}
/*--------------------------------------------------------------------
- Beschreibung: Update eines TOXMarks
+ Description: Update of TOXMarks
--------------------------------------------------------------------*/
void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
pSh->StartAllAction();
if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
@@ -199,8 +198,8 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
if(rDesc.GetAltStr())
{
- // JP 26.08.96: Bug 30344 - entweder der Text aus dem Doc oder
- // ein Alternativ-Text, beides gibts nicht!
+ // JP 26.08.96: Bug 30344 - either the text of a Doc or an alternative test,
+ // not both!
sal_Bool bReplace = pCurTOXMark->IsAlternativeText();
if( bReplace )
pCurTOXMark->SetAlternativeText( *rDesc.GetAltStr() );
@@ -216,7 +215,7 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
}
pSh->SetModified();
pSh->EndAllAction();
- // Bug 36207 pCurTOXMark zeigt hier in den Wald!
+ // Bug 36207 pCurTOXMark points nowhere here!
if(!pCurTOXMark)
{
pSh->Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
@@ -227,7 +226,7 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
/*--------------------------------------------------------------------
- Beschreibung: UserTypeID ermitteln
+ Description: determine UserTypeID
--------------------------------------------------------------------*/
@@ -246,13 +245,13 @@ sal_uInt16 SwTOXMgr::GetUserTypeID(const String& rStr)
}
/*--------------------------------------------------------------------
- Beschreibung: Traveling zwischen den TOXMarks
+ Description: traveling between TOXMarks
--------------------------------------------------------------------*/
void SwTOXMgr::NextTOXMark(sal_Bool bSame)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
if( pCurTOXMark )
{
SwTOXSearch eDir = bSame ? TOX_SAME_NXT : TOX_NXT;
@@ -263,7 +262,7 @@ void SwTOXMgr::NextTOXMark(sal_Bool bSame)
void SwTOXMgr::PrevTOXMark(sal_Bool bSame)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
if( pCurTOXMark )
{
SwTOXSearch eDir = bSame ? TOX_SAME_PRV : TOX_PRV;
@@ -272,7 +271,7 @@ void SwTOXMgr::PrevTOXMark(sal_Bool bSame)
}
/*--------------------------------------------------------------------
- Beschreibung: Stichwortverzeichnis einfuegen
+ Description: insert keyword index
--------------------------------------------------------------------*/
const SwTOXBase* SwTOXMgr::GetCurTOX()
{
@@ -289,10 +288,6 @@ void SwTOXMgr::SetCurTOXMark(sal_uInt16 nId)
pCurTOXMark = (nId < aCurMarks.Count()) ? aCurMarks[nId] : 0;
}
-/* -----------------01.07.99 16:23-------------------
-
- --------------------------------------------------*/
-
sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
SwTOXBase** ppBase,
const SfxItemSet* pSet)
@@ -407,7 +402,6 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
pSh->DelRight();
pNewTOX = (SwTOXBase*)pCurTOX;
}
-// pTOX->SetOptions(rDesc.GetIndexOptions());
pNewTOX->SetFromObjectNames(rDesc.IsCreateFromObjectNames());
pNewTOX->SetOLEOptions(rDesc.GetOLEOptions());
}
@@ -415,7 +409,7 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
}
- DBG_ASSERT(pNewTOX, "no TOXBase created!" );
+ OSL_ENSURE(pNewTOX, "no TOXBase created!" );
if(!pNewTOX)
return sal_False;
@@ -436,8 +430,8 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
if(!pCurTOX || (ppBase && !(*ppBase)) )
{
- // wird ppBase uebergeben, dann wird das TOXBase hier nur erzeugt
- // und dann ueber den Dialog in ein Globaldokument eingefuegt
+ // when ppBase is passed over, TOXBase is only created here
+ // and then inserted in a global document by the dialog
if(ppBase)
(*ppBase) = pNewTOX;
else
@@ -478,9 +472,7 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
return bRet;
}
-/* -----------------20.10.99 14:11-------------------
- --------------------------------------------------*/
void SwTOXDescription::SetSortKeys(SwTOXSortKey eKey1,
SwTOXSortKey eKey2,
SwTOXSortKey eKey3)
@@ -499,9 +491,6 @@ void SwTOXDescription::SetSortKeys(SwTOXSortKey eKey1,
eSortKey3 = aArr[2];
}
-/* -----------------10.09.99 10:02-------------------
-
- --------------------------------------------------*/
void SwTOXDescription::ApplyTo(SwTOXBase& rTOXBase)
{
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
@@ -527,3 +516,4 @@ void SwTOXDescription::ApplyTo(SwTOXBase& rTOXBase)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index ae84d4b1872f..95009700b565 100755..100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,20 +34,14 @@
#include <hintids.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
-#ifndef _GLOBALS_HRC
+#include <swundo.hxx> // for Undo-Ids
#include <globals.hrc>
-#endif
#include <splargs.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <editeng/unolingu.hxx>
#include <editeng/langitem.hxx>
#include <editeng/fontitem.hxx>
@@ -67,11 +62,8 @@
#include <ndtxt.hxx>
#include <fmtruby.hxx>
#include <breakit.hxx>
-#include <docsh.hxx>
-#ifndef _OLMENU_HRC
#include <olmenu.hrc>
-#endif
#include <unomid.h>
@@ -85,7 +77,7 @@ using namespace ::com::sun::star::i18n;
#define CHAR_PAR_BRK ((sal_Char) 0x0D)
//////////////////////////////////////////////////////////////////////
-// Beschreibung: Ggf. Rahmen/Objektshell abschalten
+// Description: Turn off frame/object shell if applicable
static void lcl_ActivateTextShell( SwWrtShell & rWrtSh )
{
@@ -196,11 +188,6 @@ SwHHCWrapper::~SwHHCWrapper()
}
}
-
-/*
- if( bInfoBox )
- InfoBox(&pView->GetEditWin(), String(SW_RES(STR_SPELL_OK)) ).Execute();
-*/
}
@@ -244,7 +231,7 @@ void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 nUnitEnd
void SwHHCWrapper::HandleNewUnit(
const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd )
{
- DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+ OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
if (!(0 <= nUnitStart && nUnitStart <= nUnitEnd))
return;
@@ -267,7 +254,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
//!! please see also TextConvWrapper::ChangeText with is a modified
//!! copy of this code
- DBG_ASSERT( rNewText.Len() != 0, "unexpected empty string" );
+ OSL_ENSURE( rNewText.Len() != 0, "unexpected empty string" );
if (rNewText.Len() == 0)
return;
@@ -293,7 +280,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
// different length. Negative values allowed!
long nCorrectionOffset = 0;
- DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen,
+ OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen,
"mismatch between string length and sequence length!" );
// find all substrings that need to be replaced (and only those)
@@ -317,17 +304,17 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
{
nChgLen = nIndex - nChgPos;
nConvChgLen = nPos - nConvChgPos;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aInOrig( rOrigText.copy( nChgPos, nChgLen ) );
#endif
String aInNew( rNewText.Copy( nConvChgPos, nConvChgLen ) );
// set selection to sub string to be replaced in original text
xub_StrLen nChgInNodeStartIndex = static_cast< xub_StrLen >( nStartIndex + nCorrectionOffset + nChgPos );
- DBG_ASSERT( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" );
+ OSL_ENSURE( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" );
rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex );
rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex + nChgLen );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt1( rWrtShell.GetSelTxt() );
#endif
@@ -382,7 +369,7 @@ void SwHHCWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAttrib
// restore those for the new text
rWrtShell.GetCurAttr( aItemSet );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt1( rWrtShell.GetSelTxt() );
#endif
rWrtShell.Delete();
@@ -393,7 +380,7 @@ void SwHHCWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAttrib
rWrtShell.GetCrsr()->SetMark();
SwPosition *pMark = rWrtShell.GetCrsr()->GetMark();
pMark->nContent = pMark->nContent.GetIndex() - rNewText.Len();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt2( rWrtShell.GetSelTxt() );
#endif
@@ -425,13 +412,13 @@ void SwHHCWrapper::ReplaceUnit(
static OUString aBracketedStart( C2U( "(" ) );
static OUString aBracketedEnd( C2U( ")" ) );
- DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+ OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
if (!(nUnitStart >= 0 && nUnitEnd >= nUnitStart))
return;
lcl_ActivateTextShell( rWrtShell );
- // Das aktuelle Wort austauschen
+ // replace the current word
rWrtShell.StartAllAction();
// select current unit
@@ -439,7 +426,7 @@ void SwHHCWrapper::ReplaceUnit(
OUString aOrigTxt( rWrtShell.GetSelTxt() );
OUString aNewTxt( rReplaceWith );
- DBG_ASSERT( aOrigTxt == rOrigText, "!! text mismatch !!" );
+ OSL_ENSURE( aOrigTxt == rOrigText, "!! text mismatch !!" );
SwFmtRuby *pRuby = 0;
sal_Bool bRubyBelow = sal_False;
String aNewOrigText;
@@ -482,7 +469,7 @@ void SwHHCWrapper::ReplaceUnit(
}
break;
default:
- DBG_ERROR( "unexpected case" );
+ OSL_FAIL("unexpected case" );
}
nUnitOffset += nUnitStart + aNewTxt.getLength();
@@ -509,10 +496,8 @@ void SwHHCWrapper::ReplaceUnit(
pRuby->SetPosition( bRubyBelow );
pRuby->SetAdjustment( RubyAdjust_CENTER );
- //!! the following seem not to be needed
- //pRuby->SetCharFmtName( const String& rNm );
- //pRuby->SetCharFmtId( sal_uInt16 nNew );
-#ifdef DEBUG
+
+#if OSL_DEBUG_LEVEL > 1
SwPaM *pPaM = rWrtShell.GetCrsr();
(void)pPaM;
#endif
@@ -539,7 +524,7 @@ void SwHHCWrapper::ReplaceUnit(
rWrtShell.SetMark();
rWrtShell.GetCrsr()->GetMark()->nContent -= (xub_StrLen) aNewTxt.getLength();
- DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
+ OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
"SwHHCWrapper::ReplaceUnit : unexpected target language" );
sal_uInt16 aRanges[] = {
@@ -550,13 +535,11 @@ void SwHHCWrapper::ReplaceUnit(
SfxItemSet aSet( rWrtShell.GetAttrPool(), aRanges );
if (pNewUnitLanguage)
{
- //DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
- // "similar language should not be changed!");
aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) );
}
const Font *pTargetFont = GetTargetFont();
- DBG_ASSERT( pTargetFont, "target font missing?" );
+ OSL_ENSURE( pTargetFont, "target font missing?" );
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
@@ -588,7 +571,7 @@ sal_Bool SwHHCWrapper::HasRubySupport() const
void SwHHCWrapper::Convert()
{
- DBG_ASSERT( pConvArgs == 0, "NULL pointer expected" );
+ OSL_ENSURE( pConvArgs == 0, "NULL pointer expected" );
{
SwPaM *pCrsr = pView->GetWrtShell().GetCrsr();
SwPosition* pSttPos = pCrsr->Start();
@@ -618,13 +601,13 @@ void SwHHCWrapper::Convert()
pTxtNode, pSttPos->nContent,
pTxtNode, pSttPos->nContent );
}
- DBG_ASSERT( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
+ OSL_ENSURE( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
"failed to get proper start text node" );
- DBG_ASSERT( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
+ OSL_ENSURE( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
"failed to get proper end text node" );
// chinese conversion specific settings
- DBG_ASSERT( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
+ OSL_ENSURE( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
"source and target language mismatch?" );
if (IsChinese( GetTargetLanguage() ))
{
@@ -689,20 +672,18 @@ sal_Bool SwHHCWrapper::ConvNext_impl( )
{
//! modified version of SvxSpellWrapper::SpellNext
- // Keine Richtungsaenderung, also ist der gewuenschte Bereich ( bStartChk )
- // vollstaendig abgearbeitet.
+ // no change of direction so the desired region is fully processed
if( bStartChk )
bStartDone = sal_True;
else
bEndDone = sal_True;
- if( bIsOtherCntnt && bStartDone && bEndDone ) // Dokument komplett geprueft?
+ if( bIsOtherCntnt && bStartDone && bEndDone ) // document completely checked?
{
bInfoBox = sal_True;
return sal_False;
}
- //ResMgr* pMgr = DIALOG_MGR();
sal_Bool bGoOn = sal_False;
if ( bIsOtherCntnt )
@@ -713,7 +694,7 @@ sal_Bool SwHHCWrapper::ConvNext_impl( )
}
else if ( bStartDone && bEndDone )
{
- // Bodybereich erledigt, Frage nach Sonderbereich
+ // body region done, ask about special region
if( bIsConvSpecial && HasOtherCnt_impl() )
{
ConvStart_impl( pConvArgs, SVX_SPELL_OTHER );
@@ -724,29 +705,9 @@ sal_Bool SwHHCWrapper::ConvNext_impl( )
}
else
{
- // Ein BODY_Bereich erledigt, Frage nach dem anderen BODY_Bereich
-/*
- //pWin->LeaveWait();
-
- sal_uInt16 nResId = RID_SVXQB_CONTINUE;
- QueryBox aBox( pWin, ResId( nResId, pMgr ) );
- if ( aBox.Execute() != RET_YES )
- {
- // Verzicht auf den anderen Bereich, ggf. Frage nach Sonderbereich
- //pWin->EnterWait();
- bStartDone = bEndDone = sal_True;
- return SpellNext();
- }
- else
- {
-*/
bStartChk = !bStartDone;
ConvStart_impl( pConvArgs, bStartChk ? SVX_SPELL_BODY_START : SVX_SPELL_BODY_END );
bGoOn = sal_True;
-/*
- }
- pWin->EnterWait();
-*/
}
return bGoOn;
}
@@ -756,8 +717,6 @@ sal_Bool SwHHCWrapper::FindConvText_impl()
{
//! modified version of SvxSpellWrapper::FindSpellError
- //ShowLanguageErrors();
-
sal_Bool bFound = sal_False;
pWin->EnterWait();
@@ -797,22 +756,20 @@ void SwHHCWrapper::ConvStart_impl( SwConversionArgs /* [out] */ *pConversionArgs
void SwHHCWrapper::ConvEnd_impl( SwConversionArgs *pConversionArgs )
{
pView->SpellEnd( pConversionArgs );
- //ShowLanguageErrors();
}
sal_Bool SwHHCWrapper::ConvContinue_impl( SwConversionArgs *pConversionArgs )
{
sal_Bool bProgress = !bIsDrawObj && !bIsSelection;
-// bLastRet = aConvText.getLength() == 0;
pConversionArgs->aConvText = OUString();
pConversionArgs->nConvTextLang = LANGUAGE_NONE;
uno::Any aRet = bProgress ?
pView->GetWrtShell().SpellContinue( &nPageCount, &nPageStart, pConversionArgs ) :
pView->GetWrtShell().SpellContinue( &nPageCount, NULL, pConversionArgs );
- //aRet >>= aConvText;
return pConversionArgs->aConvText.getLength() != 0;
}
//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx
index 69c3db509fed..3731a6f6d6d7 100644
--- a/sw/source/ui/lingu/hyp.cxx
+++ b/sw/source/ui/lingu/hyp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include "wrtsh.hxx"
#include "globals.hrc"
#include <vcl/msgbox.hxx>
-#ifndef _WRKWIN_HXX //autogen
#include <vcl/wrkwin.hxx>
-#endif
#include <linguistic/lngprops.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <swwait.hxx>
@@ -57,7 +56,7 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
/*--------------------------------------------------------------------
- Beschreibung: Interaktive Trennung
+ Description: interactive separation
--------------------------------------------------------------------*/
SwHyphWrapper::SwHyphWrapper( SwView* pVw,
@@ -95,7 +94,7 @@ void SwHyphWrapper::SpellStart( SvxSpellArea eSpell )
sal_Bool SwHyphWrapper::SpellContinue()
{
- // Fuer autom. Trennung Aktionen erst am Ende sichtbar machen
+ // for automatic separation, make actions visible only at the end
SwWait *pWait = 0;
if( bAutomatic )
{
@@ -108,7 +107,7 @@ sal_Bool SwHyphWrapper::SpellContinue()
PSH->HyphContinue( &nPageCount, &nPageStart );
SetLast( xHyphWord );
- // Fuer autom. Trennung Aktionen erst am Ende sichtbar machen
+ // for automatic separation, make actions visible only at the end
if( bAutomatic )
{
PSH->EndAllAction();
@@ -174,3 +173,4 @@ SwHyphWrapper::~SwHyphWrapper()
InfoBox( &pView->GetEditWin(), SW_RESSTR(STR_HYP_OK) ).Execute();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 0bdbb6b60bb5..0bb8f5921183 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,9 +53,6 @@
#include "viewopt.hxx"
#include "wrtsh.hxx"
#include "wview.hxx"
-#include "swabstdlg.hxx"
-#include "chrdlg.hrc"
-
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
@@ -81,7 +79,6 @@
#include <svl/itemset.hxx>
#include <svl/languageoptions.hxx>
#include <svl/stritem.hxx>
-#include <svtools/filter.hxx>
#include <svtools/langtab.hxx>
#include <svx/dlgutil.hxx>
#include <unotools/lingucfg.hxx>
@@ -89,6 +86,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
+#include <sal/macros.h>
#include <map>
@@ -112,9 +110,7 @@ using ::rtl::OUString;
extern void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq );
-/*--------------------------------------------------------------------------
----------------------------------------------------------------------------*/
// tries to determine the language of 'rText'
//
@@ -170,15 +166,15 @@ LanguageType lcl_CheckLanguage(
aLangList[2] = rSettings.GetLanguage();
// en-US
aLangList[3] = LANGUAGE_ENGLISH_US;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
lang::Locale a0( SvxCreateLocale( aLangList[0] ) );
lang::Locale a1( SvxCreateLocale( aLangList[1] ) );
lang::Locale a2( SvxCreateLocale( aLangList[2] ) );
lang::Locale a3( SvxCreateLocale( aLangList[3] ) );
#endif
- sal_Int32 nCount = sizeof(aLangList) / sizeof(aLangList[0]);
- for (sal_Int32 i = 0; i < nCount; i++)
+ sal_Int32 nCount = SAL_N_ELEMENTS(aLangList);
+ for (sal_Int32 i = 0; i < nCount; i++)
{
sal_Int16 nTmpLang = aLangList[i];
if (nTmpLang != LANGUAGE_NONE && nTmpLang != LANGUAGE_DONTKNOW)
@@ -307,7 +303,7 @@ void SwSpellPopup::fillLangPopupMenu(
aEntryTxt != sAsterix &&
aEntryTxt != sEmpty)
{
- DBG_ASSERT( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
+ OSL_ENSURE( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
"nItemId outside of expected range!" );
pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
if (aEntryTxt == aCurLang)
@@ -331,10 +327,6 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
Image aRes;
OUString aTmp;
osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
-// ::rtl::OString aPath = OString( aTmp.getStr(), aTmp.getLength(), osl_getThreadTextEncoding() );
-#if defined(WNT)
-// aTmp = lcl_Win_GetShortPathName( aTmp );
-#endif
Graphic aGraphic;
const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) );
if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
@@ -352,7 +344,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
{
try
{
- uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
+ uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription")) ), uno::UNO_QUERY );
if ( xNameAccess.is() )
{
uno::Reference< container::XNameAccess > xUICommandLabels;
@@ -367,7 +359,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
{
for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
{
- if ( aPropSeq[i].Name.equalsAscii( "Name" ))
+ if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ) ) )
{
aPropSeq[i].Value >>= aStr;
break;
@@ -389,15 +381,14 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
SwSpellPopup::SwSpellPopup(
SwWrtShell* pWrtSh,
const uno::Reference< linguistic2::XSpellAlternatives > &xAlt,
- const String &rParaText ) :
-PopupMenu( SW_RES(MN_SPELL_POPUP) ),
-pSh( pWrtSh ),
-xSpellAlt(xAlt),
-bGrammarResults(false)
+ const String &rParaText
+) : PopupMenu( SW_RES(MN_SPELL_POPUP) )
+ , pSh( pWrtSh )
+ , xSpellAlt(xAlt)
+ , bGrammarResults(false)
{
- DBG_ASSERT(xSpellAlt.is(), "no spelling alternatives available");
+ OSL_ENSURE(xSpellAlt.is(), "no spelling alternatives available");
-// CreateAutoMnemonics();
SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
nCheckedLanguage = LANGUAGE_NONE;
@@ -409,7 +400,6 @@ bGrammarResults(false)
sal_Int16 nStringCount = static_cast< sal_Int16 >( aSuggestions.getLength() );
SvtLinguConfig aCfg;
- const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
PopupMenu *pMenu = GetPopupMenu(MN_AUTOCORR);
pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
@@ -421,7 +411,7 @@ bGrammarResults(false)
uno::Reference< container::XNamed > xNamed( xSpellAlt, uno::UNO_QUERY );
if (xNamed.is())
{
- aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName(), bHC );
+ aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName() );
aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) );
}
@@ -472,7 +462,6 @@ bGrammarResults(false)
}
pMenu = GetPopupMenu(MN_ADD_TO_DIC);
-// pMenu->CreateAutoMnemonics();
pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); //! necessary to retrieve the correct dictionary name in 'Execute' below
bEnable = sal_False; // enable MN_ADD_TO_DIC?
uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
@@ -512,7 +501,7 @@ bGrammarResults(false)
if (xSvcInfo.is())
{
OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage(
- xSvcInfo->getImplementationName(), bHC) );
+ xSvcInfo->getImplementationName() ) );
if (aDictionaryImageUrl.getLength() > 0)
{
Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
@@ -560,15 +549,10 @@ bGrammarResults(false)
pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph );
EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true );
-/*
- pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT);
- fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document );
- EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true );
-*/
+
uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
Image rImg = ::GetImage( xFrame,
- OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
- Application::GetSettings().GetStyleSettings().GetHighContrastMode() );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SpellingAndGrammarDialog")), sal_False );
SetItemImage( MN_SPELLING_DLG, rImg );
//////////////////////////////////////////////////////////////////////////////////
@@ -576,9 +560,7 @@ bGrammarResults(false)
RemoveDisabledEntries( sal_True, sal_True );
}
-/*--------------------------------------------------------------------------
----------------------------------------------------------------------------*/
SwSpellPopup::SwSpellPopup(
SwWrtShell *pWrtSh,
@@ -600,7 +582,6 @@ aInfo16( SW_RES(IMG_INFO_16) )
InsertItem( MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, nPos++ );
SetItemImage( MN_SHORT_COMMENT, aInfo16 );
-// CreateAutoMnemonics();
SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
InsertSeparator( nPos++ );
@@ -644,7 +625,6 @@ aInfo16( SW_RES(IMG_INFO_16) )
nGuessLangPara = LANGUAGE_NONE;
if (xLG.is())
{
-// nGuessLangWord = lcl_CheckLanguage( xSpellAlt->getWord(), ::GetSpellChecker(), xLG, sal_False );
nGuessLangPara = lcl_CheckLanguage( rParaText, ::GetSpellChecker(), xLG, sal_True );
}
if (nGuessLangWord != LANGUAGE_NONE || nGuessLangPara != LANGUAGE_NONE)
@@ -693,15 +673,10 @@ aInfo16( SW_RES(IMG_INFO_16) )
pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph );
EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true );
-/*
- pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT);
- fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document );
- EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true );
-*/
+
uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
Image rImg = ::GetImage( xFrame,
- OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
- Application::GetSettings().GetStyleSettings().GetHighContrastMode() );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SpellingAndGrammarDialog")), sal_False );
SetItemImage( MN_SPELLING_DLG, rImg );
//////////////////////////////////////////////////////////////////////////////////
@@ -709,19 +684,14 @@ aInfo16( SW_RES(IMG_INFO_16) )
RemoveDisabledEntries( sal_True, sal_True );
}
-/*--------------------------------------------------------------------------
----------------------------------------------------------------------------*/
sal_uInt16 SwSpellPopup::Execute( const Rectangle& rWordPos, Window* pWin )
{
-// SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
sal_uInt16 nRet = PopupMenu::Execute(pWin, pWin->LogicToPixel(rWordPos));
Execute( nRet );
return nRet;
}
-/*-- 19.01.2006 08:15:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellPopup::Execute( sal_uInt16 nId )
{
if (nId == USHRT_MAX)
@@ -735,7 +705,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
{
sal_Int32 nAltIdx = (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ?
nId - MN_SUGGESTION_START : nId - MN_AUTOCORR_START;
- DBG_ASSERT( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
+ OSL_ENSURE( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
if (0 <= nAltIdx && nAltIdx < aSuggestions.getLength() && (bGrammarResults || xSpellAlt.is()))
{
sal_Bool bOldIns = pSh->IsInsMode();
@@ -774,8 +744,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
of temporary auto correction is now undoable two and
must reside in the same undo group.*/
- // nur aufnehmen, wenn es NICHT schon in der Autokorrektur vorhanden ist
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ // record only if it's NOT already present in autocorrection
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
String aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ;
String aNewWord( aSuggestions[ nAltIdx ] );
@@ -913,25 +883,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
lcl_CharDialog( *pSh, true, nId, 0, 0 );
pSh->Pop( sal_False ); // restore cursor
}
-#if 0
- else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries - 1)
- {
- //Set Language_None as the default language
- SwLangHelper::SetLanguage_None( *pSh, false, aCoreSet );
- }
- else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries)
- {
- // open the dialog "Tools/Options/Language Settings - Language"
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- if (pFact)
- {
- VclAbstractDialog* pDlg = pFact->CreateVclDialog( pSh->GetView().GetWindow(), SID_LANGUAGE_OPTIONS );
- pDlg->Execute();
- delete pDlg;
- }
- }
-#endif
}
pSh->EnterStdMode();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index 3dd6f77e24ab..9658db32ce3a 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,13 +45,9 @@
#include <unotools/localedatawrapper.hxx>
#include <sdrhhcwrap.hxx>
#include <frmfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx> // " " "
-#endif
#include <wrtsh.hxx> // MakeVisible
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <dcontact.hxx> // Spelling von DrawObj
#include <doc.hxx> // " " "
#include <docary.hxx>
@@ -90,8 +87,7 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
pOutlView = new OutlinerView( this, &(pView->GetEditWin()) );
pOutlView->GetOutliner()->SetRefDevice(pView->GetWrtShell().getIDocumentDeviceAccess()->getPrinter( false ));
- // Hack: Es sollten alle SdrTextObj-Attribute an die EditEngine
- // uebertragen werden.
+ // Hack: all SdrTextObj attributes should be transferred to EditEngine
pOutlView->SetBackgroundColor( Color( COL_WHITE ) );
@@ -108,13 +104,10 @@ SdrHHCWrapper::~SdrHHCWrapper()
if (pTextObj)
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
pSdrView->SdrEndTextEdit( sal_True );
SetUpdateMode(sal_False);
pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
-// SetPaperSize( Size(1, 1) );
-// SetText(NULL);
-// pTextObj = NULL;
}
RemoveView( pOutlView );
delete pOutlView;
@@ -134,7 +127,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
if ( pTextObj )
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
pSdrView->SdrEndTextEdit( sal_True );
SetUpdateMode(sal_False);
pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -147,7 +140,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
std::list<SdrTextObj*> aTextObjs;
SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() );
- for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ )
+ for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); ++aIt )
{
pTextObj = (*aIt);
if ( pTextObj )
@@ -169,7 +162,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
if (HasConvertibleTextPortion( nSourceLang ))
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
SdrPageView* pPV = pSdrView->GetSdrPageView();
nDocIndex = n;
bNextDoc = sal_True;
@@ -198,3 +191,4 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx
index 3cb59605d40e..567b27b68ec9 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.hxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 5df6fc1fca5d..4bbcda92318c 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,10 +48,8 @@
#include "bookmark.hrc"
#include "misc.hrc"
-
const String BookmarkCombo::aForbiddenChars = String::CreateFromAscii("/\\@:*?\";,.#");
-
IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox )
{
sal_Bool bSelEntries = pBox->GetSelectEntryCount() != 0;
@@ -79,38 +78,33 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox )
}
- aOkBtn.Enable(!bSelEntries); // neue Textmarke
- aDeleteBtn.Enable(bSelEntries); // loeschbar?
+ aOkBtn.Enable(!bSelEntries); // new text mark
+ aDeleteBtn.Enable(bSelEntries); // deletable?
return 0;
}
/*------------------------------------------------------------------------
- Beschreibung: Callback zum Loeschen einer Textmarke
+ Description: callback to delete a text mark
-----------------------------------------------------------------------*/
-
IMPL_LINK( SwInsertBookmarkDlg, DeleteHdl, Button *, EMPTYARG )
{
- // Textmarken aus der ComboBox entfernen
+ // remove text marks from the ComboBox
for (sal_uInt16 i = aBookmarkBox.GetSelectEntryCount(); i; i-- )
aBookmarkBox.RemoveEntry(aBookmarkBox.GetSelectEntryPos(i - 1));
aBookmarkBox.SetText(aEmptyStr);
- aDeleteBtn.Enable(sal_False); // keine weiteren Eintraege vorhanden
- // aBookmarkBox.SetText(aEmptyStr);
+ aDeleteBtn.Enable(sal_False); // no further entries there
- aOkBtn.Enable(); // Im OK Handler wird geloescht
+ aOkBtn.Enable(); // the OK handler deletes
return 0;
}
/*------------------------------------------------------------------------
- Beschreibung: Callback fuer OKButton. Fuegt eine neue Textmarke
- an die akt. Position ein. Geloeschte Textmarken werden auch am Modell
- entfernt.
+ Description: callback for OKButton. Inserts a new text mark to the
+ current position. Deleted text marks are also deleted in the model.
-----------------------------------------------------------------------*/
-
-
void SwInsertBookmarkDlg::Apply()
{
//at first remove deleted bookmarks to prevent multiple bookmarks with the same
@@ -125,7 +119,7 @@ void SwInsertBookmarkDlg::Apply()
aReq.Done();
}
- // Textmarke einfuegen
+ // insert text mark
sal_uInt16 nLen = aBookmarkBox.GetText().Len();
SwBoxEntry aTmpEntry(aBookmarkBox.GetText(), 0 );
@@ -145,10 +139,8 @@ void SwInsertBookmarkDlg::Apply()
}
/*------------------------------------------------------------------------
- Beschreibung: CTOR
+ Description: CTOR
-----------------------------------------------------------------------*/
-
-
SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRequest& rRequest ) :
SvxStandardDialog(pParent,SW_RES(DLG_INSERT_BOOKMARK)),
@@ -166,7 +158,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe
aDeleteBtn.SetClickHdl(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
- // Combobox mit vorhandenen Bookmarks fuellen
+ // fill Combobox with existing bookmarks
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
sal_uInt16 nId = 0;
for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
@@ -180,45 +172,25 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe
sRemoveWarning = String(SW_RES(STR_REMOVE_WARNING));
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
SwInsertBookmarkDlg::~SwInsertBookmarkDlg()
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
BookmarkCombo::BookmarkCombo( Window* pWin, const ResId& rResId ) :
SwComboBox(pWin, rResId)
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
sal_uInt16 BookmarkCombo::GetFirstSelEntryPos() const
{
return GetSelEntryPos(0);
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
sal_uInt16 BookmarkCombo::GetNextSelEntryPos(sal_uInt16 nPos) const
{
return GetSelEntryPos(nPos + 1);
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const
{
sal_Unicode cSep = GetMultiSelectionSeparator();
@@ -237,10 +209,6 @@ sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const
return COMBOBOX_ENTRY_NOTFOUND;
}
-/*------------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
sal_uInt16 BookmarkCombo::GetSelectEntryCount() const
{
sal_uInt16 nCnt = 0;
@@ -256,9 +224,8 @@ sal_uInt16 BookmarkCombo::GetSelectEntryCount() const
}
/*------------------------------------------------------------------------
- Beschreibung: Position in der Listbox (der ComboBox)
+ Description: position inside of the listbox (the ComboBox)
-----------------------------------------------------------------------*/
-
sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const
{
sal_uInt16 nCnt = 0;
@@ -281,9 +248,7 @@ sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const
return COMBOBOX_ENTRY_NOTFOUND;
}
-/* -----------------05.02.99 08:39-------------------
- *
- * --------------------------------------------------*/
+
long BookmarkCombo::PreNotify( NotifyEvent& rNEvt )
{
long nHandled = 0;
@@ -299,5 +264,4 @@ long BookmarkCombo::PreNotify( NotifyEvent& rNEvt )
return nHandled;
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/bookmark.src b/sw/source/ui/misc/bookmark.src
index 54e4bad5c5cf..da27b5553b79 100644
--- a/sw/source/ui/misc/bookmark.src
+++ b/sw/source/ui/misc/bookmark.src
@@ -34,7 +34,6 @@ ModalDialog DLG_INSERT_BOOKMARK
HelpID = CMD_FN_INSERT_BOOKMARK ;
OUTPUTSIZE = TRUE ;
Size = MAP_APPFONT ( 179 , 96 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Textmarke einfügen : Textmarke einf³gen */
Text [ en-US ] = "Insert Bookmark" ;
MOVEABLE = TRUE ;
SVLOOK = TRUE ;
@@ -66,7 +65,6 @@ ModalDialog DLG_INSERT_BOOKMARK
HelpID = "sw:PushButton:DLG_INSERT_BOOKMARK:BT_DELETE";
Pos = MAP_APPFONT ( 123 , 40 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */
Text [ en-US ] = "~Delete" ;
TABSTOP = TRUE ;
DISABLE = TRUE ;
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 731e1451bd32..fee905ac8119 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,14 +35,9 @@
#include <svl/style.hxx>
-#include <errhdl.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <docfnote.hxx>
#include <impfnote.hxx>
#include <ftninfo.hxx>
@@ -53,18 +49,10 @@
#include <uitool.hxx>
#include <poolfmt.hxx>
#include <swstyle.h>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _DOCFNOTE_HRC
#include <docfnote.hrc>
-#endif
-#ifndef _FRMUI_HRC
#include <frmui.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
SwFootNoteOptionDlg::SwFootNoteOptionDlg( Window *pParent, SwWrtShell &rS ) :
@@ -196,30 +184,30 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
else
{
const SwFtnInfo &rInf = pSh->GetFtnInfo();
- // Position (Seite, Kapitel) setzen
+ // set position (page, chapter)
if ( rInf.ePos == FTNPOS_PAGE )
{
aPosPageBox.Check();
aPageTemplLbl.Enable(sal_False);
aPageTemplBox.Enable(sal_False);
}
- else // if ( rInf.ePos == FTNPOS_CHAPTER )
+ else
{
aPosChapterBox.Check();
aNumCountBox.RemoveEntry(aNumPage);
aNumCountBox.RemoveEntry(aNumChapter);
bPosDoc = sal_True;
}
- // Verweistexte
+ // reference tests
aContEdit.SetText(rInf.aQuoVadis);
aContFromEdit.SetText(rInf.aErgoSum);
- // gesammelt wo
+ // collected
SelectNumbering(rInf.eNum);
}
- // Numerierung
- // Art
+ // numbering
+ // art
aNumViewBox.SelectNumberingType( pInf->aFmt.GetNumberingType());
aOffsetFld.SetValue(pInf->nFtnOffset + 1);
aPrefixED.SetText(pInf->GetPrefix());
@@ -234,8 +222,8 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
aFtnCharAnchorTemplBox.SelectEntry( pCharFmt->GetName() );
aFtnCharAnchorTemplBox.SaveValue();
- // Vorlagen - Sonderbereiche
- // Absatz
+ // styles special regions
+ // paragraph
SfxStyleSheetBasePool* pStyleSheetPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, SWSTYLEBIT_EXTRA);
SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
@@ -256,7 +244,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
aParaTemplBox.SelectEntry( sStr ); // Default
else
{
- ASSERT(!pColl->IsDefault(), "Defaultvorlage fuer Fussnoten ist falsch.");
+ OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong");
const sal_uInt16 nPos = aParaTemplBox.GetEntryPos(pColl->GetName());
if( LISTBOX_ENTRY_NOTFOUND != nPos )
aParaTemplBox.SelectEntryPos( nPos );
@@ -267,7 +255,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
}
}
- // Seite
+ // page
for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i )
aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr ));
@@ -293,10 +281,9 @@ SfxTabPage *SwEndNoteOptionPage::Create( Window *pParent, const SfxItemSet &rSet
}
/*------------------------------------------------------------------------
- Beschreibung: Unterschiedliche Arten der Numerierung; da die Listbox
- unterschiedlich viele Eintraege hat, hier Funktionen
- fuer das Setzen und Erfragen der gemeinten Art
- der Numerierung.
+ Description: Different kinds of numbering; because the Listbox has
+ varying numbers of entries, here are functions to
+ set and query the intended kind of numbering.
------------------------------------------------------------------------*/
void SwEndNoteOptionPage::SelectNumbering(int eNum)
{
@@ -312,9 +299,9 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum)
case FTNNUM_CHAPTER:
sSelect = aNumChapter;
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- DBG_ERROR("Which numbering type?");
+ OSL_FAIL("Which numbering type?");
#endif
}
aNumCountBox.SelectEntry(sSelect);
@@ -329,13 +316,10 @@ int SwEndNoteOptionPage::GetNumbering() const
return (int) bPosDoc? nPos + 1: nPos;
}
-/*-----------------09.02.98 11:17-------------------
-
---------------------------------------------------*/
void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
{
pSh = &rShell;
- // Zeichenvorlagen sammeln
+ // collect character templates
aFtnCharTextTemplBox.Clear();
aFtnCharAnchorTemplBox.Clear();
::FillCharStyleListBox(aFtnCharTextTemplBox,
@@ -346,10 +330,8 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
}
/*------------------------------------------------------------------------
- Beschreibung: Handler hinter dem Button fuer Sammeln der Fussnote
- auf der Seite.
- In diesem Fall koennen alle Numerierungsarten verwendet
- werden.
+ Description: Handler behind the button to collect the footnote at the
+ page. In this case all kinds of numbering can be used.
------------------------------------------------------------------------*/
@@ -369,11 +351,6 @@ IMPL_LINK( SwEndNoteOptionPage, PosPageHdl, Button *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
IMPL_LINK( SwEndNoteOptionPage, NumCountHdl, ListBox*, EMPTYARG )
{
sal_Bool bEnable = sal_True;
@@ -388,10 +365,9 @@ IMPL_LINK( SwEndNoteOptionPage, NumCountHdl, ListBox*, EMPTYARG )
}
/*------------------------------------------------------------------------
- Beschreibung: Handler hinter dem Button fuer Sammeln der Fussnote
- am Kapitel oder Dokumentende.
- In diesem Fall kann keine seitenweise Numerierung verwendet
- werden.
+ Description: Handler behind the button to collect the footnote at the
+ chapter or end of the document. In this case no pagewise
+ numbering can be used.
------------------------------------------------------------------------*/
@@ -448,17 +424,17 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
pInf->SetAnchorCharFmt( lcl_GetCharFormat( pSh,
aFtnCharAnchorTemplBox.GetSelectEntry() ) );
- // Absatzvorlage
+ // paragraph template
sal_uInt16 nPos = aParaTemplBox.GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
const String aFmtName( aParaTemplBox.GetSelectEntry() );
SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY);
- ASSERT(pColl, "Absatzvorlage nicht gefunden.");
+ OSL_ENSURE(pColl, "paragraph style not found");
pInf->SetFtnTxtColl(*pColl);
}
- // Seitenvorlage
+ // page template
pInf->ChgPageDesc( pSh->FindPageDescByName(
aPageTemplBox.GetSelectEntry(), sal_True ) );
@@ -501,3 +477,4 @@ SfxTabPage *SwFootNoteOptionPage::Create(Window *pParent, const SfxItemSet &rSet
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/docfnote.src b/sw/source/ui/misc/docfnote.src
index 5e1b1e4ac71b..171cb5bc0dad 100644
--- a/sw/source/ui/misc/docfnote.src
+++ b/sw/source/ui/misc/docfnote.src
@@ -523,7 +523,6 @@ TabPage TP_ENDNOTEOPTION
{
Pos = MAP_APPFONT ( 80 , 91 ) ;
Size = MAP_APPFONT ( 174 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Hinweistext mehrseitige Fußnoten : Hinweistext mehrseitige Fu˜noten */
Text [ en-US ] = "Continuation notice" ;
};
FixedText FT_CONT
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index de1342c91ae9..6dce9d2d01a5 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#define _SVSTDARR_STRINGS
#include <tools/urlobj.hxx>
#include <tools/stream.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <vcl/help.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/tempfile.hxx>
@@ -53,15 +52,9 @@
#include <glosdoc.hxx>
#include <swunohelper.hxx>
-#ifndef _GLOSBIB_HRC
#include <glosbib.hrc>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#define PATH_CASE_SENSITIVE 0x01
@@ -69,9 +62,6 @@
#define RENAME_TOKEN_DELIM (sal_Unicode)1
-/*-----------------09.06.97 13:05-------------------
-
---------------------------------------------------*/
SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
const SvStrings* pPathArr,
SwGlossaryHdl *pHdl) :
@@ -143,7 +133,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
pData->sGroupName = sGroup;
pData->sGroupTitle = sTitle;
String sTemp(sTitle);
- //sGroup.GetToken(0, GLOS_DELIM)
sTemp += '\t';
pData->sPath = aPathLB.GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32());
sTemp += pData->sPath;
@@ -154,9 +143,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
aGroupTLB.GetModel()->Resort();
}
-/*-----------------09.06.97 13:05-------------------
-
---------------------------------------------------*/
SwGlossaryGroupDlg::~SwGlossaryGroupDlg()
{
@@ -178,11 +164,7 @@ SwGlossaryGroupDlg::~SwGlossaryGroupDlg()
}
-/*-----------------09.06.97 13:11-------------------
-
---------------------------------------------------*/
-
-void __EXPORT SwGlossaryGroupDlg::Apply()
+void SwGlossaryGroupDlg::Apply()
{
if(aNewPB.IsEnabled())
NewHdl(&aNewPB);
@@ -198,8 +180,7 @@ void __EXPORT SwGlossaryGroupDlg::Apply()
const String sDelGroup = pDelEntry->GetToken(0, '\t');
if( sDelGroup == aActGroup )
{
- //soll die aktuelle Gruppe geloescht werden, muss die akt. Gruppe
- //umgesetzt werden
+ //when the current group is deleted, the current group has to be relocated
if(aGroupTLB.GetEntryCount())
{
SvLBoxEntry* pFirst = aGroupTLB.First();
@@ -220,7 +201,7 @@ void __EXPORT SwGlossaryGroupDlg::Apply()
}
}
- //erst umbenennen, falls es schon eins gab
+ //don't rename before there was one
if(pRenamedArr && pRenamedArr->Count())
{
sal_uInt16 nCount = pRenamedArr->Count();
@@ -252,9 +233,7 @@ void __EXPORT SwGlossaryGroupDlg::Apply()
}
}
}
-/*-----------------09.06.97 13:12-------------------
---------------------------------------------------*/
IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG )
{
aNewPB.Enable(sal_False);
@@ -280,21 +259,16 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG )
return 0;
}
-/*-----------------09.06.97 13:22-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG )
{
String sGroup(aNameED.GetText());
-// sGroup.ToLower();
sGroup += GLOS_DELIM;
sGroup += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
- DBG_ASSERT(!pGlosHdl->FindGroupName(sGroup), "Gruppe bereits vorhanden!");
+ OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!");
if(!pInsertedArr)
pInsertedArr = new SvStrings;
pInsertedArr->Insert(new String(sGroup), pInsertedArr->Count());
String sTemp(aNameED.GetText());
-// sTemp.ToLower();
sTemp += '\t';
sTemp += aPathLB.GetSelectEntry();
SvLBoxEntry* pEntry = aGroupTLB.InsertEntry(sTemp);
@@ -309,9 +283,7 @@ IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG )
return 0;
}
-/*-----------------09.06.97 13:22-------------------
---------------------------------------------------*/
IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
{
SvLBoxEntry* pEntry = aGroupTLB.FirstSelected();
@@ -322,8 +294,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
}
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
String sEntry(pUserData->sGroupName);
- // befindet sich der zu loeschende Name schon unter den
- // den neuen - dann weg damit
+ // if the name to be deleted is among the new ones - get rid of it
sal_Bool bDelete = sal_True;
if(pInsertedArr && pInsertedArr->Count())
{
@@ -340,7 +311,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
}
}
- // moeglicherweise sollte es schon umbenannt werden?
+ // it should probably be renamed?
if(bDelete)
{
if(pRenamedArr && pRenamedArr->Count())
@@ -377,9 +348,6 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
return 0;
}
-/* -----------------23.11.98 12:26-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
{
SvLBoxEntry* pEntry = aGroupTLB.FirstSelected();
@@ -392,10 +360,9 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
sNewName += GLOS_DELIM;
sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
- DBG_ASSERT(!pGlosHdl->FindGroupName(sNewName), "Gruppe bereits vorhanden!");
+ OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!");
- // befindet sich der umzubenennende Name unter den
- // den neuen - dann austauschen
+ // if the name to be renamed is among the new ones - replace
sal_Bool bDone = sal_False;
if(pInsertedArr && pInsertedArr->Count())
{
@@ -425,7 +392,6 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
delete (GlosBibUserData*)pEntry->GetUserData();
aGroupTLB.GetModel()->Remove(pEntry);
String sTemp(aNameED.GetText());
-// sTemp.ToLower();
sTemp += '\t';
sTemp += aPathLB.GetSelectEntry();
pEntry = aGroupTLB.InsertEntry(sTemp);
@@ -439,13 +405,10 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
aGroupTLB.GetModel()->Resort();
return 0;
}
-/*-----------------09.06.97 13:42-------------------
---------------------------------------------------*/
IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG )
{
String sEntry(aNameED.GetText());
-// sEntry.ToLower();
sal_Bool bEnableNew = sal_True;
sal_Bool bEnableDel = sal_False;
sal_uLong nCaseReadonly =
@@ -460,7 +423,7 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG )
nPos = aGroupTLB.GetEntryPos(sEntry, 0);
- //ist es nicht case sensitive muss man selbst suchen
+ //if it's not case sensitive you have to search for yourself
if( 0xffffffff == nPos)
{
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
@@ -490,11 +453,6 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG )
{
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
bEnableDel = IsDeleteAllowed(pUserData->sGroupName);
-
-// String sGroup = aGroupTLB.GetEntryText(pEntry, 0);
-// sGroup += GLOS_DELIM;
-// sGroup += String::CreateFromInt32(aPathLB.GetEntryPos(aGroupTLB.GetEntryText(pEntry, 1)));
-// bEnableDel = IsDeleteAllowed(sGroup);
}
aDelPB.Enable(bEnableDel);
@@ -503,17 +461,13 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup)
{
sal_Bool bDel = (!pGlosHdl->IsReadOnly(&rGroup));
- // OM: befindet sich der Name unter den den neuen Bereichsnamen,
- // dann ist er auch loeschbar! Bei noch nicht existenten Bereichsnamen
- // liefert ReadOnly naemlich sal_True.
+ // OM: if the name is among the new region name, it is deletable
+ // as well! Because for non existing region names ReadOnly issues
+ // sal_True.
if(pInsertedArr && pInsertedArr->Count())
{
@@ -532,9 +486,6 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup)
return bDel;
}
-/*-----------------18.07.97 19:06-------------------
-
---------------------------------------------------*/
void FEdit::KeyInput( const KeyEvent& rKEvent )
{
KeyCode aCode = rKEvent.GetKeyCode();
@@ -544,9 +495,7 @@ void FEdit::KeyInput( const KeyEvent& rKEvent )
SVT_SEARCHPATH_DELIMITER != rKEvent.GetCharCode() )
Edit::KeyInput( rKEvent );
}
-/* -----------------------------08.02.00 15:07--------------------------------
- ---------------------------------------------------------------------------*/
void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
{
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
@@ -577,3 +526,5 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/glosbib.src b/sw/source/ui/misc/glosbib.src
index 97d83c4fdd90..25b83bf27d68 100644
--- a/sw/source/ui/misc/glosbib.src
+++ b/sw/source/ui/misc/glosbib.src
@@ -50,7 +50,6 @@ ModalDialog DLG_BIB_BASE
HelpID = "sw:PushButton:DLG_BIB_BASE:PB_DELETE";
Pos = MAP_APPFONT ( 293 , 83 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
Disable = TRUE ;
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index 2545da326b11..78994abfc25f 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,15 +41,12 @@
#ifndef __RSC //autogen
#include <tools/errinf.hxx>
#endif
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <svl/urihelper.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
#include <svl/fstathelper.hxx>
-#endif
#include <unotools/pathoptions.hxx>
#include <unotools/tempfile.hxx>
#include <swtypes.hxx>
-#include <errhdl.hxx> // ASSERT
#include <uitool.hxx>
#include <glosdoc.hxx>
#include <shellio.hxx>
@@ -56,18 +54,12 @@
#include <unoatxt.hxx>
#include <swerror.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-
// PUBLIC METHODES -------------------------------------------------------
-/* -----------------------------08.02.00 15:54--------------------------------
-
- ---------------------------------------------------------------------------*/
String lcl_CheckFileName( const String& rNewFilePath,
const String& rNewGroupName )
{
@@ -111,32 +103,31 @@ String lcl_CheckFileName( const String& rNewFilePath,
}
return sRet;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Liefert den Namen der Default-Gruppe
+ Description: supplies the default group's name
------------------------------------------------------------------------*/
-
-
String SwGlossaries::GetDefName()
{
return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "standard" ));
}
+
/*------------------------------------------------------------------------
- Beschreibung: Liefert die Anzahl der Textbausteingruppen
+ Description: supplies the number of text block groups
------------------------------------------------------------------------*/
-
-
sal_uInt16 SwGlossaries::GetGroupCnt()
{
return GetNameList()->Count();
}
+
/*------------------------------------------------------------------------
- Beschreibung: Liefert den Gruppennamen
+ Description: supplies the group's name
------------------------------------------------------------------------*/
sal_Bool SwGlossaries::FindGroupName(String & rGroup)
{
- // enthaelt der Gruppenname keinen Pfad, kann hier ein passender
- // Gruppeneintrag gesucht werden;
+ // if the group name doesn't contain a path, a suitable group entry
+ // can the searched for here;
sal_uInt16 nCount = GetGroupCnt();
sal_uInt16 i;
for(i= 0; i < nCount; i++)
@@ -148,8 +139,8 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup)
return sal_True;
}
}
- //man darf zweimal suchen, denn bei mehreren Verzeichnissen koennte
- //der caseinsensitive Name mehrfach auftreten
+ // you can search two times because for more directories the case sensitive
+ // name could occur multiple times
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
for(i = 0; i < nCount; i++)
{
@@ -165,18 +156,13 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup)
}
return sal_False;
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
String SwGlossaries::GetGroupName(sal_uInt16 nGroupId)
{
- ASSERT(nGroupId < m_pGlosArr->Count(), Textbausteinarray ueberindiziert);
+ OSL_ENSURE(nGroupId < m_pGlosArr->Count(), "Textbausteinarray ueberindiziert");
return *(*m_pGlosArr)[nGroupId];
}
-/* -----------------------------08.02.00 13:04--------------------------------
- ---------------------------------------------------------------------------*/
String SwGlossaries::GetGroupTitle( const String& rGroupName )
{
String sRet;
@@ -193,13 +179,12 @@ String SwGlossaries::GetGroupTitle( const String& rGroupName )
}
/*------------------------------------------------------------------------
- Beschreibung: Liefert das Textbaustein-Dokument der Gruppe rName
+ Description: supplies the group rName's text block document
------------------------------------------------------------------------*/
-
SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
sal_Bool bCreate) const
{
- // gfs. in die Liste der Textbausteine eintragen
+ // insert to the list of text blocks if applicable
if(bCreate && m_pGlosArr)
{
const String aName(rName);
@@ -213,7 +198,7 @@ SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
break;
}
if(i == nCount)
- { // Baustein nicht in der Liste
+ { // block not in the list
String *pTmp = new String(aName);
m_pGlosArr->Insert(pTmp, m_pGlosArr->Count());
}
@@ -222,19 +207,17 @@ SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
}
/*------------------------------------------------------------------------
- Beschreibung: Loeschen Textblock
+ Description: delete a text block
------------------------------------------------------------------------*/
-
void SwGlossaries::PutGroupDoc(SwTextBlocks *pBlock) {
delete pBlock;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Erzeugt ein neues Dokument mit dem Gruppenname
- Wird temp. auch als File angelegt, damit die
- Gruppen auch spaeter (ohne Zugriff) vorhanden sind.
+ Description: Creates a new document with the group name. temporarly
+ also created as file so that groups remain there later
+ (without access).
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle)
{
sal_uInt16 nNewPath = (sal_uInt16)rGroupName.GetToken(1, GLOS_DELIM).ToInt32();
@@ -256,9 +239,7 @@ sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle)
}
return sal_False;
}
-/* -----------------23.11.98 13:13-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwGlossaries::RenameGroupDoc(
const String& rOldGroup, String& rNewGroup, const String& rNewTitle )
{
@@ -271,7 +252,7 @@ sal_Bool SwGlossaries::RenameGroupDoc(
sOldFileURL += rOldGroup.GetToken(0, GLOS_DELIM);
sOldFileURL += SwGlossaries::GetExtension();
sal_Bool bExist = FStatHelper::IsDocument( sOldFileURL );
- DBG_ASSERT(bExist, "Gruppe existiert nicht!");
+ OSL_ENSURE(bExist, "group doesn't exist!");
if(bExist)
{
sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.GetToken(1, GLOS_DELIM).ToInt32();
@@ -280,14 +261,13 @@ sal_Bool SwGlossaries::RenameGroupDoc(
String sNewFilePath(*(*m_pPathArr)[nNewPath]);
String sNewFileName = lcl_CheckFileName(
sNewFilePath, rNewGroup.GetToken(0, GLOS_DELIM));
- //String aTmp( rNewGroup.GetToken(0, GLOS_DELIM));
const sal_uInt16 nFileNameLen = sNewFileName.Len();
sNewFileName += SwGlossaries::GetExtension();
String sTempNewFilePath(sNewFilePath);
sTempNewFilePath += INET_PATH_TOKEN;
sTempNewFilePath += sNewFileName ;
bExist = FStatHelper::IsDocument( sTempNewFilePath );
- DBG_ASSERT(!bExist, "Gruppe existiert bereits!");
+ OSL_ENSURE(!bExist, "group already exists!");
if(!bExist)
{
sal_Bool bCopyCompleted = SWUnoHelper::UCB_CopyFile(
@@ -320,10 +300,8 @@ sal_Bool SwGlossaries::RenameGroupDoc(
}
/*------------------------------------------------------------------------
- Beschreibung: Loescht eine Textbausteingruppe
+ Description: Deletes a text block group
------------------------------------------------------------------------*/
-
-
sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
{
sal_uInt16 nPath = (sal_uInt16)rName.GetToken(1, GLOS_DELIM).ToInt32();
@@ -338,19 +316,18 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
aTmp += SwGlossaries::GetExtension();
sFileURL += INET_PATH_TOKEN;
sFileURL += aTmp;
- // Auch, wenn das File nicht existiert, muss es aus der Liste
- // der Textbausteinbereiche entfernt werden
- // Kein && wegen CFfront
+ // Even if the file doesn't exist it hast to be deleted from
+ // the list of text block regions
+ // no && because of CFfront
sal_Bool bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL );
- DBG_ASSERT(bRemoved, "file has not been removed");
+ OSL_ENSURE(bRemoved, "file has not been removed");
RemoveFileFromList( aName );
return bRemoved;
}
+
/*------------------------------------------------------------------------
- Beschreibung: DTOR
+ Description: DTOR
------------------------------------------------------------------------*/
-
-
SwGlossaries::~SwGlossaries()
{
sal_uInt16 nCount = m_pGlosArr? m_pGlosArr->Count() : 0;
@@ -372,11 +349,10 @@ SwGlossaries::~SwGlossaries()
InvalidateUNOOjects();
}
+
/*------------------------------------------------------------------------
- Beschreibung: Bausteindokument einlesen
+ Description: read a block document
------------------------------------------------------------------------*/
-
-
SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate ) const
{
sal_uInt16 nPath = (sal_uInt16)rName.GetToken(1, GLOS_DELIM).ToInt32();
@@ -412,9 +388,8 @@ SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate )
}
/*------------------------------------------------------------------------
- Beschreibung: Zugriff auf die Liste der Name; diese wird gfs. eingelesen
+ Description: access to the list of names; read in if applicable
------------------------------------------------------------------------*/
-
SvStrings* SwGlossaries::GetNameList()
{
if( !m_pGlosArr )
@@ -442,7 +417,7 @@ SvStrings* SwGlossaries::GetNameList()
}
if(!m_pGlosArr->Count())
{
- // Der Standard-Baustein steht im ersten Teil des Pfades
+ // the standard block is inside of the path's first part
String *pTmp = new String( SwGlossaries::GetDefName() );
(*pTmp) += GLOS_DELIM;
(*pTmp) += '0';
@@ -453,10 +428,8 @@ SvStrings* SwGlossaries::GetNameList()
}
/*------------------------------------------------------------------------
- Beschreibung: CTOR
+ Description: CTOR
------------------------------------------------------------------------*/
-
-
SwGlossaries::SwGlossaries() :
m_pPathArr(0),
m_pGlosArr(0)
@@ -466,11 +439,11 @@ SwGlossaries::SwGlossaries() :
}
/*------------------------------------------------------------------------
- Beschreibung: Neuen Pfad einstellen und internes Array neu aufbauen
+ Description: set new path and recreate internal array
------------------------------------------------------------------------*/
-/* -----------------21.01.99 15:36-------------------
-* #61050# Doppelte Pfade fuehren zu Verwirrung - als raus damit
+/* --------------------------------------------------
+* #61050# double paths cause irritation - get rid of it
* --------------------------------------------------*/
sal_Bool lcl_FindSameEntry(const SvStrings& rDirArr, const String& rEntryURL)
{
@@ -526,7 +499,7 @@ void SwGlossaries::UpdateGlosPath(sal_Bool bFull)
(m_sErrPath.Len() && (bPathChanged || m_sOldErrPath != m_sErrPath)) )
{
m_sOldErrPath = m_sErrPath;
- // Falscher Pfad, d.h. AutoText-Verzeichnis existiert nicht
+ // wrong path, that means AutoText directory doesn't exist
ErrorHandler::HandleError( *new StringErrorInfo(
ERR_AUTOPATH_ERROR, m_sErrPath,
@@ -548,27 +521,18 @@ void SwGlossaries::UpdateGlosPath(sal_Bool bFull)
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
void SwGlossaries::ShowError()
{
sal_uInt32 nPathError = *new StringErrorInfo(ERR_AUTOPATH_ERROR,
m_sErrPath, ERRCODE_BUTTON_OK );
ErrorHandler::HandleError( nPathError );
}
-/* -----------------------------09.02.00 11:37--------------------------------
- ---------------------------------------------------------------------------*/
String SwGlossaries::GetExtension()
{
return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( ".bau" ));
}
-
-
void SwGlossaries::RemoveFileFromList( const String& rGroup )
{
if(m_pGlosArr)
@@ -630,11 +594,10 @@ void SwGlossaries::RemoveFileFromList( const String& rGroup )
}
}
-
String SwGlossaries::GetCompleteGroupName( const rtl::OUString& GroupName )
{
sal_uInt16 nCount = GetGroupCnt();
- //wenn der Gruppenname intern erzeugt wurde, dann steht auch hier der Pfad drin
+ // when the group name was created internally the path is here as well
String sGroup(GroupName);
String sGroupName(sGroup.GetToken(0, GLOS_DELIM));
String sPath = sGroup.GetToken(1, GLOS_DELIM);
@@ -650,7 +613,6 @@ String SwGlossaries::GetCompleteGroupName( const rtl::OUString& GroupName )
return aEmptyStr;
}
-
void SwGlossaries::InvalidateUNOOjects()
{
// invalidate all the AutoTextGroup-objects
@@ -685,9 +647,6 @@ void SwGlossaries::InvalidateUNOOjects()
m_aGlossaryEntries.swap( aTmpe );
}
-//-----------------------------------------------------------------------
-//--- 03.03.2003 14:15:32 -----------------------------------------------
-
Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const ::rtl::OUString& _rGroupName, bool _bCreate )
{
// first, find the name with path-extension
@@ -742,9 +701,6 @@ Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const ::rtl::O
return xGroup;
}
-//-----------------------------------------------------------------------
-//--- 03.03.2003 13:46:06 -----------------------------------------------
-
Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( const String& _rCompleteGroupName, const ::rtl::OUString& _rGroupName, const ::rtl::OUString& _rEntryName,
bool _bCreate )
{
@@ -802,5 +758,4 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( const String&
return xReturn;
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 9835b2f4d681..75901c0df0c0 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,7 @@
#include <vcl/menu.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/help.hxx>
-#ifndef _SVSTDARR_HXX
#include <svl/svstdarr.hxx>
-#endif
#include <svl/stritem.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/lingucfg.hxx>
@@ -69,7 +68,7 @@
#include <glossary.hxx>
#include <gloshdl.hxx>
#include <glosbib.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
+#include <initui.hxx> // for ::GetGlossaries()
#include <glosdoc.hxx>
#include <macassgn.hxx>
#include <swevent.hxx>
@@ -79,15 +78,9 @@
#include <cmdid.h>
#include <helpid.h>
#include <swerror.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _GLOSSARY_HRC
#include <glossary.hrc>
-#endif
#include <swmodule.hxx>
#include <sfx2/filedlghelper.hxx>
@@ -129,9 +122,6 @@ String lcl_GetValidShortCut( const String& rName )
return aBuf;
}
-/* -----------------------------08.02.00 10:28--------------------------------
-
- ---------------------------------------------------------------------------*/
struct GroupUserData
{
String sGroupName;
@@ -144,7 +134,7 @@ struct GroupUserData
};
/*------------------------------------------------------------------------
- Beschreibung: Dialog fuer neuen Bausteinnamen
+ Description: dialog for new block name
------------------------------------------------------------------------*/
class SwNewGlosNameDlg : public ModalDialog
{
@@ -202,9 +192,8 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
}
/*------------------------------------------------------------------------
- Beschreibung: aktuell eingestellte Gruppe erfragen / setzen
+ Description: query / set currently set group
------------------------------------------------------------------------*/
-
String SwGlossaryDlg::GetCurrGroup()
{
if( ::GetCurrGlosGroup() && ::GetCurrGlosGroup()->Len() )
@@ -212,8 +201,6 @@ String SwGlossaryDlg::GetCurrGroup()
return SwGlossaries::GetDefName();
}
-
-
void SwGlossaryDlg::SetActGroup(const String &rGrp)
{
if( !::GetCurrGlosGroup() )
@@ -221,8 +208,6 @@ void SwGlossaryDlg::SetActGroup(const String &rGrp)
*(::GetCurrGlosGroup()) = rGrp;
}
-
-
SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
SwGlossaryHdl * pGlosHdl, SwWrtShell *pWrtShell) :
@@ -264,7 +249,7 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
{
SvtLinguConfig aLocalLinguConfig;
- // Static-Pointer initialisieren
+ // initialise static-pointer
if( !::GetCurrGlosGroup() )
::SetCurrGlosGroup(new String);//(SwGlossaries::GetDefName());
@@ -286,9 +271,9 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aNameED.SetMaxTextLen(LONG_LENGTH);
FreeResource();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
- aShowExampleCB.Check( pCfg->IsAutoTextPreview());
+ aShowExampleCB.Check( rCfg.IsAutoTextPreview());
ShowPreviewHdl(&aShowExampleCB);
bIsDocReadOnly = pSh->GetView().GetDocShell()->IsReadOnly() ||
@@ -299,33 +284,28 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aCategoryBox.SetHelpId(HID_MD_GLOS_CATEGORY);
aCategoryBox.SetStyle(aCategoryBox.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
aCategoryBox.GetModel()->SetSortMode(SortAscending);
- aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren
+ aCategoryBox.SetHighlightRange(); // select over full width
aCategoryBox.SetNodeDefaultImages( );
aCategoryBox.SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
aCategoryBox.SetAccessibleRelationLabeledBy(&aInsertTipCB);
Init();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwGlossaryDlg::~SwGlossaryDlg()
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ rCfg.SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
aCategoryBox.Clear();
aEditBtn.SetPopupMenu(0);
delete pMenu;
delete pExampleFrame;
}
+
/*------------------------------------------------------------------------
- Beschreibung: Auswahl neue Gruppe
+ Description: select new group
------------------------------------------------------------------------*/
-
-
IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
{
SvLBoxEntry* pEntry = pBox->FirstSelected();
@@ -338,7 +318,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
(*pGlosGroup) += GLOS_DELIM;
(*pGlosGroup) += String::CreateFromInt32(pGroupData->nPathIdx);
pGlossaryHdl->SetCurGroup(*pGlosGroup);
- // Aktuellen Textbaustein setzen
+ // set current text block
bReadOnly = pGlossaryHdl->IsReadOnly();
EnableShortName( !bReadOnly );
aEditBtn.Enable(!bReadOnly);
@@ -354,13 +334,13 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
}
else
ShowAutoText(aEmptyStr, aEmptyStr);
- //Controls aktualisieren
+ // update controls
NameModify(&aShortNameEdit);
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY );
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, sTemp));
@@ -368,10 +348,6 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwGlossaryDlg::Apply()
{
@@ -381,7 +357,7 @@ void SwGlossaryDlg::Apply()
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_INSERT_GLOSSARY );
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, sTemp));
@@ -389,22 +365,20 @@ void SwGlossaryDlg::Apply()
aReq.Done();
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
/* inline */ void SwGlossaryDlg::EnableShortName(sal_Bool bOn)
{
aShortNameLbl.Enable(bOn);
aShortNameEdit.Enable(bOn);
}
-/* -----------------26.11.98 16:15-------------------
- * existiert der Titel in der ausgewaehlten Gruppe?
+/* --------------------------------------------------
+ * does the title exist in the selected group?
* --------------------------------------------------*/
SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock,
const String& rShort)
{
- //evtl. vorhandenen Eintrag in der TreeListBox suchen
+ // look for possible entry in TreeListBox
SvLBoxEntry* pEntry = aCategoryBox.FirstSelected();
if(pEntry)
{
@@ -424,11 +398,6 @@ SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock,
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
{
String aName(aNameED.GetText());
@@ -446,8 +415,7 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
sal_Bool bNotFound = !DoesBlockExist(aName, sShortSearch);
if(bNameED)
{
- // ist der Text durch einen Klick in die Listbox in das
- // Edit gekommem?
+ // did the text get in to the Listbbox in the Edit with a click?
if(bNotFound)
{
aShortNameEdit.SetText( lcl_GetValidShortCut( aName ) );
@@ -472,10 +440,6 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox )
{
@@ -485,10 +449,6 @@ IMPL_LINK_INLINE_START( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox )
return 0;
}
IMPL_LINK_INLINE_END( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, EMPTYARG )
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn )
{
@@ -513,10 +473,6 @@ IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn )
pMn->EnableItem( FN_GL_IMPORT, bEnable );
return 1;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
{
@@ -533,7 +489,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
break;
case FN_GL_DEFINE_TEXT:
bNoAttr = sal_True;
- // Kein break!!!
+ // no break!!!
case FN_GL_DEFINE:
{
const String aStr(aNameED.GetText());
@@ -555,13 +511,13 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
pChild->SetUserData(new String(aShortName));
aNameED.SetText(aStr);
aShortNameEdit.SetText(aShortName);
- NameModify(&aNameED); // fuer Schalten der Buttons
+ NameModify(&aNameED); // for toggling the buttons
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq(pSh->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, sTemp));
@@ -612,7 +568,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName))
{
SvLBoxEntry* pChild = DoesBlockExist(aTitle, aShortName);
- DBG_ASSERT(pChild, "Eintrag nicht gefunden!");
+ OSL_ENSURE(pChild, "entry not found!");
SvLBoxEntry* pParent = aCategoryBox.GetParent(pChild);
aCategoryBox.Select(pParent);
@@ -638,7 +594,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
aItem.SetMacro( SW_EVENT_END_INS_GLOSSARY, aEnd );
aSet.Put( aItem );
- aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_TEXTBAUST ) );
+ aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) );
const SfxPoolItem* pItem;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -669,7 +625,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
SfxFilterMatcher aMatcher( String::CreateFromAscii(SwDocShell::Factory().GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
while ( pFilter )
{
@@ -700,11 +656,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
}
return 1;
}
+
/*--------------------------------------------------------------------
- Beschreibung: Dialog Verwaltung Bereiche
+ Description: dialog manage regions
--------------------------------------------------------------------*/
-
-
IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
{
SwGlossaries* pGloss = ::GetGlossaries();
@@ -780,19 +735,20 @@ IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
}
/*------------------------------------------------------------------------
- Beschreibung: Initialisierung; aus Ctor und nach Bearbeiten Bereiche
+ Description: initialisation; from Ctor and after editing regions
------------------------------------------------------------------------*/
-
-
void SwGlossaryDlg::Init()
{
aCategoryBox.SetUpdateMode( sal_False );
aCategoryBox.Clear();
- // Textbausteinbereiche anzeigen
+ // display text block regions
const sal_uInt16 nCnt = pGlossaryHdl->GetGroupCnt();
SvLBoxEntry* pSelEntry = 0;
const String sSelStr(::GetCurrGlosGroup()->GetToken(0, GLOS_DELIM));
const sal_uInt16 nSelPath = static_cast< sal_uInt16 >(::GetCurrGlosGroup()->GetToken(1, GLOS_DELIM).ToInt32());
+ // #i66304# - "My AutoText" comes from mytexts.bau, but should be translated
+ const String sMyAutoTextEnglish(RTL_CONSTASCII_USTRINGPARAM("My AutoText"));
+ const String sMyAutoTextTranslated(SW_RESSTR(STR_MY_AUTOTEXT));
for(sal_uInt16 nId = 0; nId < nCnt; ++nId )
{
String sTitle;
@@ -801,6 +757,8 @@ void SwGlossaryDlg::Init()
continue;
if(!sTitle.Len())
sTitle = sGroupName.GetToken( 0, GLOS_DELIM );
+ if(sTitle == sMyAutoTextEnglish)
+ sTitle = sMyAutoTextTranslated;
SvLBoxEntry* pEntry = aCategoryBox.InsertEntry( sTitle );
sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.GetToken( 1, GLOS_DELIM ).ToInt32());
@@ -813,7 +771,7 @@ void SwGlossaryDlg::Init()
if(sSelStr == pData->sGroupName && nSelPath == nPath)
pSelEntry = pEntry;
- //Eintraege fuer die Gruppen auffuellen
+ // fill entries for the groups
{
pGlossaryHdl->SetCurGroup(sGroupName, sal_False, sal_True);
const sal_uInt16 nCount = pGlossaryHdl->GetGlossaryCnt();
@@ -826,7 +784,7 @@ void SwGlossaryDlg::Init()
}
}
}
- // Aktuelle Gruppe setzen und Textbausteine anzeigen
+ // set current group and display text blocks
if(!pSelEntry)
{
//find a non-readonly group
@@ -864,22 +822,18 @@ void SwGlossaryDlg::Init()
aCategoryBox.SetUpdateMode( sal_True );
aCategoryBox.Update();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- aFileRelCB.Check( pCfg->IsSaveRelFile() );
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ aFileRelCB.Check( rCfg.IsSaveRelFile() );
aFileRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aNetRelCB.Check( pCfg->IsSaveRelNet() );
+ aNetRelCB.Check( rCfg.IsSaveRelNet() );
aNetRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aInsertTipCB.Check( pCfg->IsAutoTextTip() );
+ aInsertTipCB.Check( rCfg.IsAutoTextTip() );
aInsertTipCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
{
-//EndDialog darf nicht im MenuHdl aufgerufen werden
+// EndDialog must not be called in MenuHdl
if(aEditBtn.GetCurItemId() == FN_GL_EDIT )
{
SwTextBlocks *pGroup = ::GetGlossaries()->GetGroupDoc ( GetCurrGrpName () );
@@ -893,9 +847,8 @@ IMPL_LINK_INLINE_START( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
IMPL_LINK_INLINE_END( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces
+ Description: KeyInput for ShortName - Edits without Spaces
------------------------------------------------------------------------*/
-
IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox )
{
String aName(aNewName.GetText());
@@ -910,9 +863,6 @@ IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox )
aOk.Enable(bEnable);
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG )
{
@@ -930,25 +880,21 @@ IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox )
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
sal_Bool bCheck = pBox->IsChecked();
if( pBox == &aInsertTipCB )
- pCfg->SetAutoTextTip(bCheck);
+ rCfg.SetAutoTextTip(bCheck);
else if(pBox == &aFileRelCB)
- pCfg->SetSaveRelFile(bCheck);
+ rCfg.SetSaveRelFile(bCheck);
else
- pCfg->SetSaveRelNet(bCheck);
+ rCfg.SetSaveRelNet(bCheck);
return 0;
}
-/* -----------------26.11.98 15:18-------------------
- * TreeListBox fuer Gruppen und Bausteine
+/* --------------------------------------------------
+ * TreeListBox for groups and blocks
* --------------------------------------------------*/
SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) :
SvTreeListBox(pParent, rResId),
@@ -958,9 +904,7 @@ SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) :
FreeResource();
SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY );
}
-/* -----------------30.11.98 10:49-------------------
- *
- * --------------------------------------------------*/
+
void SwGlTreeListBox::Clear()
{
SvLBoxEntry* pEntry = First();
@@ -975,14 +919,11 @@ void SwGlTreeListBox::Clear()
SvTreeListBox::Clear();
}
-/*-----------------10.06.97 14.52-------------------
-
---------------------------------------------------*/
void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
{
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
SvLBoxEntry* pEntry = GetEntry( aPos );
- // Hilfe gibt es nur fuer die Gruppennamen
+ // there's only help for groups' names
if(pEntry)
{
SvLBoxTab* pTab;
@@ -1029,9 +970,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
}
}
}
-/* -----------------26.11.98 14:42-------------------
- *
- * --------------------------------------------------*/
+
DragDropMode SwGlTreeListBox::NotifyStartDrag(
TransferDataContainer& /*rContainer*/,
SvLBoxEntry* pEntry )
@@ -1060,21 +999,17 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
}
return eRet;
}
-/* -----------------27.11.98 09:35-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry)
{
- // TODO: Readonly - Ueberpruefung fehlt noch!
+ // TODO: Readonly - check still missing!
SvLBoxEntry* pSrcParent = GetParent(pEntry) ? GetParent(pEntry) : pEntry;
SvLBoxEntry* pDestParent =
GetParent(pDragEntry ) ? GetParent(pDragEntry ) : pDragEntry ;
return pDestParent != pSrcParent;
}
-/* -----------------26.11.98 14:42-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget,
SvLBoxEntry* pEntry,
SvLBoxEntry*& /*rpNewParent*/,
@@ -1082,12 +1017,12 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget,
)
{
pDragEntry = 0;
- if(!pTarget) //An den Anfang verschieben
+ if(!pTarget) // move to the beginning
{
pTarget = GetEntry(0);
}
- // 1. wird in verschiedene Gruppen verschoben?
- // 2. darf in beiden Gruppen geschrieben werden?
+ // 1. move to different groups?
+ // 2. allowed to write in both groups?
SvLBoxEntry* pSrcParent = GetParent(pEntry);
SvLBoxEntry* pDestParent =
GetParent(pTarget) ? GetParent(pTarget) : pTarget;
@@ -1118,11 +1053,9 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget,
GetModel()->Remove(pEntry);
}
}
- return sal_False; //sonst wird der Eintrag automatisch vorgenommen
+ return sal_False; // otherwise the entry is being set automatically
}
-/* -----------------26.11.98 14:42-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
SvLBoxEntry* pEntry,
SvLBoxEntry*& /*rpNewParent*/,
@@ -1130,9 +1063,9 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
)
{
pDragEntry = 0;
- // 1. wird in verschiedene Gruppen verschoben?
- // 2. darf in beiden Gruppen geschrieben werden?
- if(!pTarget) //An den Anfang verschieben
+ // 1. move in different groups?
+ // 2. allowed to write to both groups?
+ if(!pTarget) // move to the beginning
{
pTarget = GetEntry(0);
}
@@ -1167,13 +1100,9 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
pChild->SetUserData(new String(sShortName));
}
}
- return sal_False; //sonst wird der Eintrag automatisch vorgenommen
+ return sal_False; // otherwise the entry is being set automatically
}
-
-/*-----------------10.06.97 15.18-------------------
-
---------------------------------------------------*/
String SwGlossaryDlg::GetCurrGrpName() const
{
SvLBoxEntry* pEntry = aCategoryBox.FirstSelected();
@@ -1190,16 +1119,13 @@ String SwGlossaryDlg::GetCurrGrpName() const
return sRet;
}
-/*-----------------11.06.97 08.17-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
SvtPathOptions aPathOpt;
String sGlosPath( aPathOpt.GetAutoTextPath() );
pDlg->SetPath(sGlosPath);
@@ -1217,9 +1143,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn )
}
return 0;
}
-/* -----------------28.07.99 13:48-------------------
- --------------------------------------------------*/
IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox )
{
sal_Bool bCreated = sal_False;
@@ -1243,9 +1167,7 @@ IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox )
return 0;
};
-/* -----------------18.11.99 17:09-------------------
- --------------------------------------------------*/
IMPL_LINK( SwGlossaryDlg, PreviewLoadedHdl, void *, EMPTYARG )
{
sal_Bool bShow = aShowExampleCB.IsChecked();
@@ -1255,9 +1177,6 @@ IMPL_LINK( SwGlossaryDlg, PreviewLoadedHdl, void *, EMPTYARG )
return 0;
}
-/* -----------------28.07.99 16:28-------------------
-
- --------------------------------------------------*/
void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName)
{
if(aExampleWIN.IsVisible())
@@ -1267,9 +1186,7 @@ void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName)
pExampleFrame->ClearDocument( sal_True );
}
}
-/* -----------------------------21.12.00 11:33--------------------------------
- ---------------------------------------------------------------------------*/
void SwGlossaryDlg::ResumeShowAutoText()
{
String sGroup, sShortName;
@@ -1307,4 +1224,4 @@ void SwGlossaryDlg::ResumeShowAutoText()
ResetResumeData();
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/glossary.hrc b/sw/source/ui/misc/glossary.hrc
index 4ee5aaaa7ede..dc55c5e9d61a 100644
--- a/sw/source/ui/misc/glossary.hrc
+++ b/sw/source/ui/misc/glossary.hrc
@@ -26,7 +26,7 @@
************************************************************************/
-// Box Textbausteine
+// Box text blocks
#define FT_SHORTNAME 1
#define ED_SHORTNAME 2
#define FT_NAME 3
@@ -63,7 +63,7 @@
#define FN_GL_REPLACE_TEXT 78
#define WIN_EXAMPLE_DUMMY 79
-// Box Bibliothek Textbausteine
+// Box library text blocks
#define FL_EDIT 1
#define FL_BIB 2
#define ED_BIB 3
@@ -73,10 +73,10 @@
#define BT_OK 100
-// beide
+// both
#define LB_BIB 80
-// Dialog Namensaenderung
+// Dialog name changing
#define FT_ON 1
#define FT_OS 2
#define FT_NN 3
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index 1302f02fbf9a..4e2db6dcfe49 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -138,9 +138,7 @@ ModalDialog DLG_GLOSSARY
{
Pos = MAP_APPFONT ( 319 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Einfügen : ~Einf³gen */
Text [ en-US ] = "~Insert" ;
- /* ### ACHTUNG: Neuer Text in Resource? Fügt den aktuellen Textblock ein und schließt das Dialogfeld : F³gt den aktuellen Textblock ein und schlie˜t das Dialogfeld */
TabStop = TRUE ;
DefButton = TRUE ;
};
@@ -148,7 +146,6 @@ ModalDialog DLG_GLOSSARY
{
Pos = MAP_APPFONT ( 319 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Schließen : ~Schlie˜en */
Text [ en-US ] = "~Close" ;
TabStop = TRUE ;
};
@@ -229,7 +226,6 @@ ModalDialog DLG_GLOSSARY
{
Identifier = FN_GL_DELETE ;
HelpID = HID_MD_GLOS_DELETE ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */
Text [ en-US ] = "~Delete" ;
};
MenuItem
@@ -267,14 +263,12 @@ ModalDialog DLG_GLOSSARY
};
InfoBox MSG_DOUBLE_SHORTNAME
{
- /* ### ACHTUNG: Neuer Text in Resource? Kürzel wird bereits verwendet. Bitte einen anderen Namen vergeben! : K³rzel wird bereits verwendet. Bitte einen anderen Namen vergeben! */
Message [ en-US ] = "Shortcut name already exists. Please choose another name." ;
};
QueryBox MSG_QUERY_DELETE
{
BUTTONS = WB_YES_NO ;
DEFBUTTON = WB_DEF_NO ;
- /* ### ACHTUNG: Neuer Text in Resource? Soll der AutoText gelöscht werden? : Soll der AutoText gel÷scht werden? */
Message [ en-US ] = "Delete AutoText?" ;
};
String STR_QUERY_DELETE_GROUP1
@@ -283,7 +277,6 @@ String STR_QUERY_DELETE_GROUP1
};
String STR_QUERY_DELETE_GROUP2
{
- /* ### ACHTUNG: Neuer Text in Resource? gelöscht werden? : gel÷scht werden? */
Text [ en-US ] = "?" ;
};
String STR_GLOSSARY
@@ -393,92 +386,7 @@ InfoBox MSG_NO_GLOSSARIES
Message [ en-US ] = "There is no AutoText in this file.";
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_MY_AUTOTEXT
+{
+ Text[ en-US ] = "My AutoText";
+};
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index ce41c2906e45..7323737033b7 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <com/sun/star/frame/XTitle.hpp>
-#include <tools/list.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <sfx2/printer.hxx>
@@ -52,14 +52,14 @@
#include <IDocumentUndoRedo.hxx>
#include <glosdoc.hxx>
#include <shellio.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
+#include <initui.hxx> // for ::GetGlossaries()
#include <cmdid.h>
#include <swerror.h>
#include <misc.hrc>
-
#define SwWebGlosDocShell
#define SwGlosDocShell
+
#include <sfx2/msg.hxx>
#include <swslots.hxx>
@@ -73,11 +73,9 @@ SFX_IMPL_INTERFACE( SwWebGlosDocShell, SwWebDocShell, SW_RES(0) )
{
}
-
TYPEINIT1( SwGlosDocShell, SwDocShell );
TYPEINIT1( SwWebGlosDocShell, SwWebDocShell );
-
void lcl_Execute( SwDocShell& rSh, SfxRequest& rReq )
{
if ( rReq.GetSlot() == SID_SAVEDOC )
@@ -97,7 +95,6 @@ void lcl_Execute( SwDocShell& rSh, SfxRequest& rReq )
}
}
-
void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet )
{
if( SFX_ITEM_AVAILABLE >= rSet.GetItemState( SID_SAVEDOC, sal_False ))
@@ -109,11 +106,10 @@ void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet )
}
}
-
sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
const String& rShortNm, const String& rLongNm )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwTextBlocks * pBlock = ::GetGlossaries()->GetGroupDoc( rGroupName );
SvxMacro aStart(aEmptyStr, aEmptyStr);
@@ -124,7 +120,7 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
pGlosHdl->GetMacros( rShortNm, aStart, aEnd, pBlock );
sal_uInt16 nRet = rSh.SaveGlossaryDoc( *pBlock, rLongNm, rShortNm,
- pCfg->IsSaveRelFile(),
+ rCfg.IsSaveRelFile(),
pBlock->IsOnlyTextBlock( rShortNm ) );
if(aStart.GetMacName().Len() || aEnd.GetMacName().Len() )
@@ -141,11 +137,6 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
return nRet != USHRT_MAX;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwGlosDocShell::SwGlosDocShell(sal_Bool bNewShow)
: SwDocShell( (bNewShow)
? SFX_CREATE_MODE_STANDARD : SFX_CREATE_MODE_INTERNAL )
@@ -154,40 +145,20 @@ SwGlosDocShell::SwGlosDocShell(sal_Bool bNewShow)
SetHelpId(SW_GLOSDOCSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwGlosDocShell::~SwGlosDocShell( )
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwGlosDocShell::Execute( SfxRequest& rReq )
{
::lcl_Execute( *this, rReq );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwGlosDocShell::GetState( SfxItemSet& rSet )
{
::lcl_GetState( *this, rSet );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_Bool SwGlosDocShell::Save()
{
// In case of an API object which holds this document, it is possible that the WrtShell is already
@@ -204,53 +175,26 @@ sal_Bool SwGlosDocShell::Save()
}
}
-
-/* */
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwWebGlosDocShell::SwWebGlosDocShell()
: SwWebDocShell( SFX_CREATE_MODE_STANDARD )
{
SetHelpId(SW_WEBGLOSDOCSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwWebGlosDocShell::~SwWebGlosDocShell( )
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwWebGlosDocShell::Execute( SfxRequest& rReq )
{
::lcl_Execute( *this, rReq );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwWebGlosDocShell::GetState( SfxItemSet& rSet )
{
::lcl_GetState( *this, rSet );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_Bool SwWebGlosDocShell::Save()
{
// same comment as in SwGlosDocShell::Save - see there
@@ -263,10 +207,6 @@ sal_Bool SwWebGlosDocShell::Save()
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SV_IMPL_REF ( SwDocShell )
SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rShortName, sal_Bool bShow )
@@ -276,8 +216,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
SwTextBlocks* pGroup = GetGroupDoc( rGroup );
if( pGroup && pGroup->GetCount() )
{
- // erfrage welche View registriert ist. Im WebWriter gibts es keine
- // normale View
+ // query which view is registered. In WebWriter there is no normal view
sal_uInt16 nViewId = 0 != &SwView::Factory() ? 2 : 6;
String sLongName = pGroup->GetLongName(pGroup->GetIndex( rShortName ));
@@ -300,7 +239,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
pDocSh->SetGroupName( rGroup );
}
- // Dokumenttitel setzen
+ // set document title
SfxViewFrame* pFrame = bShow ? SfxViewFrame::LoadDocument( *xDocSh, nViewId ) : SfxViewFrame::LoadHiddenDocument( *xDocSh, nViewId );
String aDocTitle(SW_RES( STR_GLOSSARY ));
aDocTitle += ' ';
@@ -313,8 +252,8 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
xDocSh->GetWrtShell()->InsertGlossary( *pGroup, rShortName );
if( !xDocSh->GetDoc()->getPrinter( false ) )
{
- // wir erzeugen einen default SfxPrinter.
- // Das ItemSet wird vom Sfx geloescht!
+ // we create a default SfxPrinter.
+ // ItemSet is deleted by Sfx!
SfxItemSet *pSet = new SfxItemSet( xDocSh->GetDoc()->GetAttrPool(),
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
@@ -322,7 +261,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
0 );
SfxPrinter* pPrinter = new SfxPrinter( pSet );
- // und haengen ihn ans Dokument.
+ // and append it to the document.
xDocSh->GetDoc()->setPrinter( pPrinter, true, true );
}
@@ -346,4 +285,4 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
return xDocSh;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index 9dc2b28e721c..ad90331808f0 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,10 @@
#define _IMPFNOTE_HXX
#include <sfx2/tabdlg.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include <numberingtypelistbox.hxx>
class SwWrtShell;
@@ -118,3 +111,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index 7e9d4894faaa..273cc2568d9a 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,10 +56,10 @@
static sal_Bool bFootnote = sal_True;
/*------------------------------------------------------------------------
- Beschreibung: Einfuegen der Fussnote durch OK
+ Description: inserting a footnote with OK
------------------------------------------------------------------------*/
-void __EXPORT SwInsFootNoteDlg::Apply()
+void SwInsFootNoteDlg::Apply()
{
String aStr;
@@ -92,37 +93,12 @@ void __EXPORT SwInsFootNoteDlg::Apply()
}
else
{
-/*
- rSh.StartUndo( UNDO_UI_INSERT_FOOTNOTE );
- rSh.InsertFootnote( aStr, aEndNoteBtn.IsChecked(), !bExtCharAvailable );
- if ( bExtCharAvailable )
- {
- rSh.Left( CRSR_SKIP_CHARS, sal_True, 1, sal_False );
- SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT );
- rSh.GetAttr( aSet );
- SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT );
- SvxFontItem aFont( rFont.GetFamily(), aFontName,
- rFont.GetStyleName(), rFont.GetPitch(),
- eCharSet );
- aSet.Put( aFont );
- rSh.SetAttr( aSet, SETATTR_DONTEXPAND );
- // zur Bearbeitung des Fussnotentextes
- rSh.ResetSelect(0, sal_False);
- rSh.GotoFtnTxt();
- }
- rSh.EndUndo( UNDO_UI_INSERT_FOOTNOTE );
-*/
}
bFootnote = aFtnBtn.IsChecked();
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG )
{
aNumberCharEdit.GrabFocus();
@@ -131,10 +107,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG )
{
aNumberCharBtn.Check( sal_True );
@@ -144,10 +116,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG )
{
aOkBtn.Enable( sal_True );
@@ -155,10 +123,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG )
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG )
{
aNumberCharBtn.Check( sal_True );
@@ -202,15 +166,11 @@ IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn )
{
Apply();
- // Hier zur naechsten Fuss/Endnote wandern
+ // go to the next foot/endnote here
rSh.ResetSelect(0, sal_False);
if (pBtn == &aNextBT)
rSh.GotoNextFtnAnchor();
@@ -222,10 +182,6 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool bEd) :
SvxStandardDialog(pParent,SW_RES(DLG_INS_FOOTNOTE)),
@@ -275,11 +231,6 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool
}
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwInsFootNoteDlg::~SwInsFootNoteDlg()
{
rSh.SetCareWin(0);
@@ -288,10 +239,6 @@ SwInsFootNoteDlg::~SwInsFootNoteDlg()
rSh.ResetSelect(0, sal_False);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwInsFootNoteDlg::Init()
{
SwFmtFtn aFtnNote;
@@ -355,3 +302,4 @@ void SwInsFootNoteDlg::Init()
rSh.EndAction();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/insfnote.src b/sw/source/ui/misc/insfnote.src
index 964f174f189b..a37f03817374 100644
--- a/sw/source/ui/misc/insfnote.src
+++ b/sw/source/ui/misc/insfnote.src
@@ -35,7 +35,6 @@ ModalDialog DLG_INS_FOOTNOTE
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 160 , 100 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Fußnote einfügen : Fu˜note einf³gen */
Text [ en-US ] = "Insert Footnote/Endnote" ;
Moveable = TRUE ;
Edit ED_NUMBER_CHAR
diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx
index 2409b773850a..c3278dd27626 100644
--- a/sw/source/ui/misc/insrule.cxx
+++ b/sw/source/ui/misc/insrule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include "hintids.hxx"
#include <svx/gallery.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <editeng/brshitem.hxx>
#include <svl/urihelper.hxx>
#include <vcl/graph.hxx>
@@ -51,11 +50,6 @@
#include "misc.hrc"
#include "helpid.h"
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)),
aSelectionFL(this, SW_RES(FL_SEL )),
@@ -74,7 +68,7 @@ SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl));
pExampleVS->GrabFocus();
- // Grafiknamen ermitteln
+ // determine graphic name
GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS);
GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames );
pExampleVS->SetHelpId(HID_VS_RULER);
@@ -82,17 +76,14 @@ SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
pExampleVS->InsertItem( 1, 1);
pExampleVS->SetItemText( 1, sSimple);
- for(sal_uInt16 i = 1; i <= aGrfNames.Count(); i++)
+ for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++)
{
pExampleVS->InsertItem( i + 1, i);
- pExampleVS->SetItemText( i + 1, *((String*)aGrfNames.GetObject(i-1)));
+ pExampleVS->SetItemText( i + 1, aGrfNames[i-1]);
}
pExampleVS->Show();
}
-/*-----------------14.02.97 13.18-------------------
-
---------------------------------------------------*/
SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg()
{
@@ -100,25 +91,17 @@ SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg()
delete pExampleVS;
}
-/*-----------------14.02.97 13.17-------------------
-
---------------------------------------------------*/
-
String SwInsertGrfRulerDlg::GetGraphicName()
{
String sRet;
sal_uInt16 nSel = nSelPos - 2; //align selection position with ValueSet index
- if(nSel < aGrfNames.Count())
+ if(nSel < aGrfNames.size())
sRet = URIHelper::SmartRel2Abs(
- INetURLObject(), *(String*) aGrfNames.GetObject(nSel),
+ INetURLObject(), aGrfNames[nSel],
URIHelper::GetMaybeFileHdl());
return sRet;
}
-/*-----------------14.02.97 13.20-------------------
-
---------------------------------------------------*/
-
IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS)
{
nSelPos = pVS->GetSelectItemId();
@@ -126,31 +109,24 @@ IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS)
return 0;
}
-/*-----------------14.02.97 14.17-------------------
-
---------------------------------------------------*/
SwRulerValueSet::SwRulerValueSet( Window* pParent, const ResId& rResId ) :
SvxBmpNumValueSet(pParent, rResId)
{
SetStyle( GetStyle() & ~WB_ITEMBORDER );
}
-/*-----------------14.02.97 14.17-------------------
---------------------------------------------------*/
SwRulerValueSet::~SwRulerValueSet()
{
}
-/*-----------------14.02.97 13.42-------------------
---------------------------------------------------*/
-void __EXPORT SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
+void SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
{
Rectangle aRect = rUDEvt.GetRect();
OutputDevice* pDev = rUDEvt.GetDevice();
sal_uInt16 nItemId = rUDEvt.GetItemId();
Point aBLPos = aRect.TopLeft();
- // Itemzaehlung beginnt bei 1, und die 1. ist die einfache Linie
+ // item count starts with 1 and the 1st is the simple line
if(nItemId > 1)
{
Graphic aGraphic;
@@ -194,7 +170,7 @@ void __EXPORT SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
}
else
{
- // Text fuer einfache Linie painten
+ // paint text for simple line
Font aOldFont = pDev->GetFont();
Font aFont = pDev->GetFont();
Size aSize = aFont.GetSize();
@@ -214,13 +190,10 @@ void __EXPORT SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
}
}
-/*-----------------15.02.97 10.03-------------------
-
---------------------------------------------------*/
-
IMPL_LINK(SwInsertGrfRulerDlg, DoubleClickHdl, ValueSet*, EMPTYARG)
{
EndDialog(RET_OK);
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 4b03871e9f7d..3c9e2409642a 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,11 +42,6 @@
#include <docsh.hxx>
#include <charfmt.hxx>
-//#ifndef _FLDMGR_HXX //autogen
-//#include <fldmgr.hxx>
-//#endif
-
-
#include <docstyle.hxx>
#include "fldbas.hxx"
@@ -57,32 +53,20 @@
#include <IDocumentStylePoolAccess.hxx>
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) :
SfxSingleTabDialog(&pVw->GetViewFrame()->GetWindow(), 0, 0),
pSh(pVw->GetWrtShellPtr())
{
- // TabPage erzeugen
+ // create TabPage
SetTabPage(SwLineNumberingPage::Create(this, *(SfxItemSet*)0));
GetOKButton()->SetClickHdl(LINK(this, SwLineNumberingDlg, OKHdl));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-__EXPORT SwLineNumberingDlg::~SwLineNumberingDlg()
+SwLineNumberingDlg::~SwLineNumberingDlg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwLineNumberingDlg, OKHdl, Button *, EMPTYARG )
{
if (GetOKButton()->IsEnabled())
@@ -97,10 +81,6 @@ IMPL_LINK( SwLineNumberingDlg, OKHdl, Button *, EMPTYARG )
return 0;
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
const SfxItemSet& rSet )
: SfxTabPage(pParent, SW_RES(TP_LINENUMBERING), rSet),
@@ -143,32 +123,20 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
FreeResource();
SwLineNumberingDlg *pDlg = (SwLineNumberingDlg *)GetParent();
pSh = pDlg->GetWrtShell();
- // Zeichenvorlagen
+ // char styles
::FillCharStyleListBox(aCharStyleLB, pSh->GetView().GetDocShell());
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-__EXPORT SwLineNumberingPage::~SwLineNumberingPage()
+SwLineNumberingPage::~SwLineNumberingPage()
{
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwLineNumberingPage::Create( Window* pParent, const SfxItemSet& rSet )
+SfxTabPage* SwLineNumberingPage::Create( Window* pParent, const SfxItemSet& rSet )
{
return new SwLineNumberingPage( pParent, rSet );
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& )
+void SwLineNumberingPage::Reset( const SfxItemSet& )
{
const SwLineNumberInfo &rInf = pSh->GetLineNumberInfo();
IDocumentStylePoolAccess* pIDSPA = pSh->getIDocumentStylePoolAccess();
@@ -187,44 +155,31 @@ void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& )
}
}
- // Format
-// SwFldMgr aMgr( pSh );
+ // format
sal_uInt16 nSelFmt = rInf.GetNumType().GetNumberingType();
-// sal_uInt16 nCnt = aMgr.GetFormatCount( TYP_SEQFLD, sal_False );
-
-// for( sal_uInt16 i = 0; i < nCnt; i++)
-// {
-// aFormatLB.InsertEntry(aMgr.GetFormatStr( TYP_SEQFLD, i));
-// sal_uInt16 nFmtId = aMgr.GetFormatId( TYP_SEQFLD, i );
-// aFormatLB.SetEntryData( i, (void*)nFmtId );
-// if( nFmtId == nSelFmt )
-// aFormatLB.SelectEntryPos( i );
-// }
- aFormatLB.SelectNumberingType(nSelFmt);
-// if ( !aFormatLB.GetSelectEntryCount() )
-// aFormatLB.SelectEntryPos(aFormatLB.GetEntryCount() - 1);
+ aFormatLB.SelectNumberingType(nSelFmt);
- // Position
+ // position
aPosLB.SelectEntryPos((sal_uInt16)rInf.GetPos());
- // Offset
+ // offset
sal_uInt16 nOffset = rInf.GetPosFromLeft();
if (nOffset == USHRT_MAX)
nOffset = 0;
aOffsetMF.SetValue(aOffsetMF.Normalize(nOffset), FUNIT_TWIP);
- // Numerierungsoffset
+ // numbering offset
aNumIntervalNF.SetValue(rInf.GetCountBy());
- // Teiler
+ // divider
aDivisorED.SetText(rInf.GetDivider());
- // Teileroffset
+ // divider offset
aDivIntervalNF.SetValue(rInf.GetDividerCountBy());
- // Zaehlen
+ // count
aCountEmptyLinesCB.Check(rInf.IsCountBlankLines());
aCountFrameLinesCB.Check(rInf.IsCountInFlys());
aRestartEachPageCB.Check(rInf.IsRestartEachPage());
@@ -238,9 +193,8 @@ void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& )
}
/*--------------------------------------------------------------------
- Beschreibung: Modify
+ Description: modify
--------------------------------------------------------------------*/
-
IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG )
{
sal_Bool bHasValue = aDivisorED.GetText().Len() != 0;
@@ -253,9 +207,8 @@ IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: On/Off
+ Description: On/Off
--------------------------------------------------------------------*/
-
IMPL_LINK( SwLineNumberingPage, LineOnOffHdl, CheckBox *, EMPTYARG )
{
sal_Bool bEnable = aNumberingOnCB.IsChecked();
@@ -286,15 +239,11 @@ IMPL_LINK( SwLineNumberingPage, LineOnOffHdl, CheckBox *, EMPTYARG )
return 0;
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-sal_Bool __EXPORT SwLineNumberingPage::FillItemSet( SfxItemSet& )
+sal_Bool SwLineNumberingPage::FillItemSet( SfxItemSet& )
{
SwLineNumberInfo aInf(pSh->GetLineNumberInfo());
- // Zeichenvorlagen
+ // char styles
String sCharFmtName(aCharStyleLB.GetSelectEntry());
SwCharFmt *pCharFmt = pSh->FindCharFmtByName(sCharFmtName);
@@ -311,27 +260,27 @@ sal_Bool __EXPORT SwLineNumberingPage::FillItemSet( SfxItemSet& )
if (pCharFmt)
aInf.SetCharFmt(pCharFmt);
- // Format
+ // format
SvxNumberType aType;
aType.SetNumberingType(aFormatLB.GetSelectedNumberingType());
aInf.SetNumType(aType);
- // Position
+ // position
aInf.SetPos((LineNumberPosition)aPosLB.GetSelectEntryPos());
- // Offset
+ // offset
aInf.SetPosFromLeft((sal_uInt16)aOffsetMF.Denormalize(aOffsetMF.GetValue(FUNIT_TWIP)));
- // Numerierungsoffset
+ // numbering offset
aInf.SetCountBy((sal_uInt16)aNumIntervalNF.GetValue());
- // Teiler
+ // divider
aInf.SetDivider(aDivisorED.GetText());
- // Teileroffset
+ // divider offset
aInf.SetDividerCountBy((sal_uInt16)aDivIntervalNF.GetValue());
- // Zaehlen
+ // count
aInf.SetCountBlankLines(aCountEmptyLinesCB.IsChecked());
aInf.SetCountInFlys(aCountFrameLinesCB.IsChecked());
aInf.SetRestartEachPage(aRestartEachPageCB.IsChecked());
@@ -343,4 +292,4 @@ sal_Bool __EXPORT SwLineNumberingPage::FillItemSet( SfxItemSet& )
return sal_False;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 4b6b48e5ccea..a8bbe943399b 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#define _NUM_CXX
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <tools/urlobj.hxx>
#include <sfx2/app.hxx>
#include <sfx2/imgmgr.hxx>
@@ -50,16 +49,10 @@
#include <swvset.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
#include <uitool.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
#include <uiitems.hxx>
#include <docstyle.hxx>
#include <charfmt.hxx>
@@ -71,21 +64,11 @@
#include <viewopt.hxx>
#include <frmmgr.hxx>
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _FRMUI_HRC
#include <frmui.hrc>
-#endif
-#ifndef _NUM_HRC
#include <num.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <SwStyleNameMapper.hxx>
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
@@ -95,9 +78,6 @@
static sal_Bool bLastRelative = sal_False;
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
const SfxItemSet& rSet) :
SfxTabPage( pParent, SW_RES( TP_NUM_POSITION ), rSet ),
@@ -114,7 +94,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aDistNumMF( this, SW_RES(MF_NUMDIST )),
aAlignFT( this, SW_RES(FT_ALIGN )),
aAlignLB( this, SW_RES(LB_ALIGN )),
- // --> OD 2008-02-01 #newlistlevelattrs#
aLabelFollowedByFT( this, SW_RES(FT_LABEL_FOLLOWED_BY) ),
aLabelFollowedByLB( this, SW_RES(LB_LABEL_FOLLOWED_BY) ),
aListtabFT( this, SW_RES(FT_LISTTAB) ),
@@ -125,7 +104,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aAlignedAtMF( this, SW_RES(MF_ALIGNED_AT) ),
aIndentAtFT( this, SW_RES(FT_INDENT_AT) ),
aIndentAtMF( this, SW_RES(MF_INDENT_AT) ),
- // <--
aStandardPB( this, SW_RES(PB_STANDARD )),
aPreviewWIN( this, SW_RES(WIN_PREVIEW )),
@@ -136,9 +114,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
pOutlineDlg(0),
bPreset( sal_False ),
bInInintControl(sal_False),
- // --> OD 2008-02-01 #newlistlevelattrs#
bLabelAlignmentPosAndSpaceModeActive( false )
- // <--
{
FreeResource();
SetExchangeSupport();
@@ -149,7 +125,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aRelativeCB.Check();
aAlignLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
- // --> OD 2008-02-01 #newlistlevelattrs#
aAlign2LB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
for ( sal_uInt16 i = 0; i < aAlignLB.GetEntryCount(); ++i )
{
@@ -157,7 +132,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
}
aAlign2LB.SetDropDownLineCount( aAlign2LB.GetEntryCount() );
aAlign2FT.SetText( aAlignFT.GetText() );
- // <--
Link aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
aDistBorderMF.SetUpHdl(aLk);
@@ -170,7 +144,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aDistNumMF.SetLoseFocusHdl(aLk);
aIndentMF.SetLoseFocusHdl(aLk);
- // --> OD 2008-02-01 #newlistlevelattrs#
aLabelFollowedByLB.SetDropDownLineCount( aLabelFollowedByLB.GetEntryCount() );
aLabelFollowedByLB.SetSelectHdl( LINK(this, SwNumPositionTabPage, LabelFollowedByHdl_Impl) );
@@ -188,13 +161,12 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aIndentAtMF.SetUpHdl(aLk);
aIndentAtMF.SetDownHdl(aLk);
aIndentAtMF.SetLoseFocusHdl(aLk);
- // <--
aLevelLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, LevelHdl));
aRelativeCB.SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl));
aStandardPB.SetClickHdl(LINK(this, SwNumPositionTabPage, StandardHdl));
- // Ebenen einfuegen
+ // insert levels
for(sal_uInt16 i = 1; i <= MAXLEVEL; i++)
aLevelLB.InsertEntry(String::CreateFromInt32(i));
String sEntry(String::CreateFromAscii("1 - "));
@@ -205,20 +177,15 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aRelativeCB.Check(bLastRelative);
aPreviewWIN.SetPositionMode();
}
-/*-----------------03.12.97 10:02-------------------
---------------------------------------------------*/
SwNumPositionTabPage::~SwNumPositionTabPage()
{
delete pActNum;
}
-/*-----------------03.12.97 10:06-------------------
---------------------------------------------------*/
void SwNumPositionTabPage::InitControls()
{
bInInintControl = sal_True;
- // --> OD 2008-02-01 #newlistlevelattrs#
const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive &&
aRelativeCB.IsEnabled() && aRelativeCB.IsChecked();
const bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 &&
@@ -228,7 +195,6 @@ void SwNumPositionTabPage::InitControls()
( bSingleSelection || bRelative || pOutlineDlg != 0 ) );
aDistBorderFT.Enable( !bLabelAlignmentPosAndSpaceModeActive &&
( bSingleSelection || bRelative || pOutlineDlg != 0 ) );
- // <--
bool bSetDistEmpty = false;
bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive;
@@ -236,18 +202,14 @@ void SwNumPositionTabPage::InitControls()
bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive;
bool bSameAdjust = true;
- // --> OD 2008-02-01 #newlistlevelattrs#
bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive;
bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive;
bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive;
bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive;
- // <--
const SwNumFmt* aNumFmtArr[MAXLEVEL];
- const SwFmtVertOrient* pFirstOrient = 0;
sal_uInt16 nMask = 1;
sal_uInt16 nLvl = USHRT_MAX;
- long nFirstBorderText = 0;
long nFirstBorderTextRelative = -1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
@@ -257,21 +219,10 @@ void SwNumPositionTabPage::InitControls()
if(USHRT_MAX == nLvl)
{
nLvl = i;
- // --> OD 2008-02-01 #newlistlevelattrs#
- if ( !bLabelAlignmentPosAndSpaceModeActive )
- {
- pFirstOrient = aNumFmtArr[nLvl]->GetGraphicOrientation();
- nFirstBorderText = nLvl > 0 ?
- aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset() -
- aNumFmtArr[nLvl - 1]->GetAbsLSpace() + aNumFmtArr[nLvl - 1]->GetFirstLineOffset():
- aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset();
- }
- // <--
}
if( i > nLvl)
{
- // --> OD 2008-02-01 #newlistlevelattrs#
bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust();
if ( !bLabelAlignmentPosAndSpaceModeActive )
{
@@ -309,8 +260,6 @@ void SwNumPositionTabPage::InitControls()
bSameIndentAt &=
aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt();
}
- // <--
-
}
}
nMask <<= 1;
@@ -345,25 +294,20 @@ void SwNumPositionTabPage::InitControls()
if(bSameAdjust)
{
- sal_uInt16 nPos = 1; // zentriert
+ sal_uInt16 nPos = 1; // centered
if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT)
nPos = 0;
else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT)
nPos = 2;
aAlignLB.SelectEntryPos(nPos);
- // --> OD 2008-02-01 #newlistlevelattrs#
aAlign2LB.SelectEntryPos( nPos );
- // <--
}
else
{
aAlignLB.SetNoSelection();
- // --> OD 2008-02-01 #newlistlevelattrs#
aAlign2LB.SetNoSelection();
- // <--
}
- // --> OD 2008-02-01 #newlistlevelattrs#
if ( bSameLabelFollowedBy )
{
sal_uInt16 nPos = 0; // LISTTAB
@@ -423,7 +367,6 @@ void SwNumPositionTabPage::InitControls()
{
aIndentAtMF.SetText(aEmptyStr);
}
- // <--
if(sal_True == bSetDistEmpty)
aDistBorderMF.SetText(aEmptyStr);
@@ -431,9 +374,6 @@ void SwNumPositionTabPage::InitControls()
bInInintControl = sal_False;
}
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
{
const SfxPoolItem* pItem;
@@ -444,7 +384,6 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
{
bPreset = ((const SfxBoolItem*)pItem)->GetValue();
}
- //
bModified = (!pActNum->GetNumFmt( 0 ) || bPreset);
if(*pActNum != *pSaveNum ||
nActNumLvl != nTmpNumLvl )
@@ -464,10 +403,8 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
}
aLevelLB.SetUpdateMode(sal_True);
- // --> OD 2008-02-01 #newlistlevelattrs#
InitPosAndSpaceMode();
ShowControlsDependingOnPosAndSpaceMode();
- // <--
InitControls();
}
@@ -475,9 +412,6 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
aPreviewWIN.Invalidate();
}
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
int SwNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
{
SwOutlineTabDialog::SetActNumLevel(nActNumLvl);
@@ -487,9 +421,6 @@ int SwNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
}
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
sal_Bool SwNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
{
if(pOutlineDlg)
@@ -503,9 +434,6 @@ sal_Bool SwNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
return bModified;
}
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
void SwNumPositionTabPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pItem;
@@ -539,21 +467,17 @@ void SwNumPositionTabPage::Reset( const SfxItemSet& rSet )
else if(*pSaveNum != *pActNum)
*pActNum = *pSaveNum;
aPreviewWIN.SetNumRule(pActNum);
- // --> OD 2008-02-01 #newlistlevelattrs#
InitPosAndSpaceMode();
ShowControlsDependingOnPosAndSpaceMode();
- // <--
InitControls();
bModified = sal_False;
}
-// --> OD 2008-01-11 #newlistlevelattrs#
void SwNumPositionTabPage::InitPosAndSpaceMode()
{
if ( pActNum == 0 )
{
- DBG_ASSERT( false,
- "<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
+ OSL_FAIL( "<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
return;
}
@@ -601,45 +525,32 @@ void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
aIndentAtFT.Show( bLabelAlignmentPosAndSpaceModeActive );
aIndentAtMF.Show( bLabelAlignmentPosAndSpaceModeActive );
}
-// <--
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
SfxTabPage* SwNumPositionTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwNumPositionTabPage(pParent, rAttrSet);
}
-/*-----------------04.12.97 12:51-------------------
-
---------------------------------------------------*/
void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
{
pWrtSh = pSh;
- // --> OD 2008-02-01 #newlistlevelattrs#
const SwTwips nWidth = pWrtSh->GetAnyCurRect(RECT_FRM).Width();
aDistBorderMF.SetMax(aDistBorderMF.Normalize( nWidth ), FUNIT_TWIP );
aDistNumMF .SetMax(aDistNumMF .Normalize( nWidth ), FUNIT_TWIP );
aIndentMF .SetMax(aIndentMF .Normalize( nWidth ), FUNIT_TWIP );
- // --> OD 2008-02-18 #newlistlevelattrs#
aListtabMF.SetMax(aListtabMF.Normalize( nWidth ), FUNIT_TWIP );
aAlignedAtMF.SetMax(aAlignedAtMF.Normalize( nWidth ), FUNIT_TWIP );
aIndentAtMF.SetMax(aIndentAtMF.Normalize( nWidth ), FUNIT_TWIP );
- // <--
const SwTwips nLast2 = nWidth /2;
aDistBorderMF.SetLast( aDistBorderMF.Normalize( nLast2 ), FUNIT_TWIP );
aDistNumMF .SetLast( aDistNumMF .Normalize( nLast2 ), FUNIT_TWIP );
aIndentMF .SetLast( aIndentMF .Normalize( nLast2 ), FUNIT_TWIP );
- // --> OD 2008-02-18 #newlistlevelattrs#
aListtabMF.SetLast(aListtabMF.Normalize( nLast2 ), FUNIT_TWIP );
aAlignedAtMF.SetLast(aAlignedAtMF.Normalize( nLast2 ), FUNIT_TWIP );
aIndentAtMF.SetLast(aIndentAtMF.Normalize( nLast2 ), FUNIT_TWIP );
- // <--
- // <--
const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE);
aPreviewWIN.SetPageWidth(rPrtRect.Width());
@@ -649,25 +560,18 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
aDistBorderMF .SetDecimalDigits(1);
aDistNumMF .SetDecimalDigits(1);
aIndentMF .SetDecimalDigits(1);
- // --> OD 2008-02-18 #newlistlevelattrs#
aListtabMF.SetDecimalDigits(1);
aAlignedAtMF.SetDecimalDigits(1);
aIndentAtMF.SetDecimalDigits(1);
- // <--
}
aDistBorderMF .SetUnit( eMetric );
aDistNumMF .SetUnit( eMetric );
aIndentMF .SetUnit( eMetric );
- // --> OD 2008-02-18 #newlistlevelattrs#
aListtabMF.SetUnit( eMetric );
aAlignedAtMF.SetUnit( eMetric );
aIndentAtMF.SetUnit( eMetric );
- // <--
}
-/*-----------------03.12.97 11:06-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG )
{
sal_uInt16 nMask = 1;
@@ -677,11 +581,9 @@ IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG )
{
SwNumFmt aNumFmt(pActNum->Get(i));
- // --> OD 2008-02-01 #newlistlevelattrs#
const sal_uInt16 nPos = aAlignLB.IsVisible()
? aAlignLB.GetSelectEntryPos()
: aAlign2LB.GetSelectEntryPos();
- // <--
SvxAdjust eAdjust = SVX_ADJUST_CENTER;
if(nPos == 0)
eAdjust = SVX_ADJUST_LEFT;
@@ -695,9 +597,7 @@ IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG )
SetModified();
return 0;
}
-/*-----------------03.12.97 11:11-------------------
---------------------------------------------------*/
IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox )
{
sal_uInt16 nSaveNumLvl = nActNumLvl;
@@ -738,16 +638,12 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox )
}
aRelativeCB.Enable(1 != nActNumLvl);
SetModified();
- // --> OD 2008-02-01 #newlistlevelattrs#
InitPosAndSpaceMode();
ShowControlsDependingOnPosAndSpaceMode();
- // <--
InitControls();
return 0;
}
-/*-----------------03.12.97 12:24-------------------
---------------------------------------------------*/
IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld )
{
if(bInInintControl)
@@ -789,7 +685,7 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld )
}
else if(pFld == &aIndentMF)
{
- //jetzt muss mit dem FirstLineOffset auch der AbsLSpace veraendert werden
+ // now AbsLSpace also has to be modified by FirstLineOffset
long nDiff = nValue + aNumFmt.GetFirstLineOffset();
long nAbsLSpace = aNumFmt.GetAbsLSpace();
aNumFmt.SetAbsLSpace(sal_uInt16(nAbsLSpace + nDiff));
@@ -808,9 +704,6 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld )
return 0;
}
-/*-----------------04.12.97 12:35-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwNumPositionTabPage, RelativeHdl, CheckBox *, pBox )
{
sal_Bool bOn = pBox->IsChecked();
@@ -850,7 +743,6 @@ IMPL_LINK( SwNumPositionTabPage, RelativeHdl, CheckBox *, pBox )
return 0;
}
-// --> OD 2008-02-01 #newlistlevelattrs#
IMPL_LINK( SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG )
{
// determine value to be set at the chosen list levels
@@ -912,9 +804,7 @@ IMPL_LINK( SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG )
return 0;
}
-// <--
-// --> OD 2008-02-01 #newlistlevelattrs#
IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
{
// determine value to be set at the chosen list levels
@@ -937,9 +827,7 @@ IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
return 0;
}
-// <--
-// --> OD 2008-02-01 #newlistlevelattrs#
IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
{
// determine value to be set at the chosen list levels
@@ -963,9 +851,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
return 0;
}
-// <--
-// --> OD 2008-02-01 #newlistlevelattrs#
IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
{
// determine value to be set at the chosen list levels
@@ -992,11 +878,7 @@ IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
return 0;
}
-// <--
-
-/*-----------------05.12.97 15:33-------------------
---------------------------------------------------*/
IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG )
{
sal_uInt16 nMask = 1;
@@ -1005,13 +887,10 @@ IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG )
if(nActNumLvl & nMask)
{
SwNumFmt aNumFmt( pActNum->Get( i ) );
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aTmpNumRule( pWrtSh->GetUniqueNumRuleName(),
aNumFmt.GetPositionAndSpaceMode(),
pOutlineDlg ? OUTLINE_RULE : NUM_RULE );
- // <--
SwNumFmt aTempFmt(aTmpNumRule.Get( i ));
- // --> OD 2008-02-05 #newlistlevelattrs#
aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() );
if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -1027,8 +906,6 @@ IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG )
aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() );
aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() );
}
- // <--
-
pActNum->Set( i, aNumFmt );
}
nMask <<= 1;
@@ -1052,12 +929,6 @@ void SwNumPositionTabPage::SetModified(sal_Bool bRepaint)
#endif
-/**************************************************************************/
-/* */
-/* */
-/**************************************************************************/
-
-
SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent,
const SfxItemSet* pSwItemSet, SwWrtShell & rSh) :
SfxTabDialog(pParent, SW_RES(DLG_SVXTEST_NUM_BULLET), pSwItemSet, sal_False, &aEmptyStr),
@@ -1079,21 +950,14 @@ SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent,
AddTabPage( RID_SVXPAGE_NUM_POSITION );
}
-/*-----------------07.02.97 12.08-------------------
-
---------------------------------------------------*/
SwSvxNumBulletTabDialog::~SwSvxNumBulletTabDialog()
{
}
-/*-----------------07.02.97 14.48-------------------
-
---------------------------------------------------*/
-
void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
{
- //Namen der Vorlagen und Metric setzen
+ // set styles' names and metric
String sNumCharFmt, sBulletCharFmt;
SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt );
SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt );
@@ -1121,26 +985,22 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
- // Zeichenvorlagen sammeln
+ // collect char styles
ListBox rCharFmtLB(this);
rCharFmtLB.Clear();
rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
::FillCharStyleListBox(rCharFmtLB, pDocShell);
- List aList;
+
+ std::vector<String> aList;
for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
- {
+ aList.push_back( String(rCharFmtLB.GetEntry(j)));
- aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
- }
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) );
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (XubString*)aList.Remove(i);
- aList.Clear();
}
break;
case RID_SVXPAGE_NUM_POSITION:
@@ -1150,27 +1010,22 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) );
rPage.PageCreated(aSet);
-// ((SvxNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh);
}
break;
}
}
-/*-----------------17.02.97 16.52-------------------
---------------------------------------------------*/
short SwSvxNumBulletTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
pExampleSet->ClearItem(SID_PARAM_NUM_PRESET);
return nRet;
}
-/* -----------------02.12.98 08:35-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK(SwSvxNumBulletTabDialog, RemoveNumberingHdl, PushButton*, EMPTYARG)
{
EndDialog(RET_USER);
return 0;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/num.src b/sw/source/ui/misc/num.src
index 600175cc4c8d..33d3c53ee881 100644
--- a/sw/source/ui/misc/num.src
+++ b/sw/source/ui/misc/num.src
@@ -36,7 +36,7 @@
/**************************************************************************/
/* */
-/* TabPage Positionen */
+/* TabPage positions */
/* */
/**************************************************************************/
TabPage TP_NUM_POSITION
@@ -296,7 +296,7 @@ TabPage TP_NUM_POSITION
/**************************************************************************/
/* */
-/* Dialog fuer Test der Svx-Implementation */
+/* dialog for Svx-implementation's test */
/* */
/**************************************************************************/
TabDialog DLG_SVXTEST_NUM_BULLET
@@ -338,7 +338,6 @@ TabDialog DLG_SVXTEST_NUM_BULLET
PageItem
{
Identifier = RID_SVXPAGE_NUM_OPTIONS ;
- /* ### ACHTUNG: Neuer Text in Resource? Optionen : ~Optionen */
Text [ en-US ] = "Options" ;
};
};
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx
index 39186bb6de60..3421f3c58788 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <numberingtypelistbox.hxx>
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
#include <cnttab.hxx>
#include <com/sun/star/style/NumberingType.hpp>
#include <com/sun/star/text/XDefaultNumberingProvider.hpp>
@@ -40,18 +39,14 @@
#include <unomid.h>
using namespace com::sun::star;
-using namespace rtl;
-/* -----------------------------01.03.01 16:04--------------------------------
+using ::rtl::OUString;
- ---------------------------------------------------------------------------*/
struct SwNumberingTypeListBox_Impl
{
uno::Reference<text::XNumberingTypeInfo> xInfo;
};
-/* -----------------------------01.03.01 14:46--------------------------------
- ---------------------------------------------------------------------------*/
SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResId,
sal_uInt16 nTypeFlags ) :
ListBox(pWin, rResId),
@@ -59,23 +54,19 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResI
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
uno::Reference < uno::XInterface > xI = xMSF->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.DefaultNumberingProvider")) );
uno::Reference<text::XDefaultNumberingProvider> xDefNum(xI, uno::UNO_QUERY);
- DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
+ OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY);
Reload(nTypeFlags);
}
-/* -----------------------------01.03.01 14:46--------------------------------
- ---------------------------------------------------------------------------*/
SwNumberingTypeListBox::~SwNumberingTypeListBox()
{
delete pImpl;
}
-/* -----------------------------01.03.01 16:02--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags)
{
Clear();
@@ -150,24 +141,20 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags)
SelectEntryPos(0);
}
}
-/* -----------------------------01.03.01 14:46--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType()
{
sal_Int16 nRet = 0;
sal_uInt16 nSelPos = GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nSelPos)
nRet = (sal_Int16)(sal_uLong)GetEntryData(nSelPos);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- DBG_ERROR("SwNumberingTypeListBox not selected");
+ OSL_FAIL("SwNumberingTypeListBox not selected");
#endif
return nRet;
}
-/* -----------------------------01.03.01 14:46--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNumberingTypeListBox::SelectNumberingType(sal_Int16 nType)
{
sal_uInt16 nPos = GetEntryPos((void*)(sal_uLong)nType);
@@ -175,3 +162,4 @@ sal_Bool SwNumberingTypeListBox::SelectNumberingType(sal_Int16 nType)
return LISTBOX_ENTRY_NOTFOUND != nPos;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/numberingtypelistbox.src b/sw/source/ui/misc/numberingtypelistbox.src
index 8ca6e214e614..3e46d0b3f7a8 100644
--- a/sw/source/ui/misc/numberingtypelistbox.src
+++ b/sw/source/ui/misc/numberingtypelistbox.src
@@ -57,6 +57,8 @@ Resource STRRES_NUMTYPES
< "а, б, .., аа, аб, ... (Serbian)" ; 49 /*CHARS_CYRILLIC_LOWER_LETTER_SR */; > ;
< "Ð, Б, .., Ðа, Бб, ... (Serbian)" ; 50 /*CHARS_CYRILLIC_UPPER_LETTER_N_SR */; > ;
< "а, б, .., аа, бб, ... (Serbian)" ; 51 /*CHARS_CYRILLIC_LOWER_LETTER_N_SR */; > ;
+ < "Α, Β, Γ, ... (Greek Upper Letter)"; 52 /*CHARS_GREEK_UPPER_LETTER */; > ;
+ < "α, β, γ, ... (Greek Lower Letter)"; 53 /*CHARS_GREEK_LOWER_LETTER */; > ;
};
};
};
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 3f67fb5cdb1a..d4e734ed53fd 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,12 +33,8 @@
#endif
#include <hintids.hxx>
#include <tools/shl.hxx>
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/tabdlg.hxx>
#include <editeng/brshitem.hxx>
#include <unotools/configmgr.hxx>
@@ -47,14 +44,9 @@
#define USE_NUMTABPAGES
#include <num.hxx>
#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <uitool.hxx>
-#include <errhdl.hxx>
#include <wrtsh.hxx>
#include <swmodule.hxx>
#include <fmtcol.hxx>
@@ -67,26 +59,16 @@
#include <docstyle.hxx>
#include <viewopt.hxx>
#include <svtools/ctrlbox.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
-#include <globals.hrc> // fuer Vorlagenname 'keins'
-#endif
-#ifndef _MISC_HRC
+#include <globals.hrc> // for template name 'none'
#include <misc.hrc>
-#endif
-#ifndef _OUTLINE_HRC
#include <outline.hrc>
-#endif
#include <paratr.hxx>
#include <unomid.h>
#include <IDocumentOutlineNodes.hxx>
-// --> OD 2008-04-14 #outlinelevel#
#include <app.hrc>
-// <--
#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -94,16 +76,8 @@
using namespace ::com::sun::star;
-/* -----------------------------31.01.01 10:23--------------------------------
-
- ---------------------------------------------------------------------------*/
-
DBG_NAME(outlinehdl)
-/*---------------------------------------------------------------------
-
----------------------------------------------------------------------*/
-
class SwNumNamesDlg: public ModalDialog
{
FixedLine aFormFL;
@@ -126,10 +100,8 @@ public:
};
/*------------------------------------------------------------------------
- Beschreibung: selektierten Eintrag merken
+ Description: remember selected entry
------------------------------------------------------------------------*/
-
-
IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
{
aFormEdit.SetText(pBox->GetSelectEntry());
@@ -139,12 +111,10 @@ IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
/*------------------------------------------------------------------------
- Beschreibung: Setzen der vom Benutzer vergebenen Namen
- Parameter: Liste der vom Benutzer vergebenen Namen;
- nicht vom Benutzer benannte Positionen sind 0.
+ Description: set user defined names
+ Parameter: list of user defined names;
+ unknown positions for the user are 0.
------------------------------------------------------------------------*/
-
-
void SwNumNamesDlg::SetUserNames(const String *pList[])
{
sal_uInt16 nSelect = 0;
@@ -161,22 +131,20 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
aFormBox.SelectEntryPos(nSelect);
SelectHdl(&aFormBox);
}
+
/*------------------------------------------------------------------------
- Beschreibung: OK-Button freischalten, wenn Text im Edit steht.
+ Description: unlock OK-Button when text is in Edit
------------------------------------------------------------------------*/
-
-
IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
{
aOKBtn.Enable(0 != pBox->GetText().Len());
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
+
/*------------------------------------------------------------------------
- Beschreibung: DoubleClickHdl
+ Description: DoubleClickHdl
------------------------------------------------------------------------*/
-
-
IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
{
EndDialog(RET_OK);
@@ -184,10 +152,6 @@ IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
-/*--------------------------------------------------
-
---------------------------------------------------*/
-
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
: ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
aFormFL(this, SW_RES(FL_FORM)),
@@ -204,16 +168,8 @@ SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
SelectHdl(&aFormBox);
}
-/*--------------------------------------------------
+SwNumNamesDlg::~SwNumNamesDlg() {}
---------------------------------------------------*/
-
-__EXPORT SwNumNamesDlg::~SwNumNamesDlg() {}
-
-
-/* -----------------08.07.98 08:46-------------------
- *
- * --------------------------------------------------*/
sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
{
sal_uInt16 nTmp = nActLevel;
@@ -223,14 +179,11 @@ sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
return nTmpLevel;
}
-/* -----------------07.07.98 14:13-------------------
- *
- * --------------------------------------------------*/
sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
const SfxItemSet* pSwItemSet,
SwWrtShell &rSh) :
- //der UserString wird danach richtig gesetzt
+ // the UserString is set correctly afterwards
SfxTabDialog(pParent, SW_RES(DLG_TAB_OUTLINE), pSwItemSet, sal_False, &aEmptyStr),
aNullStr(C2S("____")),
aFormMenu(SW_RES(MN_FORM)),
@@ -240,7 +193,6 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
{
// --> OD 2008-04-14 #outlinelevel#
SetText( SW_RES( STR_OUTLINE_NUMBERING ) );
- // <--
PushButton* pUserButton = GetUserButton();
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
@@ -259,22 +211,20 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
for( i = 0; i < MAXLEVEL; ++i )
{
- // wurde die Vorlage noch nicht angelegt, dann ist sie noch an dieserPosition
+ // if the style wasn't created yet, it's still at this position
if( !rWrtSh.GetParaStyle( sHeadline =
SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
sHeadline )) )
aCollNames[i] = sHeadline;
}
- // Erfragen der Gliederungsebenen der Textvorlagen
+ // query the text templates' outlining levels
const sal_uInt16 nCount = rWrtSh.GetTxtFmtCollCount();
for(i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
- //sal_uInt8 nOutLevel = rTxtColl.GetOutlineLevel(); //<-#outline level, removed out by zhaojianwei
- //if(nOutLevel != NO_NUMBERING)
//->added by zhaojianwei
if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
{
@@ -286,17 +236,11 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
}
}
-/* -----------------07.07.98 14:13-------------------
- *
- * --------------------------------------------------*/
SwOutlineTabDialog::~SwOutlineTabDialog()
{
delete pNumRule;
}
-/* -----------------07.07.98 14:13-------------------
- *
- * --------------------------------------------------*/
void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
{
switch ( nPageId )
@@ -310,9 +254,7 @@ void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
break;
}
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG )
{
if (!bModified)
@@ -320,12 +262,10 @@ IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG )
EndDialog(RET_CANCEL);
return 0;
}
-/* -----------------08.07.98 12:14-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn )
{
- //PopupMenu auffuellen
+ // fill PopupMenu
for( sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i )
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
@@ -337,9 +277,6 @@ IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn )
return 0;
}
-/* -----------------08.07.98 12:14-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu )
{
sal_uInt8 nLevelNo = 0;
@@ -400,9 +337,7 @@ IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu )
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const
{
for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
@@ -413,21 +348,17 @@ sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const
return MAXLEVEL;//NO_NUMBERING; //#outline level,zhaojianwei
}
-/* -----------------07.07.98 16:30-------------------
- *
- * --------------------------------------------------*/
+
short SwOutlineTabDialog::Ok()
{
SfxTabDialog::Ok();
- // bei allen erzeugten Vorlagen die Ebenen setzen, muss
- // geschehen, um evtl. aufgehobene Zuordnungen
- // auch wieder zu loeschen
+ // set levels for all created templates; has to be done in order to
+ // delete possibly cancelled assignments again.
- // --> OD 2006-12-11 #130443#
+ // #130443#
// encapsulate changes into a action to avoid effects on the current cursor
// position during the changes.
rWrtSh.StartAction();
- // <--
const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
@@ -437,28 +368,10 @@ short SwOutlineTabDialog::Ok()
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if( !rTxtColl.IsDefault() )
{
- //rTxtColl.SetOutlineLevel( (sal_uInt8)GetLevel(rTxtColl.GetName()));//#outline level,removed by zhaojianwei
const SfxPoolItem & rItem =
rTxtColl.GetFmtAttr(RES_PARATR_NUMRULE, sal_False);
- //if ((sal_uInt8)GetLevel(rTxtColl.GetName()) == NO_NUMBERING) //#outline level,removed by zhaojianwei
- //{
- // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
- // pOutlineRule->GetName())
- // {
- // rTxtColl.ResetFmtAttr(RES_PARATR_NUMRULE);
- // }
- //}
- //else
- //{
- // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
- // pOutlineRule->GetName())
- // {
- // SwNumRuleItem aItem(pOutlineRule->GetName());
- // rTxtColl.SetFmtAttr(aItem);
- // }
- //}
if ((sal_uInt8)GetLevel(rTxtColl.GetName()) == MAXLEVEL) //add by zhaojianwei
{
if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
@@ -493,26 +406,7 @@ short SwOutlineTabDialog::Ok()
SwTxtFmtColl* pColl = rWrtSh.FindTxtFmtCollByName( sHeadline );
if( !pColl )
{
- //if( !aCollNames[i].Len() ) //#outline level,removed by zhaojianwei
- //{
- // SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
- // static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
- // pTxtColl->SetOutlineLevel( NO_NUMBERING );
- // pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE);
- //}
- //else if(aCollNames[i] != sHeadline)
- //{
- // SwTxtFmtColl* pTxtColl = rWrtSh.GetParaStyle(
- // aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
- // if(pTxtColl)
- // {
- // pTxtColl->SetOutlineLevel( static_cast< sal_uInt8 >(i) );
-
- // SwNumRuleItem aItem(pOutlineRule->GetName());
- // pTxtColl->SetFmtAttr(aItem);
- // }
- //}
- if(aCollNames[i] != sHeadline)//->added by zhaojianwei
+ if(aCollNames[i] != sHeadline)
{
SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
@@ -530,22 +424,18 @@ short SwOutlineTabDialog::Ok()
pTxtColl->SetFmtAttr(aItem);
}
}
- }//<--end,zhaojianwei
+ }
}
}
rWrtSh.SetOutlineNumRule( *pNumRule);
- // --> OD 2006-12-11 #130443#
+ // #i30443#
rWrtSh.EndAction();
- // <--
return RET_OK;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet),
aLevelFL( this, SW_RES(FL_LEVEL )),
@@ -588,13 +478,10 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxIte
aCharFmtLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CharFmtHdl));
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
void SwOutlineSettingsTabPage::Update()
{
- // falls eine Vorlage fuer diese Ebene bereits selektiert wurde,
- // diese in der ListBox auswaehlean
+ // if a template was already selected for this level, select it in the ListBox
aCollBox.Enable(USHRT_MAX != nActLevel);
if(USHRT_MAX == nActLevel)
{
@@ -704,9 +591,6 @@ void SwOutlineSettingsTabPage::Update()
SetModified();
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox )
{
nActLevel = 0;
@@ -727,9 +611,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox )
Update();
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld )
{
sal_uInt16 nMask = 1;
@@ -747,15 +629,13 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld )
SetModified();
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
{
sal_uInt8 i;
const String aCollName(pBox->GetSelectEntry());
- //0xFFFF darf hier nicht sein (disable)
+ //0xFFFF not allowed here (disable)
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
String sOldName( pCollNames[nTmpLevel] );
@@ -767,7 +647,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
else
{
pCollNames[nTmpLevel] = aCollName;
- // wird die Vorlage bereits verwendet ?
+ // template already in use?
for( i = 0; i < MAXLEVEL; ++i)
if(i != nTmpLevel && pCollNames[i] == aCollName )
pCollNames[i] = aEmptyStr;
@@ -800,13 +680,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelectGetFocus, ListBox *, EMPTYARG )
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox )
{
sal_uInt16 nMask = 1;
- sal_Int16 nNumberType = pBox->GetSelectedNumberingType();//(sal_Int16)(sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos());
+ sal_Int16 nNumberType = pBox->GetSelectedNumberingType();
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
@@ -821,9 +698,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBo
SetModified();
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, EMPTYARG )
{
sal_uInt16 nMask = 1;
@@ -841,9 +716,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, EMPTYARG )
SetModified();
return 0;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld )
{
sal_uInt16 nMask = 1;
@@ -860,12 +733,9 @@ IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld )
SetModified();
return 0;
}
-/* -----------------21.09.98 12:21-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG )
{
-// bAutomaticCharStyles = sal_False;
String sEntry = aCharFmtLB.GetSelectEntry();
sal_uInt16 nMask = 1;
sal_Bool bFormatNone = sEntry == ViewShell::GetShellRes()->aStrNone;
@@ -909,32 +779,26 @@ IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG )
}
return RET_OK;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage()
{
}
-/* -----------------07.07.98 16:27-------------------
- *
- * --------------------------------------------------*/
+
void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
{
pSh = pShell;
- // Erfragen der NumRules dieses Dokumentes
+ // query this document's NumRules
pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule();
pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames();
- //pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
-
aPreviewWIN.SetNumRule(pNumRule);
aPreviewWIN.SetOutlineNames(pCollNames);
- // Startwert setzen - nActLevel muss hier 1 sein
+ // set start value - nActLevel must be 1 here
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
const SwNumFmt& rNumFmt = pNumRule->Get( nTmpLevel );
aStartEdit.SetValue( rNumFmt.GetStart() );
- // Poolformate fuer Ueberschriften anlegen
+ // create pool formats for headlines
String sStr;
sal_uInt16 i;
for( i = 0; i < MAXLEVEL; ++i )
@@ -947,7 +811,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
sStr += String::CreateFromInt32(MAXLEVEL);
aLevelLB.InsertEntry( sStr );
- // Erfragen der Gliederungsebenen der Textvorlagen
+ // query the texttemplates' outlining levels
const sal_uInt16 nCount = pSh->GetTxtFmtCollCount();
for( i = 0; i < nCount; ++i )
{
@@ -969,18 +833,16 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
}
aLevelLB.SelectEntryPos(nTmp-1);//nTmp);//#outline level,zhaojianwei
- // Zeichenvorlagen sammeln
+ // collect char styles
aCharFmtLB.Clear();
aCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
- // Zeichenvorlagen
+ // char styles
::FillCharStyleListBox(aCharFmtLB,
pSh->GetView().GetDocShell());
Update();
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
{
nActLevel = SwOutlineTabDialog::GetActNumLevel();
@@ -990,39 +852,29 @@ void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
aLevelLB.SelectEntryPos(MAXLEVEL);
LevelHdl(&aLevelLB);
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*)
{
SwOutlineTabDialog::SetActNumLevel(nActLevel);
return LEAVE_PAGE;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwOutlineSettingsTabPage::FillItemSet( SfxItemSet& )
{
return sal_True;
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
void SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet )
{
ActivatePage(rSet);
}
-/* -----------------07.07.98 14:19-------------------
- *
- * --------------------------------------------------*/
+
SfxTabPage* SwOutlineSettingsTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwOutlineSettingsTabPage(pParent, rAttrSet);
}
-/* -----------------07.11.2002 15:13-----------------
- *
- * --------------------------------------------------*/
+
void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
{
sal_Bool bIsNull = aStartEdit.GetValue() == 0;
@@ -1033,9 +885,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType
if(bIsNull && bNoZeroAllowed)
aStartEdit.GetModifyHdl().Call(&aStartEdit);
}
-/*-----------------09.12.97 11:54-------------------
---------------------------------------------------*/
sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev,
const SwNumFmt& rFmt, sal_uInt16 nXStart,
sal_uInt16 nYStart, const Size& rSize)
@@ -1053,9 +903,7 @@ sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev,
pVDev->SetFont(aTmpFont);
return nRet;
}
-/*-----------------09.12.97 11:49-------------------
---------------------------------------------------*/
sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt16 nXStart,
sal_uInt16 nYStart, sal_uInt16 nDivision)
{
@@ -1077,8 +925,9 @@ sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt1
return nRet;
}
-/*-----------------02.12.97 10:34-------------------
- Vorschau der Numerierung painten
+
+/*--------------------------------------------------
+ paint numbering's preview
--------------------------------------------------*/
void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
@@ -1106,9 +955,9 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
nWidthRelation = nWidthRelation / 4;
}
else
- nWidthRelation = 30; // Kapiteldialog
+ nWidthRelation = 30; // chapter dialog
- //Hoehe pro Ebene
+ // height per level
sal_uInt16 nXStep = sal_uInt16(aSize.Width() / (3 * MAXLEVEL));
if(MAXLEVEL < 10)
nXStep /= 2;
@@ -1120,7 +969,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
// #101524# OJ
aStdFont.SetColor( SwViewOption::GetFontColor() );
- //
sal_uInt16 nFontHeight = nYStep * 6 / 10;
if(bPosition)
nFontHeight = nYStep * 15 / 10;
@@ -1136,7 +984,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
nStart++;
}
- if(nStart) // damit moeglichs Vorgaenger und Nachfolger gezeigt werden
+ if(nStart) // so that possible predecessors and successors are showed
nStart--;
SwNumberTree::tNumberVector aNumVector;
@@ -1146,7 +994,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNumVector.push_back(rFmt.GetStart());
- // --> OD 2008-02-01 #newlistlevelattrs#
sal_uInt16 nXStart( 0 );
short nTextOffset( 0 );
sal_uInt16 nNumberXPos( 0 );
@@ -1176,7 +1023,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
nNumberXPos = static_cast<sal_uInt16>(nTmpNumberXPos);
}
}
- // <--
sal_uInt16 nBulletWidth = 0;
if( SVX_NUM_BITMAP == rFmt.GetNumberingType() )
@@ -1194,14 +1040,12 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
- // --> OD 2005-11-17 #128041#
+ // #128041#
String aText(pActNum->MakeNumString( aNumVector ));
- // <--
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText);
nPreNum++;
}
- // --> OD 2008-02-01 #newlistlevelattrs#
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT &&
rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE )
{
@@ -1210,9 +1054,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText);
}
- // <--
- // --> OD 2008-02-01 #newlistlevelattrs#
sal_uInt16 nTextXPos( 0 );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -1246,7 +1088,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
nXStart = static_cast<sal_uInt16>( rFmt.GetIndentAt() / nWidthRelation );
}
- // <--
Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
@@ -1267,7 +1108,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNumVector.push_back(rFmt.GetStart());
- // --> OD 2008-02-01 #newlistlevelattrs#
sal_uInt16 nXStart( 0 );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -1289,7 +1129,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
}
nXStart /= 2;
nXStart += 2;
- // <--
sal_uInt16 nTextOffset = 2 * nXStep;
if( SVX_NUM_BITMAP == rFmt.GetNumberingType() )
{
@@ -1306,9 +1145,8 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
- // --> OD 2005-11-17 #128041#
+ // #128041#
String aText(pActNum->MakeNumString( aNumVector ));
- // <--
pVDev->DrawText( Point(nXStart, nYStart), aText );
nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText);
nTextOffset = nTextOffset + nXStep;
@@ -1317,7 +1155,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->SetFont(aStdFont);
// Changed as per BugID 79541 Branding/Configuration
- uno::Any MyAny = ::utl::ConfigManager::GetConfigManager()->
+ uno::Any MyAny = ::utl::ConfigManager::GetConfigManager().
GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
::rtl::OUString aProductName;
@@ -1338,11 +1176,8 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
}
-/*-----------------02.12.97 10:34-------------------
-
---------------------------------------------------*/
NumberingPreview::~NumberingPreview()
{
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src
index 85ea42df4861..f84fd6738462 100644
--- a/sw/source/ui/misc/outline.src
+++ b/sw/source/ui/misc/outline.src
@@ -106,7 +106,6 @@ TabDialog DLG_TAB_OUTLINE
// --> OD 2008-04-14 #outlinelevel#
// dialog title is now given by resource STR_OUTLINE_NUMBERING
// Text [ en-US ] = "Outline Numbering" ;
- // <--
Moveable = TRUE ;
TabControl 1
{
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 593dbebae5ef..ae011c4ed296 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,18 +35,18 @@
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <hintids.hxx>
#include <tools/ref.hxx>
-#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
-#endif
+#include <svx/drawitem.hxx>
+#include <svx/xtable.hxx> // XColorTable
+#include <sal/macros.h>
#include <vcl/field.hxx>
#include <vcl/svapp.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/syslocale.hxx>
+#include <editeng/borderline.hxx>
#include <editeng/sizeitem.hxx>
#include <svx/pageitem.hxx>
#include <svl/eitem.hxx>
@@ -54,61 +55,21 @@
#include <pagedesc.hxx>
#include <pgfnote.hxx>
#include <uiitems.hxx>
+#include <sfx2/objsh.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _PGFNOTE_HRC
#include <pgfnote.hrc>
-#endif
-
-#define TWIP_TO_LBOX 5
-/*-----------------------------------------------------#---------------
- Beschreibung: vordefinierte Linien in Point
- --------------------------------------------------------------------*/
-
-static const sal_uInt16 __FAR_DATA nLines[] = {
- 0,
- 50,
- 100,
- 150,
- 200,
- 500
-};
-
-static const sal_uInt16 nLineCount = sizeof(nLines) / sizeof(nLines[0]);
-static sal_uInt16 __FAR_DATA aPageRg[] = {
+static sal_uInt16 aPageRg[] = {
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO,
0
};
-
/*------------------------------------------------------------------------
- Beschreibung: liefert zurueck, ob die Linienbreite nWidth bereits
- in der Listbox enthalten ist.
+ Description: handler to switch between the different possibilities
+ how the footnote region's height can be set.
------------------------------------------------------------------------*/
-
-
-sal_Bool lcl_HasLineWidth(sal_uInt16 nWidth)
-{
- for(sal_uInt16 i = 0; i < nLineCount; ++i) {
- if(nLines[i] == nWidth)
- return sal_True;
- }
- return sal_False;
-}
-
-/*------------------------------------------------------------------------
- Beschreibung: Handler fuer umschalten zwischen den unterschiedlichen
- Arten, wie die Hoehe des Fussnotenbereiches angegeben
- werden kann.
-------------------------------------------------------------------------*/
-
-
IMPL_LINK_INLINE_START( SwFootNotePage, HeightPage, Button *, EMPTYARG )
{
aMaxHeightEdit.Enable(sal_False);
@@ -126,10 +87,8 @@ IMPL_LINK_INLINE_START( SwFootNotePage, HeightMetric, Button *, EMPTYARG )
IMPL_LINK_INLINE_END( SwFootNotePage, HeightMetric, Button *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: Handler Grenzwerte
+ Description: handler limit values
------------------------------------------------------------------------*/
-
-
IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
{
aMaxHeightEdit.SetMax(aMaxHeightEdit.Normalize(lMaxHeight -
@@ -151,6 +110,23 @@ IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
return 0;
}
+IMPL_LINK( SwFootNotePage, LineWidthChanged_Impl, void *, EMPTYARG )
+{
+ sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
+ aLineTypeBox.SetWidth( nVal );
+
+ return 0;
+}
+
+IMPL_LINK( SwFootNotePage, LineColorSelected_Impl, void *, EMPTYARG )
+{
+ aLineTypeBox.SetColor( aLineColorBox.GetSelectEntryColor() );
+ return 0;
+}
+
// CTOR / DTOR -----------------------------------------------------------
SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
@@ -170,6 +146,10 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
aLineTypeBox(this, SW_RES(DLB_LINETYPE)),
aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
+ aLineColorLbl(this, SW_RES(FT_LINECOLOR)),
+ aLineColorBox(this, SW_RES(DLB_LINECOLOR)),
+ aLineLengthLbl(this, SW_RES(FT_LINELENGTH)),
+ aLineLengthEdit(this, SW_RES(ED_LINELENGTH)),
aLineDistLbl(this, SW_RES(FT_LINEDIST)),
aLineDistEdit(this, SW_RES(ED_LINEDIST))
{
@@ -190,22 +170,14 @@ SwFootNotePage::~SwFootNotePage()
{
}
-
SfxTabPage* SwFootNotePage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwFootNotePage(pParent, rSet);
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwFootNotePage::Reset(const SfxItemSet &rSet)
{
- // Falls noch kein Bsp vorhanden Init hier sonst im Activate
- //
+ // if no example exists, otherwise Init here in Activate
SwPageFtnInfo* pDefFtnInfo = 0;
const SwPageFtnInfo* pFtnInfo;
const SfxPoolItem* pItem = SfxTabPage::GetItem(rSet, FN_PARAM_FTN_INFO);
@@ -215,12 +187,12 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
}
else
{
- // wenn "Standard" betaetigt wird, wird das Fussnotenitem geloescht,
- // deswegen muss hier eine Fussnotenstruktur erzeugt werden
+ // when "standard" is being activated the footnote item is deleted,
+ // that's why a footnote structure has to be created here
pDefFtnInfo = new SwPageFtnInfo();
pFtnInfo = pDefFtnInfo;
}
- // Hoehe Fussnotenbereich
+ // footnote area's height
SwTwips lHeight = pFtnInfo->GetHeight();
if(lHeight)
{
@@ -239,24 +211,72 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
aDistEdit.SetLoseFocusHdl( aLk );
aLineDistEdit.SetLoseFocusHdl( aLk );
- // Trennlinie
- for(sal_uInt16 i = 0; i < nLineCount; ++i)
- aLineTypeBox.InsertEntry(nLines[i]);
+ // Separator width
+ aLineWidthEdit.SetModifyHdl( LINK( this, SwFootNotePage, LineWidthChanged_Impl ) );
+
+ sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
+ sal_Int64( pFtnInfo->GetLineWidth() ), aLineWidthEdit.GetDecimalDigits(),
+ MAP_TWIP, aLineWidthEdit.GetUnit( ) ));
+ aLineWidthEdit.SetValue( nWidthPt );
- const sal_uInt16 nWidth = (sal_uInt16)pFtnInfo->GetLineWidth() * TWIP_TO_LBOX;
- if ( !lcl_HasLineWidth(nWidth) )
- aLineTypeBox.InsertEntry(nWidth);
- aLineTypeBox.SelectEntry(nWidth);
+ // Separator style
+ aLineTypeBox.SetSourceUnit( FUNIT_TWIP );
- // Position
+ aLineTypeBox.SetNone( String( SW_RES( STR_NONE ) ) );
+ aLineTypeBox.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::SOLID ), ::editeng::SOLID );
+ aLineTypeBox.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DOTTED ), ::editeng::DOTTED );
+ aLineTypeBox.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DASHED ), ::editeng::DASHED );
+ aLineTypeBox.SetWidth( pFtnInfo->GetLineWidth( ) );
+ aLineTypeBox.SelectEntry( pFtnInfo->GetLineStyle() );
+
+ // Separator Color
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ const SfxPoolItem* pColorItem = NULL;
+ XColorTable* pColorTable = NULL;
+
+ OSL_ENSURE( pDocSh, "DocShell not found!" );
+
+ if ( pDocSh )
+ {
+ pColorItem = pDocSh->GetItem( SID_COLOR_TABLE );
+ if ( pColorItem != NULL )
+ pColorTable = ( (SvxColorTableItem*)pColorItem )->GetColorTable();
+ }
+
+ OSL_ENSURE( pColorTable, "ColorTable not found!" );
+
+ if ( pColorTable )
+ {
+ aLineColorBox.SetUpdateMode( sal_False );
+
+ for ( long i = 0; i < pColorTable->Count(); ++i )
+ {
+ XColorEntry* pEntry = pColorTable->GetColor(i);
+ aLineColorBox.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ }
+ aLineColorBox.SetUpdateMode( sal_True );
+ }
+
+ // select color in the list or add it as a user color
+ sal_uInt16 nSelPos = aLineColorBox.GetEntryPos( pFtnInfo->GetLineColor() );
+ if( nSelPos == LISTBOX_ENTRY_NOTFOUND )
+ nSelPos = aLineColorBox.InsertEntry( pFtnInfo->GetLineColor(),
+ String( SW_RES( RID_SVXSTR_COLOR_USER ) ) );
+
+ aLineColorBox.SetSelectHdl( LINK( this, SwFootNotePage, LineColorSelected_Impl ) );
+ aLineColorBox.SelectEntryPos( nSelPos );
+ aLineTypeBox.SetColor( pFtnInfo->GetLineColor() );
+
+
+ // position
aLinePosBox.SelectEntryPos( static_cast< sal_uInt16 >(pFtnInfo->GetAdj()) );
- // Breite
+ // width
Fraction aTmp( 100, 1 );
aTmp *= pFtnInfo->GetWidth();
- aLineWidthEdit.SetValue( static_cast<long>(aTmp) );
+ aLineLengthEdit.SetValue( static_cast<long>(aTmp) );
- // Abstand Fussnotenbereich
+ // gap footnote area
aDistEdit.SetValue(aDistEdit.Normalize(pFtnInfo->GetTopDist()),FUNIT_TWIP);
aLineDistEdit.SetValue(
aLineDistEdit.Normalize(pFtnInfo->GetBottomDist()), FUNIT_TWIP);
@@ -265,40 +285,46 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Attribute in den Set stopfen bei OK
+ Description: stuff attributes into the set, when OK
--------------------------------------------------------------------*/
-
-
sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet)
{
SwPageFtnInfoItem aItem((const SwPageFtnInfoItem&)GetItemSet().Get(FN_PARAM_FTN_INFO));
- // Das ist das Original
+ // that's the original
SwPageFtnInfo &rFtnInfo = aItem.GetPageFtnInfo();
- // Hoehe Fussnotenbereich
+ // footnote area's height
if(aMaxHeightBtn.IsChecked())
rFtnInfo.SetHeight( static_cast< SwTwips >(
aMaxHeightEdit.Denormalize(aMaxHeightEdit.GetValue(FUNIT_TWIP))));
else
rFtnInfo.SetHeight(0);
- // Abstand Fussnotenbereich
+ // gap footnote area
rFtnInfo.SetTopDist( static_cast< SwTwips >(
aDistEdit.Denormalize(aDistEdit.GetValue(FUNIT_TWIP))));
rFtnInfo.SetBottomDist( static_cast< SwTwips >(
aLineDistEdit.Denormalize(aLineDistEdit.GetValue(FUNIT_TWIP))));
- // Trennlinie
- const sal_uInt16 nPos = aLineTypeBox.GetSelectEntryPos();
- if( LISTBOX_ENTRY_NOTFOUND != nPos )
- rFtnInfo.SetLineWidth(nLines[nPos] / TWIP_TO_LBOX);
+ // Separator style
+ rFtnInfo.SetLineStyle( ::editeng::SvxBorderStyle( aLineTypeBox.GetSelectEntryStyle() ) );
+
+ // Separator width
+ long nWidth = static_cast<long>(MetricField::ConvertDoubleValue(
+ aLineWidthEdit.GetValue( ),
+ aLineWidthEdit.GetDecimalDigits( ),
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
+ rFtnInfo.SetLineWidth( nWidth );
+
+ // Separator color
+ rFtnInfo.SetLineColor( aLineColorBox.GetSelectEntryColor() );
// Position
rFtnInfo.SetAdj((SwFtnAdj)aLinePosBox.GetSelectEntryPos());
// Breite
- rFtnInfo.SetWidth(Fraction( static_cast< long >(aLineWidthEdit.GetValue()), 100));
+ rFtnInfo.SetWidth(Fraction( static_cast< long >(aLineLengthEdit.GetValue()), 100));
const SfxPoolItem* pOldItem;
if(0 == (pOldItem = GetOldItem( rSet, FN_PARAM_FTN_INFO )) ||
@@ -352,7 +378,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
lMaxHeight *= 8;
lMaxHeight /= 10;
- // Maximalwerte setzen
+ // set maximum values
HeightModify(0);
}
@@ -369,5 +395,4 @@ sal_uInt16* SwFootNotePage::GetRanges()
return aPageRg;
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/pgfnote.hrc b/sw/source/ui/misc/pgfnote.hrc
index fe94849c6d66..3b3c8643bf8e 100644
--- a/sw/source/ui/misc/pgfnote.hrc
+++ b/sw/source/ui/misc/pgfnote.hrc
@@ -36,9 +36,12 @@
#define DLB_LINETYPE 21
#define FT_LINEPOS 22
#define DLB_LINEPOS 23
-#define FT_LINEWIDTH 24
-#define ED_LINEWIDTH 25
+#define FT_LINELENGTH 24
+#define ED_LINELENGTH 25
#define FT_LINEDIST 26
#define ED_LINEDIST 27
#define FL_LINE 30
-
+#define FT_LINEWIDTH 31
+#define ED_LINEWIDTH 32
+#define FT_LINECOLOR 33
+#define DLB_LINECOLOR 34
diff --git a/sw/source/ui/misc/pgfnote.src b/sw/source/ui/misc/pgfnote.src
index 7d74eeb567f3..6164a686cddb 100644
--- a/sw/source/ui/misc/pgfnote.src
+++ b/sw/source/ui/misc/pgfnote.src
@@ -129,7 +129,7 @@ TabPage TP_FOOTNOTE_PAGE
Size = MAP_APPFONT ( 132 , 8 ) ;
Group = TRUE ;
Left = TRUE ;
- Text [ en-US ] = "~Weight" ;
+ Text [ en-US ] = "~Style" ;
};
ListBox DLB_LINETYPE
{
@@ -139,15 +139,14 @@ TabPage TP_FOOTNOTE_PAGE
TabStop = TRUE ;
Group = TRUE ;
DropDown = TRUE ;
- CurPos = 0 ;
};
-
FixedText FT_LINEWIDTH
{
Pos = MAP_APPFONT ( 12 , 105 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
+ Group = TRUE ;
Left = TRUE ;
- Text [ en-US ] = "~Length" ;
+ Text [ en-US ] = "~Thickness" ;
};
MetricField ED_LINEWIDTH
{
@@ -155,6 +154,49 @@ TabPage TP_FOOTNOTE_PAGE
Border = TRUE ;
Pos = MAP_APPFONT ( 148 , 103 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
+ Spin = TRUE ;
+ Repeat = TRUE ;
+ SpinSize = 25 ;
+ First = 25 ;
+ Last = 900 ;
+ Maximum = 900 ;
+ Minimum = 25 ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_POINT ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ };
+ FixedText FT_LINECOLOR
+ {
+ Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Size = MAP_APPFONT ( 132 , 8 ) ;
+ Group = TRUE ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Color" ;
+ };
+ ListBox DLB_LINECOLOR
+ {
+ Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Size = MAP_APPFONT ( 57 , 50 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown = TRUE ;
+ DDExtraWidth = TRUE ;
+ Border = TRUE ;
+ };
+
+ FixedText FT_LINELENGTH
+ {
+ Pos = MAP_APPFONT ( 12 , 137 ) ;
+ Size = MAP_APPFONT ( 132 , 8 ) ;
+ Left = TRUE ;
+ Text [ en-US ] = "~Length" ;
+ };
+ MetricField ED_LINELENGTH
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 148 , 135 ) ;
+ Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
@@ -168,7 +210,7 @@ TabPage TP_FOOTNOTE_PAGE
};
FixedText FT_LINEDIST
{
- Pos = MAP_APPFONT ( 12 , 121 ) ;
+ Pos = MAP_APPFONT ( 12 , 153 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
Text [ en-US ] = "~Spacing to footnote contents" ;
Left = TRUE ;
@@ -177,7 +219,7 @@ TabPage TP_FOOTNOTE_PAGE
{
HelpID = "sw:MetricField:TP_FOOTNOTE_PAGE:ED_LINEDIST";
Border = TRUE ;
- Pos = MAP_APPFONT ( 148 , 119 ) ;
+ Pos = MAP_APPFONT ( 148 , 151 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 90d600301a56..3253f2c42549 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,14 +37,10 @@
#include <sfx2/app.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <hintids.hxx>
#include <swtypes.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <svx/xtable.hxx>
#include <uitool.hxx>
#include <editeng/sizeitem.hxx>
@@ -51,6 +48,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <svx/ruler.hxx>
#include <pggrid.hxx>
#include <tgrditem.hxx>
#include <pggrid.hrc>
@@ -60,9 +58,7 @@
#include "uiitems.hxx"
#include "swmodule.hxx"
#include "view.hxx"
-/*-- 06.02.2002 15:25:39---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_TEXTGRID_PAGE), rSet),
aGridTypeFL (this, SW_RES(FL_GRID_TYPE )),
@@ -74,10 +70,12 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aLayoutFL (this, SW_RES(FL_LAYOUT )),
aLinesPerPageFT (this, SW_RES(FT_LINESPERPAGE )),
aLinesPerPageNF (this, SW_RES(NF_LINESPERPAGE )),
+ aLinesRangeFT (this, SW_RES(FT_LINERANGE )),
aTextSizeFT (this, SW_RES(FT_TEXTSIZE )),
aTextSizeMF (this, SW_RES(MF_TEXTSIZE )),
aCharsPerLineFT (this, SW_RES(FT_CHARSPERLINE )),
aCharsPerLineNF (this, SW_RES(NF_CHARSPERLINE )),
+ aCharsRangeFT (this, SW_RES(FT_CHARRANGE )),
aCharWidthFT (this, SW_RES(FT_CHARWIDTH )),
aCharWidthMF (this, SW_RES(MF_CHARWIDTH )),
aRubySizeFT (this, SW_RES(FT_RUBYSIZE )),
@@ -92,7 +90,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
m_bRubyUserValue(sal_False),
m_aPageSize(MM50, MM50),
m_bVertical(sal_False),
- m_bSquaredMode(sal_False)
+ m_bSquaredMode(sal_False),
+ m_bHRulerChanged( sal_False ),
+ m_bVRulerChanged( sal_False )
{
FreeResource();
@@ -113,7 +113,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aControls[14] =&aPrintCB;
aControls[15] =&aColorFT;
aControls[16] =&aColorLB;
- aControls[17] =0;
+ aControls[17] =&aLinesRangeFT;
+ aControls[18] =&aCharsRangeFT;
+ aControls[19] =0;
Link aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
aCharsPerLineNF.SetUpHdl(aLink);
@@ -147,11 +149,11 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aDisplayCB.SetClickHdl(LINK(this, SwTextGridPage, DisplayGridHdl));
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
aColorLB.InsertAutomaticEntry();
- for( sal_uInt16 i = 0; i < pColorTbl->Count(); ++i )
+ for( sal_uInt16 i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
aColorLB.InsertEntry( aColor, sName );
@@ -186,22 +188,16 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aCharWidthMF.Show();
}
}
-/*-- 06.02.2002 15:25:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTextGridPage::~SwTextGridPage()
{
}
-/*-- 06.02.2002 15:25:40---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxTabPage *SwTextGridPage::Create(Window *pParent, const SfxItemSet &rSet)
{
return new SwTextGridPage(pParent, rSet);
}
-/*-- 06.02.2002 15:25:40---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwTextGridPage::FillItemSet(SfxItemSet &rSet)
{
sal_Bool bRet = sal_False;
@@ -224,11 +220,15 @@ sal_Bool SwTextGridPage::FillItemSet(SfxItemSet &rSet)
bRet = sal_True;
}
+ // draw ticks of ruler
+ SwView * pView = ::GetActiveView();
+ if ( m_bHRulerChanged )
+ pView->GetHLineal().DrawTicks();
+ if ( m_bVRulerChanged )
+ pView->GetVLineal().DrawTicks();
return bRet;
}
-/*-- 06.02.2002 15:25:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTextGridPage::Reset(const SfxItemSet &rSet)
{
if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(RES_TEXTGRID, sal_True))
@@ -246,6 +246,7 @@ void SwTextGridPage::Reset(const SfxItemSet &rSet)
GridTypeHdl(pButton);
aSnapToCharsCB.Check(rGridItem.IsSnapToChars());
aLinesPerPageNF.SetValue(rGridItem.GetLines());
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
m_nRubyUserValue = rGridItem.GetBaseHeight();
m_bRubyUserValue = sal_True;
aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP);
@@ -270,9 +271,7 @@ void SwTextGridPage::Reset(const SfxItemSet &rSet)
aPrintCB.SaveValue();
aColorLB.SaveValue();
}
-/*-- 06.02.2002 15:25:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTextGridPage::ActivatePage( const SfxItemSet& rSet )
{
aExampleWN.Hide();
@@ -281,16 +280,12 @@ void SwTextGridPage::ActivatePage( const SfxItemSet& rSet )
aExampleWN.Show();
aExampleWN.Invalidate();
}
-/*-- 06.02.2002 15:25:41---------------------------------------------------
- -----------------------------------------------------------------------*/
int SwTextGridPage::DeactivatePage( SfxItemSet* )
{
return LEAVE_PAGE;
}
-/* -----------------------------08.02.2002 11:57------------------------------
- ---------------------------------------------------------------------------*/
void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
{
SwTextGridItem aGridItem;
@@ -309,10 +304,20 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
aGridItem.SetPrintGrid(aPrintCB.IsChecked());
aGridItem.SetColor(aColorLB.GetSelectEntryColor());
rSet.Put(aGridItem);
+/// Amelia
+ SwView * pView = ::GetActiveView();
+ if ( aGridItem.GetGridType() != GRID_NONE )
+ {
+ if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
+ {
+ m_bHRulerChanged = sal_True;
+ }
+ m_bVRulerChanged = sal_True;
+ pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
+ pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
+ }
}
-/* -----------------------------08.02.2002 10:54------------------------------
- ---------------------------------------------------------------------------*/
void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet)
{
if( SFX_ITEM_UNKNOWN != rSet.GetItemState( RES_FRAMEDIR, sal_True ))
@@ -359,6 +364,12 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet)
if ( m_bSquaredMode )
{
aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
+ aCharsPerLineNF.SetMax( aCharsPerLineNF.GetValue() );
+ aLinesPerPageNF.SetMax( m_aPageSize.Height() /
+ ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
+ aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
+ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
}
else
{
@@ -368,22 +379,28 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet)
aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
else
aCharsPerLineNF.SetValue( 45 );
+ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
}
}
}
-/* -----------------------------06.02.2002 15:24------------------------------
- ---------------------------------------------------------------------------*/
+void SwTextGridPage::SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue )
+{
+ String aFieldStr = String::CreateFromAscii("( 1 -");
+ aFieldStr += String::CreateFromInt32( nValue );
+ aFieldStr += String::CreateFromAscii(" )");
+ rField.SetText( aFieldStr );
+}
+
sal_uInt16* SwTextGridPage::GetRanges()
{
- static sal_uInt16 __FAR_DATA aPageRg[] = {
+ static sal_uInt16 aPageRg[] = {
RES_TEXTGRID, RES_TEXTGRID,
0};
return aPageRg;
}
-/* -----------------------------08.02.2002 10:56------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
{
//if in squared mode
@@ -405,6 +422,8 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
aLinesPerPageNF.SetMax(nMaxLines);
}
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
}
else//in normal mode
{
@@ -413,6 +432,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue());
aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP);
aRubySizeMF.SetValue(0, FUNIT_TWIP);
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
m_nRubyUserValue = nHeight;
m_bRubyUserValue = sal_True;
@@ -421,13 +441,13 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
{
long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP);
+ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
}
}
GridModifyHdl(0);
return 0;
}
-/* -----------------------------04.09.2006 15:46------------------------------
- ---------------------------------------------------------------------------*/
+
IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
{
//if in squared mode
@@ -435,8 +455,6 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
{
if (&aTextSizeMF == pField)
{
- sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
- aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
m_bRubyUserValue = sal_False;
}
//set maximum line per page
@@ -445,6 +463,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
aLinesPerPageNF.SetMax(nMaxLines);
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
}
}
else
@@ -454,23 +473,23 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
m_bRubyUserValue = sal_False;
+ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
}
else if (&aCharWidthMF == pField)
{
sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP)));
+ sal_Int32 nMaxChar = 45 ;
if (nTextWidth)
- aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
- else
- aCharsPerLineNF.SetValue( 45 );
+ nMaxChar = m_aPageSize.Width() / nTextWidth;
+ aCharsPerLineNF.SetValue( nMaxChar );
+ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
}
//rubySize is disabled
}
GridModifyHdl(0);
return 0;
}
-/* -----------------------------22.04.2002 14:53------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton)
{
sal_Bool bEnable = &aNoGridRB != pButton;
@@ -489,6 +508,7 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton)
{
aCharsPerLineFT.Enable(sal_False);
aCharsPerLineNF.Enable(sal_False);
+ aCharsRangeFT.Enable(sal_False);
aCharWidthFT.Enable(sal_False);
aCharWidthMF.Enable(sal_False);
}
@@ -496,17 +516,13 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton)
GridModifyHdl(0);
return 0;
}
-/* -----------------------------22.04.2002 15:46------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage, DisplayGridHdl, CheckBox*, EMPTYARG)
{
aPrintCB.Enable(aDisplayCB.IsChecked());
return 0;
}
-/* -----------------------------08.02.2002 11:54------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage, GridModifyHdl, void*, EMPTYARG)
{
const SfxItemSet& rOldSet = GetItemSet();
@@ -519,3 +535,4 @@ IMPL_LINK(SwTextGridPage, GridModifyHdl, void*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/pggrid.hrc b/sw/source/ui/misc/pggrid.hrc
index e156792c955d..e736e5040dbb 100644
--- a/sw/source/ui/misc/pggrid.hrc
+++ b/sw/source/ui/misc/pggrid.hrc
@@ -50,3 +50,5 @@
#define CB_SNAPTOCHARS 23
#define FT_CHARWIDTH 24
#define MF_CHARWIDTH 25
+#define FT_LINERANGE 26
+#define FT_CHARRANGE 27
diff --git a/sw/source/ui/misc/pggrid.src b/sw/source/ui/misc/pggrid.src
index 9fb24c12029f..b226b4ce8bc8 100644
--- a/sw/source/ui/misc/pggrid.src
+++ b/sw/source/ui/misc/pggrid.src
@@ -102,6 +102,12 @@ TabPage TP_TEXTGRID_PAGE
Last = 154 ;
SpinSize = 1 ;
};
+ FixedText FT_LINERANGE
+ {
+ Pos = MAP_APPFONT ( 103 , 82 ) ;
+ Size = MAP_APPFONT ( 25 , 8 );
+ Text [ en-US ] = "( 1 - 48 )" ;
+ };
FixedText FT_TEXTSIZE
{
Pos = MAP_APPFONT ( 133 , 82 ) ;
@@ -174,6 +180,12 @@ TabPage TP_TEXTGRID_PAGE
Last = 5600 ;
SpinSize = 5 ;
};
+ FixedText FT_CHARRANGE
+ {
+ Pos = MAP_APPFONT ( 103 , 96 ) ;
+ Size = MAP_APPFONT ( 25 , 8 ) ;
+ Text [ en-US ] = "( 1 - 45 )" ;
+ };
FixedText FT_RUBYSIZE
{
Pos = MAP_APPFONT ( 133 , 98 ) ;
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index e1971af27497..eda3edec2789 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#define _SVSTDARR_STRINGSSORTDTOR
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
@@ -76,10 +76,6 @@
#include <IDocumentRedlineAccess.hxx>
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SFX_IMPL_MODELESSDIALOG( SwRedlineAcceptChild, FN_REDLINE_ACCEPT )
SV_IMPL_PTRARR(SwRedlineDataParentArr, SwRedlineDataParentPtr)
@@ -90,10 +86,6 @@ SV_IMPL_PTRARR(SvLBoxEntryArr, SvLBoxEntryPtr)
static sal_uInt16 nSortMode = 0xffff;
static sal_Bool bSortDir = sal_True;
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwRedlineAcceptChild::SwRedlineAcceptChild( Window* _pParent,
sal_uInt16 nId,
SfxBindings* pBindings,
@@ -106,23 +98,18 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( Window* _pParent,
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren
+ Description: newly initialise dialog after document switch
--------------------------------------------------------------------*/
-
sal_Bool SwRedlineAcceptChild::ReInitDlg(SwDocShell *pDocSh)
{
sal_Bool bRet;
- if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // Sofort aktualisieren, Dok-Wechsel
+ if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // update immediately, doc switch!
((SwModelessRedlineAcceptDlg*)GetWindow())->Activate();
return bRet;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings,
SwChildWinWrapper* pChild,
Window *_pParent) :
@@ -134,25 +121,21 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings,
FreeResource();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModelessRedlineAcceptDlg::Activate()
{
SwView *pView = ::GetActiveView();
- if (!pView) // Kann passieren, wenn man auf eine andere App umschaltet, wenn
- return; // vorher eine Listbox im Dialog den Focus hatte (eigentlich THs Bug)
+ if (!pView) // can happen when switching to another app, when a Listbox in dialog
+ return; // had the focus previously (actually THs Bug)
SwDocShell *pDocSh = pView->GetDocShell();
if (pChildWin->GetOldDocShell() != pDocSh)
- { // Dok-Wechsel
+ { // doc-switch
SwWait aWait( *pDocSh, sal_False );
SwWrtShell* pSh = pView->GetWrtShellPtr();
- pChildWin->SetOldDocShell(pDocSh); // Rekursion vermeiden (durch Modified-Hdl)
+ pChildWin->SetOldDocShell(pDocSh); // avoid recursion (using modified-Hdl)
sal_Bool bMod = pSh->IsModified();
SfxBoolItem aShow(FN_REDLINE_SHOW, sal_True);
@@ -168,10 +151,6 @@ void SwModelessRedlineAcceptDlg::Activate()
pImplDlg->Activate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModelessRedlineAcceptDlg::Initialize(SfxChildWinInfo *pInfo)
{
String aStr;
@@ -181,39 +160,23 @@ void SwModelessRedlineAcceptDlg::Initialize(SfxChildWinInfo *pInfo)
SfxModelessDialog::Initialize(pInfo);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModelessRedlineAcceptDlg::FillInfo(SfxChildWinInfo& rInfo) const
{
SfxModelessDialog::FillInfo(rInfo);
pImplDlg->FillInfo(rInfo.aExtraString);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwModelessRedlineAcceptDlg::Resize()
{
pImplDlg->Resize();
SfxModelessDialog::Resize();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg()
{
delete pImplDlg;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pParentDlg (pParent),
aTabPagesCTRL (pParent, SW_RES(CTRL_TABPAGES)),
@@ -253,7 +216,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pActLB->InsertEntry(sFmtCollSet);
pActLB->InsertEntry(sAutoFormat);
pTPView->ShowUndo(sal_True);
- pTPView->DisableUndo(); // Noch gibts keine UNDO-Events
+ pTPView->DisableUndo(); // no UNDO events yet
}
pActLB->SelectEntryPos(0);
@@ -270,7 +233,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pTable->SetTabs(aStaticTabs);
- // Minimalgroesse setzen
+ // set minimum size
Size aMinSz(aTabPagesCTRL.GetMinSizePixel());
Point aPos(aTabPagesCTRL.GetPosPixel());
@@ -291,27 +254,19 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pTable->SetDeselectHdl(LINK(this, SwRedlineAcceptDlg, DeselectHdl));
pTable->SetCommandHdl(LINK(this, SwRedlineAcceptDlg, CommandHdl));
- // Flackern der Buttons vermeiden:
+ // avoid flickering of buttons:
aDeselectTimer.SetTimeout(100);
aDeselectTimer.SetTimeoutHdl(LINK(this, SwRedlineAcceptDlg, SelectHdl));
- // Mehrfachselektion der selben Texte vermeiden:
+ // avoid multiple selection of the same texts:
aSelectTimer.SetTimeout(100);
aSelectTimer.SetTimeoutHdl(LINK(this, SwRedlineAcceptDlg, GotoHdl));
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwRedlineAcceptDlg::~SwRedlineAcceptDlg()
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
{
SwWait aWait( *::GetActiveView()->GetDocShell(), sal_False );
@@ -327,7 +282,7 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
aRedlineParents.DeleteAndDestroy(nStart, aRedlineParents.Count() - nStart);
}
- // Parents einfuegen
+ // insert parents
InsertParents(nStart);
InitAuthors();
@@ -338,10 +293,6 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
pTable->MakeVisible( pSelEntry, sal_True ); //#i70937#, force the scroll
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::InitAuthors()
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
@@ -361,7 +312,7 @@ void SwRedlineAcceptDlg::InitAuthors()
sal_Bool bIsNotFormated = sal_False;
sal_uInt16 i;
- // Autoren ermitteln
+ // determine authors
for ( i = 0; i < nCount; i++)
{
const SwRedline& rRedln = pSh->GetRedline(i);
@@ -369,10 +320,6 @@ void SwRedlineAcceptDlg::InitAuthors()
if( bOnlyFormatedRedlines && nsRedlineType_t::REDLINE_FORMAT != rRedln.GetType() )
bOnlyFormatedRedlines = sal_False;
-//JP 27.9.2001: make no sense if we handle readonly sections
-// if( !bHasReadonlySel && rRedln.HasReadonlySel() )
-// bHasReadonlySel = sal_True;
-
String *pAuthor = new String(rRedln.GetAuthorString());
if (!aStrings.Insert(pAuthor))
delete pAuthor;
@@ -411,10 +358,6 @@ void SwRedlineAcceptDlg::InitAuthors()
!bOnlyFormatedRedlines );
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
String SwRedlineAcceptDlg::GetRedlineText( const SwRedline& rRedln,
DateTime &rDateTime, sal_uInt16 nStack)
{
@@ -434,10 +377,6 @@ String SwRedlineAcceptDlg::GetRedlineText( const SwRedline& rRedln,
return sEntry;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
const String &SwRedlineAcceptDlg::GetActionText(const SwRedline& rRedln, sal_uInt16 nStack)
{
switch( rRedln.GetType(nStack) )
@@ -453,10 +392,6 @@ const String &SwRedlineAcceptDlg::GetActionText(const SwRedline& rRedln, sal_uIn
return aEmptyStr;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::Resize()
{
Size aSz(pParentDlg->GetOutputSizePixel());
@@ -470,9 +405,8 @@ void SwRedlineAcceptDlg::Resize()
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Aktivierung neu initialisieren
+ Description: newly initialise after activation
--------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::Activate()
{
// prevent update if flag is set (#102547#)
@@ -484,20 +418,14 @@ void SwRedlineAcceptDlg::Activate()
aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count());
- if (!pView) // Kann passieren, wenn man auf eine andere App umschaltet, wenn
- return; // vorher eine Listbox im Dialog den Focus hatte (eigentlich THs Bug)
-
-/* if (HasRedlineAutoFmt())
- {
- Init();
- return;
- }*/
+ if (!pView) // can happen when switching to another app, when a Listbox in the dialog
+ return; // had the focus previously (actually THs Bug)
- // Hat sich was geaendert?
+ // did something change?
SwWrtShell* pSh = pView->GetWrtShellPtr();
sal_uInt16 nCount = pSh->GetRedlineCount();
- // Anzahl und Pointer ueberpruefen
+ // check the number of pointers
SwRedlineDataParent *pParent = 0;
sal_uInt16 i;
@@ -507,7 +435,7 @@ void SwRedlineAcceptDlg::Activate()
if (i >= aRedlineParents.Count())
{
- // Neue Eintraege wurden angehaengt
+ // new entries have been appended
Init(i);
return;
}
@@ -515,7 +443,7 @@ void SwRedlineAcceptDlg::Activate()
pParent = aRedlineParents[i];
if (&rRedln.GetRedlineData() != pParent->pData)
{
- // Redline-Parents wurden eingefuegt, geaendert oder geloescht
+ // Redline-Parents were inserted, changed or deleted
if ((i = CalcDiff(i, sal_False)) == USHRT_MAX)
return;
continue;
@@ -526,7 +454,7 @@ void SwRedlineAcceptDlg::Activate()
if (!pRedlineData && pBackupData)
{
- // Redline-Childs wurden geloescht
+ // Redline-Childs were deleted
if ((i = CalcDiff(i, sal_True)) == USHRT_MAX)
return;
continue;
@@ -537,7 +465,7 @@ void SwRedlineAcceptDlg::Activate()
{
if (pRedlineData != pBackupData->pChild)
{
- // Redline-Childs wurden eingefuegt, geaendert oder geloescht
+ // Redline-Childs were inserted, changed or deleted
if ((i = CalcDiff(i, sal_True)) == USHRT_MAX)
return;
continue;
@@ -551,12 +479,12 @@ void SwRedlineAcceptDlg::Activate()
if (nCount != aRedlineParents.Count())
{
- // Redlines wurden am Ende geloescht
+ // Redlines were deleted at the end
Init(nCount);
return;
}
- // Kommentar ueberpruefen
+ // check comment
for (i = 0; i < nCount; i++)
{
const SwRedline& rRedln = pSh->GetRedline(i);
@@ -566,7 +494,7 @@ void SwRedlineAcceptDlg::Activate()
{
if (pParent->pTLBParent)
{
- // Nur Kommentar aktualisieren
+ // update only comment
String sComment(rRedln.GetComment());
sComment.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' ');
pTable->SetEntryText(sComment, pParent->pTLBParent, 3);
@@ -578,10 +506,6 @@ void SwRedlineAcceptDlg::Activate()
InitAuthors();
}
-/* -----------------05.06.98 13:06-------------------
- *
- * --------------------------------------------------*/
-
sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
{
if (!nStart)
@@ -597,9 +521,9 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
SwRedlineDataParent *pParent = aRedlineParents[nStart];
const SwRedline& rRedln = pSh->GetRedline(nStart);
- if (bChild) // Sollte eigentlich nie vorkommen, aber sicher ist sicher...
+ if (bChild) // should actually never happen, but just in case...
{
- // Alle Childs des Eintrags wegwerfen und neu initialisieren
+ // throw away all entry's childs and initialise newly
SwRedlineDataChildPtr pBackupData = (SwRedlineDataChildPtr)pParent->pNext;
SwRedlineDataChildPtr pNext;
@@ -614,28 +538,28 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
}
pParent->pNext = 0;
- // Neue Childs einfuegen
+ // insert new childs
InsertChilds(pParent, rRedln, nAutoFmt);
pTable->SetUpdateMode(sal_True);
return nStart;
}
- // Wurden Eintraege geloescht?
+ // have entries been deleted?
const SwRedlineData *pRedlineData = &rRedln.GetRedlineData();
sal_uInt16 i;
for ( i = nStart + 1; i < aRedlineParents.Count(); i++)
{
if (aRedlineParents[i]->pData == pRedlineData)
{
- // Eintraege von nStart bis i-1 entfernen
+ // remove entries from nStart to i-1
RemoveParents(nStart, i - 1);
pTable->SetUpdateMode(sal_True);
return nStart - 1;
}
}
- // Wurden Eintraege eingefuegt?
+ // entries been inserted?
sal_uInt16 nCount = pSh->GetRedlineCount();
pRedlineData = aRedlineParents[nStart]->pData;
@@ -643,7 +567,7 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
{
if (&pSh->GetRedline(i).GetRedlineData() == pRedlineData)
{
- // Eintraege von nStart bis i-1 einfuegen
+ // insert entries from nStart to i-1
InsertParents(nStart, i - 1);
pTable->SetUpdateMode(sal_True);
return nStart - 1;
@@ -651,14 +575,10 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
}
pTable->SetUpdateMode(sal_True);
- Init(nStart); // Alle Eintraege bis zum Ende abgleichen
+ Init(nStart); // adjust all entries until the end
return USHRT_MAX;
}
-/* -----------------05.06.98 13:57-------------------
- *
- * --------------------------------------------------*/
-
void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedline& rRedln, const sal_uInt16 nAutoFmt)
{
String sChild;
@@ -673,7 +593,7 @@ void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedl
{
sal_uInt16 nPos;
- if (pParent->pData->GetSeqNo() && !aUsedSeqNo.Insert(pParent, nPos)) // Gibts schon
+ if (pParent->pData->GetSeqNo() && !aUsedSeqNo.Insert(pParent, nPos)) // already there
{
if (pParent->pTLBParent)
{
@@ -738,10 +658,6 @@ void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedl
}
}
-/* -----------------05.06.98 15:20-------------------
- *
- * --------------------------------------------------*/
-
void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
@@ -749,14 +665,14 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
SvLBoxEntryArr aLBoxArr;
- // Wegen Bug der TLB, die bei Remove den SelectHandler IMMER ruft:
+ // because of Bug of TLB that ALWAYS calls the SelectHandler at Remove:
pTable->SetSelectHdl(aOldSelectHdl);
pTable->SetDeselectHdl(aOldDeselectHdl);
sal_Bool bChildsRemoved = sal_False;
pTable->SelectAll(sal_False);
- // Hinter dem letzten Eintrag Cursor setzen, da sonst Performance-Problem in TLB.
- // TLB wuerde sonst bei jedem Remove den Cursor erneut umsetzen (teuer)
+ // set the cursor after the last entry because otherwise performance problem in TLB.
+ // TLB would otherwise reset the cursor at every Remove (expensive)
sal_uInt16 nPos = Min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.Count());
SvLBoxEntry *pCurEntry = NULL;
while( ( pCurEntry == NULL ) && ( nPos > 0 ) )
@@ -803,23 +719,19 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
}
}
- // TLB von hinten abraeumen
+ // clear TLB from behind
long nIdx = (long)aLBoxArr.Count() - 1L;
while (nIdx >= 0)
pTable->RemoveEntry(aLBoxArr[ static_cast< sal_uInt16 >(nIdx--) ]);
pTable->SetSelectHdl(LINK(this, SwRedlineAcceptDlg, SelectHdl));
pTable->SetDeselectHdl(LINK(this, SwRedlineAcceptDlg, DeselectHdl));
- // Durch Remove wurde leider wieder dauernd von der TLB selektiert...
+ // unfortunately by Remove it was selected from the TLB always again ...
pTable->SelectAll(sal_False);
aRedlineParents.DeleteAndDestroy( nStart, nEnd - nStart + 1);
}
-/* -----------------05.06.98 15:20-------------------
- *
- * --------------------------------------------------*/
-
void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
{
SwView *pView = ::GetActiveView();
@@ -828,10 +740,10 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
String sParent;
sal_uInt16 nCount = pSh->GetRedlineCount();
- nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // Handelt auch nEnd=USHRT_MAX (bis zum Ende) ab
+ nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end)
if (nEnd == USHRT_MAX)
- return; // Keine Redlines im Dokument
+ return; // no redlines in the document
RedlinData *pData;
SvLBoxEntry *pParent;
@@ -883,10 +795,6 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
}
}
-/* -----------------05.06.98 13:06-------------------
- *
- * --------------------------------------------------*/
-
void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept )
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
@@ -897,7 +805,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept )
ListBoxEntries_t aRedlines;
// don't activate
- DBG_ASSERT( bInhibitActivate == false,
+ OSL_ENSURE( bInhibitActivate == false,
"recursive call of CallAcceptReject?");
bInhibitActivate = true;
@@ -951,7 +859,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept )
ListBoxEntries_t::iterator aEnd = aRedlines.end();
for( ListBoxEntries_t::iterator aIter = aRedlines.begin();
aIter != aEnd;
- aIter++ )
+ ++aIter )
{
sal_uInt16 nPosition = GetRedlinePos( **aIter );
if( nPosition != USHRT_MAX )
@@ -986,10 +894,6 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept )
pTPView->EnableUndo();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvLBoxEntry& rEntry ) const
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
@@ -997,50 +901,30 @@ sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvLBoxEntry& rEntry ) const
rEntry.GetUserData())->pData)->pData );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, AcceptHdl, void*, EMPTYARG)
{
CallAcceptReject( sal_True, sal_True );
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, AcceptAllHdl, void*, EMPTYARG )
{
CallAcceptReject( sal_False, sal_True );
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, RejectHdl, void*, EMPTYARG )
{
CallAcceptReject( sal_True, sal_False );
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, RejectAllHdl, void*, EMPTYARG )
{
CallAcceptReject( sal_False, sal_False );
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, UndoHdl, void*, EMPTYARG )
{
SwView * pView = ::GetActiveView();
@@ -1053,10 +937,6 @@ IMPL_LINK( SwRedlineAcceptDlg, UndoHdl, void*, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, FilterChangedHdl, void*, EMPTYARG )
{
SvxTPFilter *pFilterTP = aTabPagesCTRL.GetFilterPage();
@@ -1071,22 +951,14 @@ IMPL_LINK( SwRedlineAcceptDlg, FilterChangedHdl, void*, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, DeselectHdl, void*, EMPTYARG )
{
- // Flackern der Buttons vermeiden:
+ // avoid flickering of buttons:
aDeselectTimer.Start();
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, SelectHdl, void*, EMPTYARG )
{
aDeselectTimer.Stop();
@@ -1095,10 +967,6 @@ IMPL_LINK( SwRedlineAcceptDlg, SelectHdl, void*, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
@@ -1106,7 +974,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
sal_Bool bIsNotFormated = sal_False;
sal_Bool bSel = sal_False;
-// sal_Bool bReadonlySel = sal_False;
//#98883# don't select redlines while the dialog is not focussed
//#107938# But not only ask pTable if it has the focus. To move
@@ -1133,7 +1000,7 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
if (pTable->IsSelected(pActEntry))
{
pSelEntry = pActEntry = pTable->NextSelected(pSelEntry);
- continue; // Nicht zweimal selektieren
+ continue; // don't select twice
}
}
else
@@ -1147,10 +1014,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
const SwRedline& rRedln = pSh->GetRedline( nPos );
bIsNotFormated |= nsRedlineType_t::REDLINE_FORMAT != rRedln.GetType();
-//JP 27.9.2001: make no sense if we handle readonly sections
-// if( !bReadonlySel && rRedln.HasReadonlySel() )
-// bReadonlySel = sal_True;
-
if (pSh->GotoRedline(nPos, sal_True))
{
pSh->SetInSelect();
@@ -1173,10 +1036,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
{
const CommandEvent aCEvt(pTable->GetCommandEvent());
@@ -1198,7 +1057,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
sal_uInt16 nPos = GetRedlinePos(*pTopEntry);
- // Bei geschuetzten Bereichen kommentieren disablen
+ // disable commenting for protected areas
if ((pRed = pSh->GotoRedline(nPos, sal_True)) != 0)
{
if( pSh->IsCrsrPtAtEnd() )
@@ -1246,16 +1105,16 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
/* enable again once we have redline comments in the margin
sComment = rRedline.GetComment();
- if ( sComment == String(::rtl::OUString::createFromAscii("")) )
+ if ( !sComment.Len() )
GetActiveView()->GetDocShell()->Broadcast(SwRedlineHint(&rRedline,SWREDLINE_INSERTED));
const_cast<SwRedline&>(rRedline).Broadcast(SwRedlineHint(&rRedline,SWREDLINE_FOCUS));
*/
sComment = rRedline.GetComment();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT );
- DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
+ OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()");
SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() );
aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT));
@@ -1266,7 +1125,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
SID_ATTR_POSTIT_DATE ));
AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, aSet, sal_False );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->HideAuthor();
@@ -1299,7 +1158,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
String sMsg(((const SvxPostItTextItem&)pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
- // Kommentar einfuegen bzw aendern
+ // insert / change comment
pSh->SetRedlineComment(sMsg);
sMsg.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' ');
pTable->SetEntryText(sMsg, pEntry, 3);
@@ -1320,11 +1179,11 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
{
bSortDir = sal_True;
if (nRet - MN_SORT_ACTION == 4 && pTable->GetSortedCol() == 0xffff)
- break; // Haben wir schon
+ break; // we already have it
nSortMode = nRet - MN_SORT_ACTION;
if (nSortMode == 4)
- nSortMode = 0xffff; // unsortiert bzw sortiert nach Position
+ nSortMode = 0xffff; // unsorted / sorted by position
if (pTable->GetSortedCol() == nSortMode)
bSortDir = !pTable->GetSortDirection();
@@ -1332,7 +1191,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
SwWait aWait( *::GetActiveView()->GetDocShell(), sal_False );
pTable->SortByCol(nSortMode, bSortDir);
if (nSortMode == 0xffff)
- Init(); // Alles neu fuellen
+ Init(); // newly fill everything
}
break;
}
@@ -1343,18 +1202,14 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::Initialize(const String& rExtraData)
{
if (rExtraData.Len())
{
sal_uInt16 nPos = rExtraData.Search(C2S("AcceptChgDat:"));
- // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
- // er nicht vorhanden ist, liegt eine "altere Version vor
+ // try to read the alignment string "ALIGN:(...)"; if none existing,
+ // it's an old version
if (nPos != STRING_NOTFOUND)
{
sal_uInt16 n1 = rExtraData.Search('(', nPos);
@@ -1363,7 +1218,7 @@ void SwRedlineAcceptDlg::Initialize(const String& rExtraData)
sal_uInt16 n2 = rExtraData.Search(')', n1);
if (n2 != STRING_NOTFOUND)
{
- // Alignment-String herausschneiden
+ // cut out the alignment string
String aStr = rExtraData.Copy(nPos, n2 - nPos + 1);
aStr.Erase(0, n1 - nPos + 1);
@@ -1384,10 +1239,6 @@ void SwRedlineAcceptDlg::Initialize(const String& rExtraData)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwRedlineAcceptDlg::FillInfo(String &rExtraData) const
{
rExtraData.AppendAscii("AcceptChgDat:(");
@@ -1403,3 +1254,5 @@ void SwRedlineAcceptDlg::FillInfo(String &rExtraData) const
}
rExtraData += ')';
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/redlndlg.src b/sw/source/ui/misc/redlndlg.src
index 39418495363c..861b1b4c3fe5 100644
--- a/sw/source/ui/misc/redlndlg.src
+++ b/sw/source/ui/misc/redlndlg.src
@@ -52,7 +52,6 @@
ModelessDialog DLG_REDLINE_ACCEPT
{
HelpID = HID_REDLINE_ACCEPT ;
- /* ### ACHTUNG: Neuer Text in Resource? Änderungen akzeptieren oder verwerfen : Redlining */
Text [ en-US ] = "Accept or Reject Changes" ;
REDLNDLG
};
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index 678b0c917e3c..80276381f9bb 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include "srtdlg.hxx"
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <sfx2/dispatch.hxx>
@@ -86,7 +85,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using ::rtl::OUString;
-
void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox )
{
void* pDel;
@@ -97,11 +95,8 @@ void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox )
}
/*--------------------------------------------------------------------
- Beschreibung: Fuer Tabellenselektion sel. Zeilen und Spalten
- feststellen
+ Description: determine lines and columns for table selection
--------------------------------------------------------------------*/
-
-
sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
{
const SwTableNode* pTblNd = rSh.IsCrsrInTbl();
@@ -110,7 +105,7 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
_FndBox aFndBox( 0, 0 );
- // suche alle Boxen / Lines
+ // look for all boxes / lines
{
SwSelBoxes aSelBoxes;
::GetTblSel( rSh, aSelBoxes );
@@ -127,9 +122,8 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
}
/*--------------------------------------------------------------------
- Beschreibung: Init-Liste
+ Description: init list
--------------------------------------------------------------------*/
-
SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
SvxStandardDialog(pParent, SW_RES(DLG_SORTING)),
@@ -217,7 +211,7 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aColLbl.SetText(aColTxt);
}
- // Initialisieren
+ // initialise
Link aLk = LINK(this,SwSortDlg, CheckHdl);
aKeyCB1.SetClickHdl( aLk );
aKeyCB2.SetClickHdl( aLk );
@@ -318,12 +312,11 @@ sal_Unicode SwSortDlg::GetDelimChar() const
}
/*--------------------------------------------------------------------
- Beschreibung: An die Core weiterreichen
+ Description: pass on to the Core
--------------------------------------------------------------------*/
void SwSortDlg::Apply()
{
- // Alte Einstellung speichern
- //
+ // save all settings
bCheck1 = aKeyCB1.IsChecked();
bCheck2 = aKeyCB2.IsChecked();
bCheck3 = aKeyCB3.IsChecked();
@@ -407,9 +400,6 @@ void SwSortDlg::Apply()
InfoBox( this->GetParent(), SW_RES(MSG_SRTERR)).Execute();
}
-/* -----------------30.09.98 10:03-------------------
- *
- * --------------------------------------------------*/
IMPL_LINK( SwSortDlg, DelimHdl, RadioButton*, pButton )
{
sal_Bool bEnable = pButton == &aDelimFreeRB && aDelimFreeRB.IsEnabled();
@@ -439,7 +429,6 @@ IMPL_LINK( SwSortDlg, DelimCharHdl, PushButton*, EMPTYARG )
return 0;
}
-
IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
{
if( pCheck == ( CheckBox* ) &aRowRB)
@@ -525,8 +514,4 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox )
return 0;
}
-
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/srtdlg.src b/sw/source/ui/misc/srtdlg.src
index 5bfbc4600e10..90ce866a3b20 100644
--- a/sw/source/ui/misc/srtdlg.src
+++ b/sw/source/ui/misc/srtdlg.src
@@ -68,7 +68,6 @@ ModalDialog DLG_SORTING
{
Pos = MAP_APPFONT ( 101, 12 ) ;
Size = MAP_APPFONT ( 48 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Schlüsseltyp : Schl³sseltyp */
Text [ en-US ] = "Key type" ;
Left = TRUE ;
};
@@ -83,7 +82,6 @@ ModalDialog DLG_SORTING
HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY1";
Pos = MAP_APPFONT ( 12 , 25 ) ;
Size = MAP_APPFONT ( 49 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~1 : Schl³ssel ~1 */
Text [ en-US ] = "Key ~1" ;
Check = TRUE ;
};
@@ -141,7 +139,6 @@ ModalDialog DLG_SORTING
HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY2";
Pos = MAP_APPFONT ( 12 , 52 ) ;
Size = MAP_APPFONT ( 49 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~2 : Schl³ssel ~2 */
Text [ en-US ] = "Key ~2" ;
};
NumericField ED_KEY2
@@ -193,7 +190,6 @@ ModalDialog DLG_SORTING
HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY3";
Pos = MAP_APPFONT ( 12 , 81 ) ;
Size = MAP_APPFONT ( 49 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Schlüssel ~3 : Schl³ssel ~3 */
Text [ en-US ] = "Key ~3" ;
};
NumericField ED_KEY3
diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
index 08ac516e4b31..ee0e25e80e97 100644
--- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
+++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,16 +35,13 @@
#define _SVSTDARR_STRINGSSORTDTOR
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
#include <redline.hxx>
#include <tools/datetime.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SVSTDARR_HXX
#include <svl/svstdarr.hxx>
-#endif
#include <svl/eitem.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
@@ -51,28 +49,16 @@
#include <svx/postattr.hxx>
#include <swtypes.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <swmodule.hxx>
#include <swwait.hxx>
#include <uitool.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _REDLNDLG_HRC
#include <redlndlg.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
#include <vector>
#ifndef _REDLNDLG_HXX
@@ -83,52 +69,35 @@
#include <unomid.h>
-
SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) :
SfxModalDialog(pParent, SW_RES(DLG_MOD_REDLINE_ACCEPT))
{
pImplDlg = new SwRedlineAcceptDlg(this, sal_True);
pImplDlg->Initialize(GetExtraData());
- pImplDlg->Activate(); // Zur Initialisierung der Daten
+ pImplDlg->Activate(); // for data's initialisation
FreeResource();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg()
{
- AcceptAll(sal_False); // Alles uebriggebliebene ablehnen
+ AcceptAll(sal_False); // refuse everything remaining
pImplDlg->FillInfo(GetExtraData());
delete pImplDlg;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwModalRedlineAcceptDlg::Activate()
{
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwModalRedlineAcceptDlg::Resize()
{
pImplDlg->Resize();
SfxModalDialog::Resize();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
{
SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage();
@@ -136,7 +105,7 @@ void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
pFilterTP->IsRange() || pFilterTP->IsAction())
{
- pFilterTP->CheckDate(sal_False); // Alle Filter abschalten
+ pFilterTP->CheckDate(sal_False); // turn off all filters
pFilterTP->CheckAuthor(sal_False);
pFilterTP->CheckRange(sal_False);
pFilterTP->CheckAction(sal_False);
@@ -145,3 +114,5 @@ void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
pImplDlg->CallAcceptReject( sal_False, bAccept );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
new file mode 100644
index 000000000000..f41bc49c9d63
--- /dev/null
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -0,0 +1,367 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+#ifdef SW_DLLIMPLEMENTATION
+#undef SW_DLLIMPLEMENTATION
+#endif
+
+#include <sfx2/viewfrm.hxx>
+#include <vcl/msgbox.hxx>
+#include <view.hxx>
+#include <swmodule.hxx>
+#include <wrtsh.hxx>
+#include <poolfmt.hxx>
+#include <docsh.hxx>
+#include <charfmt.hxx>
+#include <docstyle.hxx>
+
+#include "fldbas.hxx"
+#include "lineinfo.hxx"
+#include "globals.hrc"
+#include "titlepage.hrc"
+#include "titlepage.hxx"
+#include "uitool.hxx"
+#include "fmtpdsc.hxx"
+#include "pagedesc.hxx"
+
+#include <IDocumentStylePoolAccess.hxx>
+
+namespace
+{
+ bool lcl_GetPageDesc(SwWrtShell *pSh, sal_uInt16 &rPageNo, const SwFmtPageDesc **ppPageFmtDesc)
+ {
+ bool bRet = false;
+ SfxItemSet aSet( pSh->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC );
+ if (pSh->GetCurAttr( aSet ))
+ {
+ const SfxPoolItem* pItem(0);
+ if (SFX_ITEM_SET == aSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) && pItem)
+ {
+ rPageNo = ((const SwFmtPageDesc *)pItem)->GetNumOffset();
+ if (ppPageFmtDesc)
+ (*ppPageFmtDesc) = (const SwFmtPageDesc *)(pItem->Clone());
+ bRet = true;
+ }
+ }
+ return bRet;
+ }
+
+ bool lcl_SkipNPages(SwWrtShell *pSh, sal_uInt16 nNoPages)
+ {
+ bool bAllOk = true;
+ for (sal_uInt16 nI = 0; nI < nNoPages && bAllOk; ++nI)
+ bAllOk = pSh->SttNxtPg();
+ return bAllOk;
+ }
+
+ void lcl_ChangePage(SwWrtShell *pSh, sal_uInt16 nNewNumber,
+ const SwPageDesc *pNewDesc)
+ {
+ const sal_uInt16 nCurIdx = pSh->GetCurPageDesc();
+ const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx );
+
+ const SwFmtPageDesc *pPageFmtDesc(0);
+ sal_uInt16 nDontCare;
+ lcl_GetPageDesc(pSh, nDontCare, &pPageFmtDesc);
+
+ //If we want a new number then set it, otherwise reuse the existing one
+ sal_uInt16 nPgNo = nNewNumber ?
+ nNewNumber : ( pPageFmtDesc ? pPageFmtDesc->GetNumOffset() : 0 );
+
+ //If we want a new descriptior then set it, otherwise reuse the existing one
+ if (!pNewDesc)
+ {
+ SwFmtPageDesc aPageFmtDesc(pPageFmtDesc ? *pPageFmtDesc : &rCurrentDesc);
+ if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
+ pSh->SetAttr(aPageFmtDesc);
+ }
+ else
+ {
+ SwFmtPageDesc aPageFmtDesc(pNewDesc);
+ if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
+ pSh->SetAttr(aPageFmtDesc);
+ }
+
+ delete pPageFmtDesc;
+ }
+
+ void lcl_PushCursor(SwWrtShell *pSh)
+ {
+ pSh->LockView( sal_True );
+ pSh->StartAllAction();
+ pSh->SwCrsrShell::Push();
+ }
+
+ void lcl_PopCursor(SwWrtShell *pSh)
+ {
+ pSh->SwCrsrShell::Pop( sal_False );
+ pSh->EndAllAction();
+ pSh->LockView( sal_False );
+ }
+
+ sal_uInt16 lcl_GetCurrentPage(SwWrtShell *pSh)
+ {
+ String sDummy;
+ sal_uInt16 nPhyNum=1, nVirtNum=1;
+ pSh->GetPageNumber(0, true, nPhyNum, nVirtNum, sDummy);
+ return nPhyNum;
+ }
+}
+
+/*
+ * Only include the Index page in the list if the page count implies one
+ * to reduce confusing things
+ */
+void SwTitlePageDlg::FillList()
+{
+ sal_uInt16 nTitlePages = aPageCountNF.GetValue();
+ aPagePropertiesLB.Clear();
+ if (mpTitleDesc)
+ aPagePropertiesLB.InsertEntry(mpTitleDesc->GetName());
+ if (nTitlePages > 1 && mpIndexDesc)
+ aPagePropertiesLB.InsertEntry(mpIndexDesc->GetName());
+ if (mpNormalDesc)
+ aPagePropertiesLB.InsertEntry(mpNormalDesc->GetName());
+ aPagePropertiesLB.SelectEntryPos(0);
+}
+
+sal_uInt16 SwTitlePageDlg::GetInsertPosition() const
+{
+ sal_uInt16 nPage = 1;
+ if (aPageStartNF.IsEnabled())
+ nPage = aPageStartNF.GetValue();
+ return nPage;
+}
+
+SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
+ SfxModalDialog( pParent, SW_RES(DLG_TITLEPAGE) ),
+#ifdef MSC
+#pragma warning (disable : 4355)
+#endif
+ aMakeInsertFL ( this, SW_RES( FL_MAKEINSERT )),
+ aUseExistingPagesRB ( this, SW_RES( RB_USE_EXISTING_PAGES )),
+ aInsertNewPagesRB ( this, SW_RES( RB_INSERT_NEW_PAGES )),
+ aPageCountFT ( this, SW_RES( FT_PAGE_COUNT )),
+ aPageCountNF ( this, SW_RES( NF_PAGE_COUNT )),
+ aPagePagesFT ( this, SW_RES( FT_PAGE_PAGES )),
+ aPageStartFT ( this, SW_RES( FT_PAGE_START )),
+ aDocumentStartRB ( this, SW_RES( RB_DOCUMENT_START )),
+ aPageStartRB ( this, SW_RES( RB_PAGE_START )),
+ aPageStartNF ( this, SW_RES( NF_PAGE_START )),
+ aNumberingFL ( this, SW_RES( FL_NUMBERING )),
+ aRestartNumberingCB ( this, SW_RES( CB_RESTART_NUMBERING )),
+ aRestartNumberingFT ( this, SW_RES( FT_RESTART_NUMBERING )),
+ aRestartNumberingNF ( this, SW_RES( NF_RESTART_NUMBERING )),
+ aSetPageNumberCB ( this, SW_RES( CB_SET_PAGE_NUMBER )),
+ aSetPageNumberFT ( this, SW_RES( FT_SET_PAGE_NUMBER )),
+ aSetPageNumberNF ( this, SW_RES( NF_SET_PAGE_NUMBER )),
+ aPagePropertiesFL ( this, SW_RES( FL_PAGE_PROPERTIES )),
+ aPagePropertiesLB ( this, SW_RES( LB_PAGE_PROPERTIES )),
+ aPagePropertiesPB ( this, SW_RES( PB_PAGE_PROPERTIES )),
+ aBottomFL ( this, SW_RES( FL_BOTTOM )),
+ aOkPB ( this, SW_RES( PB_OK )),
+ aCancelPB ( this, SW_RES( PB_CANCEL )),
+ aHelpPB ( this, SW_RES( PB_HELP )),
+ mpPageFmtDesc (0)
+#ifdef MSC
+#pragma warning (default : 4355)
+#endif
+{
+ FreeResource();
+
+ aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
+ aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
+ aSetPageNumberCB.SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
+
+ sal_uInt16 nSetPage = 1;
+ sal_uInt16 nResetPage = 1;
+ sal_uInt16 nTitlePages = 1;
+ mpSh = ::GetActiveView()->GetWrtShellPtr();
+ lcl_PushCursor(mpSh);
+
+ SwView& rView = mpSh->GetView();
+ rView.InvalidateRulerPos();
+
+ bool bMaybeResetNumbering = false;
+
+ mpTitleDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_FIRST);
+ mpIndexDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_REGISTER);
+ mpNormalDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_STANDARD);
+
+ mpSh->SttDoc();
+ if (lcl_GetPageDesc( mpSh, nSetPage, &mpPageFmtDesc ))
+ {
+ if (mpPageFmtDesc->GetPageDesc() == mpTitleDesc)
+ {
+ while (mpSh->SttNxtPg())
+ {
+ const sal_uInt16 nCurIdx = mpSh->GetCurPageDesc();
+ const SwPageDesc &rPageDesc = mpSh->GetPageDesc( nCurIdx );
+
+ if (mpIndexDesc != &rPageDesc)
+ {
+ mpNormalDesc = &rPageDesc;
+ bMaybeResetNumbering = lcl_GetPageDesc(mpSh, nResetPage, NULL);
+ break;
+ }
+ ++nTitlePages;
+ }
+ }
+ }
+ lcl_PopCursor(mpSh);
+
+ aUseExistingPagesRB.Check();
+ aPageCountNF.SetValue(nTitlePages);
+ aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
+ aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
+
+ aDocumentStartRB.Check();
+ aPageStartNF.Enable(false);
+ aPageStartNF.SetValue(lcl_GetCurrentPage(mpSh));
+ Link aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
+ aDocumentStartRB.SetClickHdl(aStartPageHdl);
+ aPageStartRB.SetClickHdl(aStartPageHdl);
+
+ if (bMaybeResetNumbering && nResetPage > 0)
+ {
+ aRestartNumberingCB.Check();
+ aRestartNumberingNF.SetValue(nResetPage);
+ }
+ aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
+
+ aSetPageNumberNF.SetValue(nSetPage);
+ if (nSetPage > 1)
+ aSetPageNumberCB.Check();
+ aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
+
+ FillList();
+ aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
+}
+
+IMPL_LINK(SwTitlePageDlg, UpHdl, NumericField *, EMPTYARG)
+{
+ if (aPageCountNF.GetValue() == 2)
+ FillList();
+ return 0;
+}
+
+IMPL_LINK(SwTitlePageDlg, DownHdl, NumericField *, EMPTYARG)
+{
+ if (aPageCountNF.GetValue() == 1)
+ FillList();
+ return 0;
+}
+
+IMPL_LINK(SwTitlePageDlg, RestartNumberingHdl, CheckBox*, EMPTYARG)
+{
+ aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
+ return 0;
+}
+
+IMPL_LINK(SwTitlePageDlg, SetPageNumberHdl, CheckBox*, EMPTYARG)
+{
+ aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
+ return 0;
+}
+
+IMPL_LINK(SwTitlePageDlg, StartPageHdl, RadioButton*, EMPTYARG)
+{
+ aPageStartNF.Enable(aPageStartRB.IsChecked());
+ return 0;
+}
+
+SwTitlePageDlg::~SwTitlePageDlg()
+{
+ delete mpPageFmtDesc;
+}
+
+IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
+{
+ SwView& rView = mpSh->GetView();
+ rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, mpSh);
+ rView.InvalidateRulerPos();
+
+ return 0;
+}
+
+IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
+{
+ lcl_PushCursor(mpSh);
+
+ mpSh->StartUndo();
+
+ SwFmtPageDesc aTitleDesc(mpTitleDesc);
+
+ if (aSetPageNumberCB.IsChecked())
+ aTitleDesc.SetNumOffset(aSetPageNumberNF.GetValue());
+ else if (mpPageFmtDesc)
+ aTitleDesc.SetNumOffset(mpPageFmtDesc->GetNumOffset());
+
+ sal_uInt16 nNoPages = aPageCountNF.GetValue();
+ if (!aUseExistingPagesRB.IsChecked())
+ {
+ mpSh->GotoPage(GetInsertPosition(), false);
+ for (sal_uInt16 nI=0; nI < nNoPages; ++nI)
+ mpSh->InsertPageBreak();
+ }
+
+ mpSh->GotoPage(GetInsertPosition(), false);
+ for (sal_uInt16 nI=1; nI < nNoPages; ++nI)
+ {
+ if (mpSh->SttNxtPg())
+ lcl_ChangePage(mpSh, 0, mpIndexDesc);
+ }
+
+ mpSh->GotoPage(GetInsertPosition(), false);
+ mpSh->SetAttr(aTitleDesc);
+
+ if (nNoPages > 1 && mpSh->GotoPage(GetInsertPosition() + nNoPages, false))
+ {
+ SwFmtPageDesc aPageFmtDesc(mpNormalDesc);
+ mpSh->SetAttr(aPageFmtDesc);
+ }
+
+ if (aRestartNumberingCB.IsChecked() || nNoPages > 1)
+ {
+ sal_uInt16 nPgNo = aRestartNumberingCB.IsChecked() ? aRestartNumberingNF.GetValue() : 0;
+ const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : 0;
+ mpSh->GotoPage(GetInsertPosition() + nNoPages, false);
+ lcl_ChangePage(mpSh, nPgNo, pNewDesc);
+ }
+
+ mpSh->EndUndo();
+ lcl_PopCursor(mpSh);
+ if (!aUseExistingPagesRB.IsChecked())
+ mpSh->GotoPage(GetInsertPosition(), false);
+ EndDialog( RET_OK );
+ return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/titlepage.hrc b/sw/source/ui/misc/titlepage.hrc
new file mode 100644
index 000000000000..63678427cfca
--- /dev/null
+++ b/sw/source/ui/misc/titlepage.hrc
@@ -0,0 +1,50 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#define FL_MAKEINSERT 1
+#define RB_USE_EXISTING_PAGES 2
+#define RB_INSERT_NEW_PAGES 3
+#define FT_PAGE_COUNT 4
+#define NF_PAGE_COUNT 5
+#define FT_PAGE_PAGES 6
+#define FT_PAGE_START 7
+#define RB_DOCUMENT_START 8
+#define RB_PAGE_START 9
+#define NF_PAGE_START 10
+#define FL_NUMBERING 11
+#define CB_RESTART_NUMBERING 12
+#define FT_RESTART_NUMBERING 13
+#define NF_RESTART_NUMBERING 14
+#define CB_SET_PAGE_NUMBER 15
+#define FT_SET_PAGE_NUMBER 16
+#define NF_SET_PAGE_NUMBER 17
+#define FL_PAGE_PROPERTIES 18
+#define LB_PAGE_PROPERTIES 19
+#define PB_PAGE_PROPERTIES 20
+#define FL_BOTTOM 21
+#define PB_OK 22
+#define PB_CANCEL 23
+#define PB_HELP 24
diff --git a/sw/source/ui/misc/titlepage.src b/sw/source/ui/misc/titlepage.src
new file mode 100644
index 000000000000..1f61be16144a
--- /dev/null
+++ b/sw/source/ui/misc/titlepage.src
@@ -0,0 +1,244 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "misc.hrc"
+#include "titlepage.hrc"
+#include "globals.hrc"
+#include "cmdid.h"
+#include "helpid.h"
+
+ModalDialog DLG_TITLEPAGE
+{
+ HelpID = HID_TITLEPAGE ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 216 , 229 ) ;
+ Text [ en-US ] = "Title Pages" ;
+ Moveable = TRUE ;
+
+ FixedLine FL_MAKEINSERT
+ {
+ Pos = MAP_APPFONT ( 6 , 5 ) ;
+ Size = MAP_APPFONT ( 204 , 8 ) ;
+ Text [ en-US ] = "Make Title Pages" ;
+ Text [ x-comment ] = " ";
+ };
+ RadioButton RB_USE_EXISTING_PAGES
+ {
+ Pos = MAP_APPFONT ( 12 , 18 ) ;
+ Size = MAP_APPFONT ( 198 , 10 ) ;
+ Text [ en-US ] = "Convert existing pages to title pages" ;
+ TabStop = TRUE ;
+ Check = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ RadioButton RB_INSERT_NEW_PAGES
+ {
+ Pos = MAP_APPFONT ( 12 , 34 ) ;
+ Size = MAP_APPFONT ( 198 , 10 ) ;
+ Text [ en-US ] = "Insert new title pages" ;
+ Text [ x-comment ] = " ";
+ };
+ FixedText FT_PAGE_COUNT
+ {
+ Pos = MAP_APPFONT ( 12 , 50 ) ;
+ Size = MAP_APPFONT ( 82 , 8 ) ;
+ Text [ en-US ] = "Number of title pages" ;
+ Text [ x-comment ] = " ";
+ };
+ NumericField NF_PAGE_COUNT
+ {
+ Pos = MAP_APPFONT ( 100 , 50 ) ;
+ Size = MAP_APPFONT ( 30 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 65535;
+ First = 1 ;
+ Last = 65535;
+ SpinSize = 1 ;
+ };
+ FixedText FT_PAGE_PAGES
+ {
+ Pos = MAP_APPFONT ( 136 , 50 ) ;
+ Size = MAP_APPFONT ( 80 , 10 ) ;
+ Text [ en-US ] = "pages" ;
+ Text [ x-comment ] = " ";
+ };
+ FixedText FT_PAGE_START
+ {
+ Pos = MAP_APPFONT ( 12 , 66 ) ;
+ Size = MAP_APPFONT ( 82 , 8 ) ;
+ Text [ en-US ] = "Place title pages at" ;
+ Text [ x-comment ] = " ";
+ };
+ RadioButton RB_DOCUMENT_START
+ {
+ Pos = MAP_APPFONT ( 100 , 66 ) ;
+ Size = MAP_APPFONT ( 110 , 10 ) ;
+ Text [ en-US ] = "Document Start" ;
+ TabStop = TRUE ;
+ Check = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ RadioButton RB_PAGE_START
+ {
+ Pos = MAP_APPFONT ( 100 , 78 ) ;
+ Size = MAP_APPFONT ( 30 , 10 ) ;
+ Text [ en-US ] = "Page" ;
+ Text [ x-comment ] = " ";
+ };
+ NumericField NF_PAGE_START
+ {
+ Pos = MAP_APPFONT ( 131 , 78 ) ;
+ Size = MAP_APPFONT ( 30 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 65535;
+ First = 1 ;
+ Last = 65535;
+ SpinSize = 1 ;
+ };
+ FixedLine FL_NUMBERING
+ {
+ Pos = MAP_APPFONT ( 6 , 98 ) ;
+ Size = MAP_APPFONT ( 204 , 8 ) ;
+ Text [ en-US ] = "Page Numbering" ;
+ Text [ x-comment ] = " ";
+ };
+ CheckBox CB_RESTART_NUMBERING
+ {
+ Pos = MAP_APPFONT ( 12, 111 ) ;
+ Size = MAP_APPFONT ( 198 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Reset Page Numbering after title pages" ;
+ Text [ x-comment ] = " ";
+ };
+ FixedText FT_RESTART_NUMBERING
+ {
+ Pos = MAP_APPFONT ( 20 , 125 ) ;
+ Size = MAP_APPFONT ( 74 , 10 ) ;
+ Text [ en-US ] = "Page Number" ;
+ Text [ x-comment ] = " ";
+ };
+ NumericField NF_RESTART_NUMBERING
+ {
+ Pos = MAP_APPFONT ( 100 , 125 ) ;
+ Size = MAP_APPFONT ( 30 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 65535;
+ First = 1 ;
+ Last = 65535;
+ SpinSize = 1 ;
+ };
+ CheckBox CB_SET_PAGE_NUMBER
+ {
+ Pos = MAP_APPFONT ( 12 , 139 ) ;
+ Size = MAP_APPFONT ( 198 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Set Page Number for first title page" ;
+ Text [ x-comment ] = " ";
+ };
+ FixedText FT_SET_PAGE_NUMBER
+ {
+ Pos = MAP_APPFONT ( 20 , 153 ) ;
+ Size = MAP_APPFONT ( 74 , 10 ) ;
+ Text [ en-US ] = "Page Number" ;
+ Text [ x-comment ] = " ";
+ };
+ NumericField NF_SET_PAGE_NUMBER
+ {
+ Pos = MAP_APPFONT ( 100 , 153 ) ;
+ Size = MAP_APPFONT ( 30 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 65535;
+ First = 1 ;
+ Last = 65535;
+ SpinSize = 1 ;
+ };
+ FixedLine FL_PAGE_PROPERTIES
+ {
+ Pos = MAP_APPFONT ( 6 , 169 ) ;
+ Size = MAP_APPFONT ( 204 , 8 ) ;
+ Text [ en-US ] = "Edit Page Properties" ;
+ Text [ x-comment ] = " ";
+ };
+ ListBox LB_PAGE_PROPERTIES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 182 ) ;
+ Size = MAP_APPFONT ( 132 , 80 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ CurPos = 0 ;
+ };
+ PushButton PB_PAGE_PROPERTIES
+ {
+ Pos = MAP_APPFONT ( 150 , 182 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ Text [ en-US ] = "Edit..." ;
+ };
+ FixedLine FL_BOTTOM
+ {
+ Pos = MAP_APPFONT ( 6 , 198 ) ;
+ Size = MAP_APPFONT ( 204 , 8 ) ;
+ };
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( 54 , 209 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ };
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( 107 , 209 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ };
+ HelpButton PB_HELP
+ {
+ Pos = MAP_APPFONT ( 160 , 209 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+};
diff --git a/sw/source/ui/ribbar/conarc.cxx b/sw/source/ui/ribbar/conarc.cxx
index 60f733f328c7..3996b7c9bc00 100644
--- a/sw/source/ui/ribbar/conarc.cxx
+++ b/sw/source/ui/ribbar/conarc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,11 +107,6 @@ sal_Bool ConstArc::MouseButtonUp( const MouseEvent& rMEvt )
m_pSh->EndCreate(SDRCREATE_NEXTPOINT);
}
}
-/* else if ( pView->IsCreateObj() && rMEvt.IsRight() )
- {
- pView->EndCreateObj( SDRCREATE_FORCEEND );
- bReturn = sal_True;
- }*/
return (bReturn);
}
@@ -159,3 +155,4 @@ void ConstArc::Deactivate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/concustomshape.cxx b/sw/source/ui/ribbar/concustomshape.cxx
index ebf3e8beba65..df887850220b 100644
--- a/sw/source/ui/ribbar/concustomshape.cxx
+++ b/sw/source/ui/ribbar/concustomshape.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,24 +41,16 @@
#include <svx/svdview.hxx>
#include <svx/svdocapt.hxx>
#include <editeng/outlobj.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <edtwin.hxx>
#include <wrtsh.hxx>
#include <viewopt.hxx>
-#ifndef _DRAWBASE_HXX
#include <drawbase.hxx>
-#endif
#include <concustomshape.hxx>
#include <svx/gallery.hxx>
#include <sfx2/request.hxx>
-#ifndef _FM_FMMODEL_HXX
#include <svx/fmmodel.hxx>
-#endif
#include <svl/itempool.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdoashp.hxx>
@@ -116,13 +109,9 @@ sal_Bool ConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
if ( pObj )
{
SetAttributes( pObj );
- sal_Bool bForceFillStyle = sal_True;
sal_Bool bForceNoFillStyle = sal_False;
if ( ((SdrObjCustomShape*)pObj)->UseNoFillStyle() )
- {
- bForceFillStyle = sal_False;
bForceNoFillStyle = sal_True;
- }
SfxItemSet aAttr( m_pView->GetPool() );
if ( bForceNoFillStyle )
@@ -250,3 +239,5 @@ bool ConstCustomShape::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/conform.cxx b/sw/source/ui/ribbar/conform.cxx
index 1e6133d7703d..9ab0e2efeda2 100644
--- a/sw/source/ui/ribbar/conform.cxx
+++ b/sw/source/ui/ribbar/conform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,9 +121,7 @@ void ConstFormControl::Activate(const sal_uInt16 nSlotId)
m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
}
-/* -----------------------------19.04.2002 12:42------------------------------
- ---------------------------------------------------------------------------*/
void ConstFormControl::CreateDefaultObject()
{
Point aStartPos(GetDefaultCenterPos());
@@ -142,3 +141,4 @@ void ConstFormControl::CreateDefaultObject()
m_pSh->EndCreate(SDRCREATE_FORCEEND);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/conpoly.cxx b/sw/source/ui/ribbar/conpoly.cxx
index 00f0067435b8..430e3d7ba6f5 100644
--- a/sw/source/ui/ribbar/conpoly.cxx
+++ b/sw/source/ui/ribbar/conpoly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,4 @@ void ConstPolygon::Activate(const sal_uInt16 nSlotId)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/conrect.cxx b/sw/source/ui/ribbar/conrect.cxx
index c1debe9eab34..f8c25ed7ceba 100644
--- a/sw/source/ui/ribbar/conrect.cxx
+++ b/sw/source/ui/ribbar/conrect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -227,3 +228,4 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx
index f41e0ce2835a..52f9f6897644 100644
--- a/sw/source/ui/ribbar/drawbase.cxx
+++ b/sw/source/ui/ribbar/drawbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <svx/svdview.hxx>
#include <svx/svdobj.hxx>
#include <svl/ptitem.hxx>
@@ -81,7 +81,7 @@ SwDrawBase::SwDrawBase(SwWrtShell* pSwWrtShell, SwEditWin* pWindow, SwView* pSwV
|*
\************************************************************************/
-__EXPORT SwDrawBase::~SwDrawBase()
+SwDrawBase::~SwDrawBase()
{
if (m_pView->GetWrtShellPtr()) // Im view-Dtor koennte die wrtsh bereits geloescht worden sein...
m_pSh->GetDrawView()->SetEditMode(sal_True);
@@ -101,7 +101,6 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
SdrView *pSdrView = m_pSh->GetDrawView();
// #i33136#
- // pSdrView->SetOrtho(rMEvt.IsShift());
pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
@@ -212,8 +211,6 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
{
bNoInterrupt = sal_True;
pSdrView->MarkPoint(*pHdl);
-// bReturn = pSdrView->BegDragObj(m_aStartPos, (OutputDevice*) NULL, pHdl);
-// m_pWin->SetDrawAction(sal_True);
}
}
}
@@ -240,11 +237,9 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
{
if (!pSdrView->HasMarkablePoints())
{
- //JP 10.10.2001: Bug 89619 - don't scroll the
- // cursor into the visible area
sal_Bool bUnlockView = !m_pSh->IsViewLocked();
m_pSh->LockView( sal_True ); //lock visible section
- m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // Alles deselektieren
+ m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // deselect all
if( bUnlockView )
m_pSh->LockView( sal_False );
}
@@ -281,7 +276,6 @@ sal_Bool SwDrawBase::MouseMove(const MouseEvent& rMEvt)
if (IsCreateObj() && !m_pWin->IsDrawSelMode() && pSdrView->IsCreateObj())
{
// #i33136#
- // pSdrView->SetOrtho(rMEvt.IsShift());
pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
@@ -519,7 +513,7 @@ void SwDrawBase::Activate(const sal_uInt16 nSlot)
\************************************************************************/
-void __EXPORT SwDrawBase::Deactivate()
+void SwDrawBase::Deactivate()
{
SdrView *pSdrView = m_pSh->GetDrawView();
pSdrView->SetOrtho(sal_False);
@@ -533,9 +527,6 @@ void __EXPORT SwDrawBase::Deactivate()
m_pWin->ReleaseMouse();
bNoInterrupt = sal_False;
-// if(!m_pSh->IsObjSelected())
-// m_pSh->Edit();
-
if(m_pWin->GetApplyTemplate())
m_pWin->SetApplyTemplate(SwApplyTemplate());
m_pSh->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
@@ -649,7 +640,6 @@ void SwDrawBase::BreakCreate()
m_pWin->ReleaseMouse();
Deactivate();
-// m_pView->LeaveDrawCreate();
}
/*************************************************************************
@@ -702,9 +692,7 @@ void SwDrawBase::EnterSelectMode(const MouseEvent& rMEvt)
m_pView->NoRotate();
}
}
-/* -----------------------------03.04.2002 10:52------------------------------
- ---------------------------------------------------------------------------*/
void SwDrawBase::CreateDefaultObject()
{
Point aStartPos = GetDefaultCenterPos();
@@ -716,9 +704,7 @@ void SwDrawBase::CreateDefaultObject()
Rectangle aRect(aStartPos, aEndPos);
m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId);
}
-/* -----------------25.10.2002 14:14-----------------
- *
- * --------------------------------------------------*/
+
Point SwDrawBase::GetDefaultCenterPos()
{
Size aDocSz(m_pSh->GetDocSize());
@@ -738,3 +724,5 @@ bool SwDrawBase::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/dselect.cxx b/sw/source/ui/ribbar/dselect.cxx
index c810abe1a740..b67eaae297b0 100644
--- a/sw/source/ui/ribbar/dselect.cxx
+++ b/sw/source/ui/ribbar/dselect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,4 @@ void DrawSelection::Activate(const sal_uInt16 nSlotId)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index 31149813643b..adda1dbc0ce3 100755..100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,10 +100,9 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind )
InsertWindow( ED_FORMULA, &aEdit);
SetHelpId(ED_FORMULA, HID_EDIT_FORMULA);
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC, bHC ));
- SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL, bHC ));
- SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY, bHC ));
+ SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC ));
+ SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL ));
+ SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY ));
SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | TIB_DROPDOWNONLY );
SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
@@ -133,7 +133,7 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind )
//==================================================================
-__EXPORT SwInputWindow::~SwInputWindow()
+SwInputWindow::~SwInputWindow()
{
SfxImageManager::GetImageManager( SW_MOD() )->ReleaseToolBox(this);
@@ -179,11 +179,9 @@ void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
// update item images
SwModule *pMod = SW_MOD();
SfxImageManager *pImgMgr = SfxImageManager::GetImageManager( pMod );
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- //
- SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC, bHC ));
- SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL, bHC ));
- SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY, bHC ));
+ SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC ));
+ SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL ));
+ SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY ));
}
ToolBox::DataChanged( rDCEvt );
@@ -191,7 +189,7 @@ void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
//==================================================================
-void __EXPORT SwInputWindow::Resize()
+void SwInputWindow::Resize()
{
ToolBox::Resize();
@@ -215,7 +213,7 @@ void SwInputWindow::ShowWin()
pView->GetHLineal().SetActive( sal_False );
pView->GetVLineal().SetActive( sal_False );
- DBG_ASSERT(pWrtShell, "Keine WrtShell!");
+ OSL_ENSURE(pWrtShell, "no WrtShell!");
// Cursor in Tabelle
bIsTable = pWrtShell->IsCrsrInTbl() ? sal_True : sal_False;
@@ -236,11 +234,11 @@ void SwInputWindow::ShowWin()
aPos.SetText(SW_RESSTR(STR_TBL_FORMULA));
// Aktuelles Feld bearbeiten
- ASSERT(pMgr == 0, FieldManager nicht geloescht.);
+ OSL_ENSURE(pMgr == 0, "FieldManager not deleted");
pMgr = new SwFldMgr;
- // JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier
- // also setzen
+ // Formel soll immer mit einem "=" beginnen, hier
+ // also setzen
String sEdit( '=' );
if( pMgr->GetCurFld() && TYP_FORMELFLD == pMgr->GetCurTypeId() )
{
@@ -315,7 +313,7 @@ void SwInputWindow::ShowWin()
IMPL_LINK( SwInputWindow, MenuHdl, Menu *, pMenu )
{
-static const char * __READONLY_DATA aStrArr[] = {
+static const char * const aStrArr[] = {
sCalc_Phd,
sCalc_Sqrt,
sCalc_Or,
@@ -374,7 +372,7 @@ IMPL_LINK( SwInputWindow, DropdownClickHdl, ToolBox*, EMPTYARG )
//==================================================================
-void __EXPORT SwInputWindow::Click( )
+void SwInputWindow::Click( )
{
sal_uInt16 nCurID = GetCurItemId();
EndSelection(); // setzt CurItemId zurueck !
@@ -402,8 +400,8 @@ void SwInputWindow::ApplyFormula()
CleanupUglyHackWithUndo();
pWrtShell->Pop( sal_False );
- // JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier
- // also wieder entfernen
+ // Formel soll immer mit einem "=" beginnen, hier
+ // also wieder entfernen
String sEdit( aEdit.GetText() );
sEdit.EraseLeadingChars().EraseTrailingChars();
if( sEdit.Len() && '=' == sEdit.GetChar( 0 ) )
@@ -537,7 +535,7 @@ void SwInputWindow::DelBoxCntnt()
//==================================================================
-void __EXPORT InputEdit::KeyInput(const KeyEvent& rEvent)
+void InputEdit::KeyInput(const KeyEvent& rEvent)
{
const KeyCode aCode = rEvent.GetKeyCode();
if(aCode == KEY_RETURN || aCode == KEY_F2 )
@@ -550,7 +548,7 @@ void __EXPORT InputEdit::KeyInput(const KeyEvent& rEvent)
//==================================================================
-void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
+void InputEdit::UpdateRange(const String& rBoxes,
const String& rName )
{
if( !rBoxes.Len() )
@@ -583,7 +581,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
aStr += cClose;
SetText(aStr);
sal_uInt16 nPos = aStr.Search( cClose );
- ASSERT(nPos < aStr.Len(), Delimiter nicht gefunden.);
+ OSL_ENSURE(nPos < aStr.Len(), "delimiter not found");
++nPos;
SetSelection( Selection( nPos, nPos ));
}
@@ -609,8 +607,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
nEndPos = nStartPos;
while( nEndPos < nLen )
{
- if( cClose == (cCh = aActText.GetChar( nEndPos )) /*||
- cCh == cCloseBracket*/ )
+ if( cClose == (cCh = aActText.GetChar( nEndPos )))
{
bFound = sal_True;
break;
@@ -642,7 +639,6 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
{
SetText( aActText );
SetSelection( Selection( nPos, nPos ) );
-// GetModifyHdl().Call( this );
}
}
GrabFocus();
@@ -650,7 +646,6 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
}
//==================================================================
-
SwInputChild::SwInputChild(Window* _pParent,
sal_uInt16 nId,
SfxBindings* pBindings,
@@ -664,16 +659,17 @@ SwInputChild::SwInputChild(Window* _pParent,
}
-__EXPORT SwInputChild::~SwInputChild()
+SwInputChild::~SwInputChild()
{
if(pDispatch)
pDispatch->Lock(sal_False);
}
-SfxChildWinInfo __EXPORT SwInputChild::GetInfo() const
+SfxChildWinInfo SwInputChild::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
return aInfo;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/inputwin.src b/sw/source/ui/ribbar/inputwin.src
index 5686fd7ae6c2..bd88014a3554 100644
--- a/sw/source/ui/ribbar/inputwin.src
+++ b/sw/source/ui/ribbar/inputwin.src
@@ -47,22 +47,18 @@ ToolBox RID_TBX_FORMULA
HelpId = HID_TBX_FORMULA_CALC ;
DropDown = TRUE ;
Text [ en-US ] = "Formula" ;
- /* ### ACHTUNG: Neuer Text in Resource? Formel auswählen : Formel auswõhlen */
};
ToolBoxItem
{
Identifier = FN_FORMULA_CANCEL ;
HelpId = HID_TBX_FORMULA_CANCEL ;
Text [ en-US ] = "Cancel" ;
- /* ### ACHTUNG: Neuer Text in Resource? Formel nicht übenehmen : Formel nicht ³benehmen */
};
ToolBoxItem
{
Identifier = FN_FORMULA_APPLY ;
HelpId = HID_TBX_FORMULA_APPLY ;
- /* ### ACHTUNG: Neuer Text in Resource? Übernehmen : šbernehmen */
Text [ en-US ] = "Apply" ;
- /* ### ACHTUNG: Neuer Text in Resource? Formel einfügen : Formel einf³gen */
};
};
Edit ED_POS
@@ -152,7 +148,6 @@ Menu MN_CALC_POPUP
{
Identifier = MN_CALC_GEQ ;
HelpID = HID_MN_CALC_GEQ ;
- /* ### ACHTUNG: Neuer Text in Resource? Gr~ößer Gleich : Gr~÷˜er Gleich */
Text [ en-US ] = "Greater Than or Equal" ;
};
MenuItem
@@ -165,7 +160,6 @@ Menu MN_CALC_POPUP
{
Identifier = MN_CALC_GRE ;
HelpID = HID_MN_CALC_GRE ;
- /* ### ACHTUNG: Neuer Text in Resource? G~rößer : G~r÷˜er */
Text [ en-US ] = "Greater" ;
};
MenuItem
@@ -289,22 +283,18 @@ String STR_TBL_FORMULA
Identifier = FN_FORMULA_CALC ; \
HelpID = HID_TBX_FORMULA_CALC ; \
Text [ en-US ] = "Formula" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Formel auswählen : Formel auswõhlen */\
};\
ToolBoxItem\
{\
Identifier = FN_FORMULA_CANCEL ; \
HelpId = HID_TBX_FORMULA_CANCEL ; \
Text [ en-US ] = "Cancel" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Formel nicht übenehmen : Formel nicht ³benehmen */\
};\
ToolBoxItem\
{\
Identifier = FN_FORMULA_APPLY ; \
HelpID = HID_TBX_FORMULA_APPLY ; \
- /* ### ACHTUNG: Neuer Text in Resource? Übernehmen : šbernehmen */\
Text [ en-US ] = "Apply" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Formel einfügen : Formel einf³gen */\
};
diff --git a/sw/source/ui/ribbar/tblctrl.cxx b/sw/source/ui/ribbar/tblctrl.cxx
index a5cc0d6725ba..fae82b2c568b 100644
--- a/sw/source/ui/ribbar/tblctrl.cxx
+++ b/sw/source/ui/ribbar/tblctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,5 @@ SfxPopupWindowType SwTableOptimizeCtrl::GetPopupWindowType() const
{
return SFX_POPUPWINDOW_ONCLICK;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx
index 31e3c21f5e13..a32d1f12c593 100644
--- a/sw/source/ui/ribbar/tbxanchr.cxx
+++ b/sw/source/ui/ribbar/tbxanchr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,15 +31,13 @@
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <string>
#include <vcl/timer.hxx>
#include <sfx2/app.hxx>
#include <svx/htmlmode.hxx>
#include <svl/intitem.hxx>
#include <sfx2/dispatch.hxx>
-#ifndef _TOOLBOX_HXX //autogen
#include <vcl/toolbox.hxx>
-#endif
#include <sfx2/mnumgr.hxx>
@@ -49,7 +48,6 @@
#include "wrtsh.hxx"
#include "view.hxx"
#include "viewopt.hxx"
-#include "errhdl.hxx"
#include "ribbar.hrc"
#include "tbxanchr.hxx"
@@ -57,10 +55,6 @@
SFX_IMPL_TOOLBOX_CONTROL(SwTbxAnchor, SfxUInt16Item);
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
SwTbxAnchor::SwTbxAnchor( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
SfxToolBoxControl( nSlotId, nId, rTbx ),
nActAnchorId(0)
@@ -68,18 +62,10 @@ SwTbxAnchor::SwTbxAnchor( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
SwTbxAnchor::~SwTbxAnchor()
{
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
void SwTbxAnchor::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SFX_ITEM_DISABLED) );
@@ -93,20 +79,12 @@ void SwTbxAnchor::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
SfxPopupWindow* SwTbxAnchor::CreatePopupWindow()
{
SwTbxAnchor::Click();
return 0;
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
void SwTbxAnchor::Click()
{
PopupMenu aPopMenu(SW_RES(MN_ANCHOR_POPUP));
@@ -122,8 +100,6 @@ void SwTbxAnchor::Click()
pDispatch = pViewFrame->GetDispatcher();
}
-// SfxDispatcher* pDispatch = GetBindings().GetDispatcher();
-// SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0;
SwView* pActiveView = 0;
if(pViewFrame)
{
@@ -141,7 +117,7 @@ void SwTbxAnchor::Click()
}
if(!pActiveView)
{
- DBG_ERROR("No active view could be found");
+ OSL_FAIL("No active view found");
return;
}
SwWrtShell* pWrtShell = pActiveView->GetWrtShellPtr();
@@ -164,3 +140,5 @@ void SwTbxAnchor::Click()
if (nSlotId)
pDispatch->Execute(nSlotId, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 2e46b44cf82d..6cf63fe81ce5 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,37 +30,24 @@
#include "precompiled_sw.hxx"
-
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <string>
#include <svl/eitem.hxx>
#include <svx/htmlmode.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/bindings.hxx>
-#ifndef _SFX_IMAGEMGR_HXX
#include <sfx2/imagemgr.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <initui.hxx>
#include <viewopt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <gloshdl.hxx>
#include <glosdoc.hxx>
#include <gloslst.hxx>
#include <workctrl.hxx>
-#ifndef _WORKCTRL_HRC
#include <workctrl.hrc>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <wrtsh.hxx>
#include <svl/imageitm.hxx>
#include <vcl/lstbox.hxx>
@@ -69,7 +57,7 @@
#include <vcl/svapp.hxx>
-//JP 14.01.99: Size Abpruefung
+// Size Abpruefung
#define NAVI_ENTRIES 20
#if NAVI_ENTRIES != NID_COUNT
#error SwScrollNaviPopup-CTOR static Array falsche Size. Wurden neue IDs zugefuegt ??
@@ -84,9 +72,6 @@ using namespace ::com::sun::star::frame;
SFX_IMPL_TOOLBOX_CONTROL( SwTbxInsertCtrl, SfxImageItem);
SFX_IMPL_TOOLBOX_CONTROL( SwTbxAutoTextCtrl, SfxBoolItem );
-/**********************************************************************
-
-**********************************************************************/
SwTbxInsertCtrl::SwTbxInsertCtrl(
sal_uInt16 nSlotId,
sal_uInt16 nId,
@@ -96,9 +81,7 @@ SwTbxInsertCtrl::SwTbxInsertCtrl(
{
rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
}
-/**********************************************************************
-**********************************************************************/
SwTbxInsertCtrl::~SwTbxInsertCtrl()
{
}
@@ -108,10 +91,7 @@ void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException)
ToolBox& rTbx = GetToolBox();
rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
aSlotURL += rtl::OUString::valueOf( sal_Int32( nLastSlotId ));
- Image aImage = GetImage( m_xFrame,
- aSlotURL,
- hasBigImages(),
- rTbx.GetSettings().GetStyleSettings().GetHighContrastMode() );
+ Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() );
rTbx.SetItemImage(GetId(), aImage);
rTbx.Invalidate();
@@ -119,11 +99,6 @@ void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException)
SfxToolBoxControl::update();
}
-/**********************************************************************
-
-**********************************************************************/
-
-
void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/,
SfxItemState eState,
const SfxPoolItem* pState )
@@ -143,10 +118,7 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/,
rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
aSlotURL += rtl::OUString::valueOf( sal_Int32( nId ));
ToolBox& rBox = GetToolBox();
- Image aImage = GetImage( m_xFrame,
- aSlotURL,
- hasBigImages(),
- rBox.GetSettings().GetStyleSettings().GetHighContrastMode() );
+ Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() );
rBox.SetItemImage(GetId(), aImage);
rBox.SetItemImageMirrorMode( GetId(), sal_False );
rBox.SetItemImageAngle( GetId(), pItem->GetRotation() );
@@ -155,10 +127,6 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/,
}
}
-/**********************************************************************
-
-**********************************************************************/
-
SfxPopupWindow* SwTbxInsertCtrl::CreatePopupWindow()
{
@@ -175,22 +143,12 @@ SfxPopupWindow* SwTbxInsertCtrl::CreatePopupWindow()
return NULL;
}
-/**********************************************************************
-
-**********************************************************************/
-
-
SfxPopupWindowType SwTbxInsertCtrl::GetPopupWindowType() const
{
return nLastSlotId ? SFX_POPUPWINDOW_ONTIMEOUT : SFX_POPUPWINDOW_ONCLICK;
}
-/**********************************************************************
-
-**********************************************************************/
-
-
void SwTbxInsertCtrl::Select( sal_Bool /*bMod1*/ )
{
if( nLastSlotId )
@@ -210,11 +168,6 @@ void SwTbxInsertCtrl::Select( sal_Bool /*bMod1*/ )
}
}
-/**********************************************************************
-
-**********************************************************************/
-
-
SwTbxAutoTextCtrl::SwTbxAutoTextCtrl(
sal_uInt16 nSlotId,
sal_uInt16 nId,
@@ -225,21 +178,12 @@ SwTbxAutoTextCtrl::SwTbxAutoTextCtrl(
{
rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
}
-/**********************************************************************
-
-**********************************************************************/
-
SwTbxAutoTextCtrl::~SwTbxAutoTextCtrl()
{
DelPopup();
}
-/**********************************************************************
-
-**********************************************************************/
-
-
SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
{
pView = ::GetActiveView();
@@ -315,21 +259,11 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
}
-/**********************************************************************
-
-**********************************************************************/
-
-
SfxPopupWindowType SwTbxAutoTextCtrl::GetPopupWindowType() const
{
return SFX_POPUPWINDOW_ONTIMEOUT;
}
-/**********************************************************************
-
-**********************************************************************/
-
-
void SwTbxAutoTextCtrl::StateChanged( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState )
@@ -341,11 +275,6 @@ void SwTbxAutoTextCtrl::StateChanged( sal_uInt16 nSID,
}
}
-/**********************************************************************
-
-**********************************************************************/
-
-
IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
{
sal_uInt16 nId = pMenu->GetCurItemId();
@@ -393,7 +322,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( sGroup );
@@ -403,11 +332,6 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
return 0;
}
-/**********************************************************************
-
-**********************************************************************/
-
-
void SwTbxAutoTextCtrl::DelPopup()
{
if(pPopup)
@@ -425,11 +349,9 @@ void SwTbxAutoTextCtrl::DelPopup()
}
}
-/*-----------------19.02.97 10.52-------------------
- Navigations-Popup
---------------------------------------------------*/
+/* Navigations-Popup */
// determine the order of the toolbox items
-static sal_uInt16 __READONLY_DATA aNavigationInsertIds[ NAVI_ENTRIES ] =
+static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] =
{
// -- first line
NID_TBL,
@@ -454,7 +376,7 @@ static sal_uInt16 __READONLY_DATA aNavigationInsertIds[ NAVI_ENTRIES ] =
NID_TABLE_FORMULA_ERROR,
NID_NEXT
};
-static const char* __READONLY_DATA aNavigationHelpIds[ NAVI_ENTRIES ] =
+static const char* aNavigationHelpIds[ NAVI_ENTRIES ] =
{
// -- first line
HID_NID_TBL,
@@ -486,7 +408,6 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >&
aSeparator(this, SW_RES(FL_SEP)),
aInfoField(this, SW_RES(FI_INFO)),
aIList(SW_RES(IL_VALUES)),
- aIListH(SW_RES(ILH_VALUES)),
nFwdId(FN_START_OF_NEXT_PAGE),
nBackId(FN_START_OF_PREV_PAGE)
{
@@ -545,16 +466,11 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >&
aToolBox.StartSelection();
aToolBox.Show();
}
-/*-----------------19.02.97 12.45-------------------
-
---------------------------------------------------*/
SwScrollNaviPopup::~SwScrollNaviPopup()
{
}
-/* -----------------------------08.05.2002 14:00------------------------------
- ---------------------------------------------------------------------------*/
void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
@@ -563,32 +479,22 @@ void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt )
Window::DataChanged( rDCEvt );
}
-/* -----------------------------08.05.2002 14:02------------------------------
- ---------------------------------------------------------------------------*/
void SwScrollNaviPopup::ApplyImageList()
{
- ImageList& rImgLst = aToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ?
- aIListH : aIList;
+ ImageList& rImgLst = aIList;
for(sal_uInt16 i = 0; i < NID_COUNT; i++)
{
sal_uInt16 nNaviId = aNavigationInsertIds[i];
aToolBox.SetItemImage(nNaviId, rImgLst.GetImage(nNaviId));
}
}
-/*-----------------19.02.97 13.58-------------------
-
---------------------------------------------------*/
SfxPopupWindow* SwScrollNaviPopup::Clone() const
{
return new SwScrollNaviPopup( GetId(), GetFrame() );
}
-/*-----------------19.02.97 14.10-------------------
-
---------------------------------------------------*/
-
IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)
{
sal_uInt16 nSet = pSet->GetCurItemId();
@@ -619,9 +525,6 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)
}
return 0;
}
-/*-----------------23.02.97 18.21-------------------
-
---------------------------------------------------*/
void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt )
{
@@ -630,9 +533,6 @@ void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt )
((SwScrollNaviPopup*)GetParent())->EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
}
-/*-----------------20.06.97 13:28-------------------
-
---------------------------------------------------*/
void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt )
{
SetItemText(NID_NEXT, SwScrollNaviPopup::GetQuickHelpText(sal_True));
@@ -641,9 +541,6 @@ void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt )
}
-/*-----------------20.06.97 13:41-------------------
-
---------------------------------------------------*/
String SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext)
{
sal_uInt16 nResId = STR_IMGBTN_START;
@@ -652,17 +549,12 @@ String SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext)
nResId += NID_COUNT;
return String(SW_RES(nResId));
}
-/* -----------------------------05.09.2002 13:53------------------------------
- ---------------------------------------------------------------------------*/
void SwNaviImageButton::Click()
{
-// SfxBindings& rBind = SfxViewFrame::Current()->GetBindings();
-// rBind.ENTERREGISTRATIONS();
pPopup = new
SwScrollNaviPopup( FN_SCROLL_NAVIGATION,
m_xFrame );
-// rBind.LEAVEREGISTRATIONS();
Point aPos = OutputToScreenPixel(Point(0,0));
Rectangle aRect(aPos, GetSizePixel());
SetPopupWindow( pPopup );
@@ -711,10 +603,6 @@ IMPL_LINK( SwNaviImageButton, ClosePopupWindow, SfxPopupWindow *, pWindow )
return 1;
}
-/*-----------------21.02.97 09:41-------------------
-
---------------------------------------------------*/
-
void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt )
{
@@ -723,17 +611,12 @@ void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt )
ImageButton::RequestHelp(rHEvt);
}
-/*-----------------25.02.97 12:38-------------------
-
---------------------------------------------------*/
-
SwNaviImageButton::SwNaviImageButton(
Window* pParent,
const Reference< XFrame >& rFrame ) :
ImageButton(pParent, SW_RES(BTN_NAVI)),
pPopup(0),
aImage(SW_RES(IMG_BTN)),
- aImageH(SW_RES(IMG_BTN_H)),
sQuickText(SW_RES(ST_QUICK)),
pPopupWindow(0),
pFloatingWindow(0),
@@ -742,22 +625,18 @@ SwNaviImageButton::SwNaviImageButton(
FreeResource();
SetStyle(GetStyle()|WB_NOPOINTERFOCUS);
SetQuickHelpText(sQuickText);
- SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage);
+ SetModeImage( aImage );
}
-/* -----------------------------2002/07/05 9:41-------------------------------
- ---------------------------------------------------------------------------*/
void SwNaviImageButton::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
- SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage);
+ SetModeImage( aImage );
Window::DataChanged( rDCEvt );
}
-/* -----------------26.11.2002 09:28-----------------
- *
- * --------------------------------------------------*/
+
class SwZoomBox_Impl : public ComboBox
{
sal_uInt16 nSlotId;
@@ -778,9 +657,7 @@ protected:
void ReleaseFocus();
};
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
+
SwZoomBox_Impl::SwZoomBox_Impl(
Window* pParent,
sal_uInt16 nSlot,
@@ -800,14 +677,10 @@ SwZoomBox_Impl::SwZoomBox_Impl(
InsertEntry(sEntry);
}
}
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
+
SwZoomBox_Impl::~SwZoomBox_Impl()
{}
-/* -----------------26.11.2002 09:34-----------------
- *
- * --------------------------------------------------*/
+
void SwZoomBox_Impl::Select()
{
if ( !IsTravelSelect() )
@@ -837,9 +710,7 @@ void SwZoomBox_Impl::Select()
ReleaseFocus();
}
}
-/* -----------------02.12.2002 07:49-----------------
- *
- * --------------------------------------------------*/
+
long SwZoomBox_Impl::Notify( NotifyEvent& rNEvt )
{
long nHandled = 0;
@@ -876,9 +747,7 @@ long SwZoomBox_Impl::Notify( NotifyEvent& rNEvt )
return nHandled ? nHandled : ComboBox::Notify( rNEvt );
}
-/* -----------------02.12.2002 07:51-----------------
- *
- * --------------------------------------------------*/
+
void SwZoomBox_Impl::ReleaseFocus()
{
if ( !bRelease )
@@ -897,9 +766,6 @@ void SwZoomBox_Impl::ReleaseFocus()
}
}
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
SFX_IMPL_TOOLBOX_CONTROL( SwPreviewZoomControl, SfxUInt16Item);
SwPreviewZoomControl::SwPreviewZoomControl(
@@ -909,15 +775,11 @@ SwPreviewZoomControl::SwPreviewZoomControl(
SfxToolBoxControl( nSlotId, nId, rTbx )
{
}
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
+
SwPreviewZoomControl::~SwPreviewZoomControl()
{
}
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
+
void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
SfxItemState eState,
const SfxPoolItem* pState )
@@ -933,11 +795,11 @@ void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
pBox->SaveValue();
}
}
-/* -----------------26.11.2002 09:29-----------------
- *
- * --------------------------------------------------*/
+
Window* SwPreviewZoomControl::CreateItemWindow( Window *pParent )
{
SwZoomBox_Impl* pRet = new SwZoomBox_Impl( pParent, GetSlotId(), Reference< XDispatchProvider >( m_xFrame->getController(), UNO_QUERY ));
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/ribbar/workctrl.hrc b/sw/source/ui/ribbar/workctrl.hrc
index 5e5180f363aa..51ac45b2ae87 100644
--- a/sw/source/ui/ribbar/workctrl.hrc
+++ b/sw/source/ui/ribbar/workctrl.hrc
@@ -37,9 +37,6 @@
#define ST_QUICK 7
#define FI_INFO 8
#define FL_SEP 9
-#define ILH_VALUES 10
-#define IMG_BTN_H 11
-
#define ST_TBL 12
#define ST_FRM 13
diff --git a/sw/source/ui/ribbar/workctrl.src b/sw/source/ui/ribbar/workctrl.src
index 4fff5c4a9260..ce0163974f6d 100644
--- a/sw/source/ui/ribbar/workctrl.src
+++ b/sw/source/ui/ribbar/workctrl.src
@@ -51,7 +51,6 @@ Menu RID_INSERT_FIELD_CTRL
HelpId = CMD_FN_INSERT_FLD_TIME ;
Text [ en-US ] = "Time" ;
};
- //#ifndef MN_SW_WEB
MenuItem
{
Identifier = FN_INSERT_FLD_PGNUMBER ;
@@ -76,7 +75,6 @@ Menu RID_INSERT_FIELD_CTRL
HelpId = CMD_FN_INSERT_FLD_TITLE ;
Text [ en-US ] = "Title" ;
};
- //#endif
MenuItem
{
Identifier = FN_INSERT_FLD_AUTHOR ;
@@ -134,12 +132,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN
MaskColor = IMAGE_MASK_COLOR ;
SCROLL_IMAGE_IDLIST
};
- ImageList ILH_VALUES
- {
- Prefix = "srh";
- MaskColor = IMAGE_MASK_COLOR ;
- SCROLL_IMAGE_IDLIST
- };
FixedLine FL_SEP
{
//no position, no text
@@ -189,7 +181,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN
};
String ST_OUTL
{
- /* ### ACHTUNG: Neuer Text in Resource? Überschrift : šberschrift */
Text [ en-US ] = "Headings" ;
};
String ST_SEL
@@ -198,7 +189,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN
};
String ST_FTN
{
- /* ### ACHTUNG: Neuer Text in Resource? Fußnote : Fu˜note */
Text [ en-US ] = "Footnote" ;
};
String ST_MARK
@@ -227,31 +217,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN
};
Text [ en-US ] = "Navigation" ;
};
-/*
-Noch ein paar Reserven
- ToolBoxItem
- {
- Identifier = NID_NEXT;
- Text = "Vorwärts" ;
- };
- ToolBoxItem
- {
- Identifier = NID_PREV;
- Text = "Rückwärts" ;
- };
- ToolBoxItem
- {
- Identifier = NID_CTRL;
- Text = "Control" ;
- };
- ToolBoxItem
- {
- Identifier = NID_DRW;
- Text = "Zeichenobjekt" ;
- };
-
-
-*/
/***************************************************************
Strings fuer die Quickhelp der View-PgUp/Down-Buttons
***************************************************************/
@@ -265,73 +230,58 @@ String STR_IMGBTN_PREV_DOWN
};
String STR_IMGBTN_TBL_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Tabelle : Nõchste Tabelle */
Text [ en-US ] = "Next table" ;
};
String STR_IMGBTN_FRM_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächster Textrahmen : Nõchster Textrahmen */
Text [ en-US ] = "Next text frame" ;
};
String STR_IMGBTN_PGE_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Seite : Nõchste Seite */
Text [ en-US ] = "Next page" ;
};
String STR_IMGBTN_DRW_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächstes Zeichenobjekt : Nõchstes Zeichenobjekt */
Text [ en-US ] = "Next drawing" ;
};
String STR_IMGBTN_CTRL_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächstes Kontrollfeld : Nõchstes Kontrollfeld */
Text [ en-US ] = "Next control" ;
};
String STR_IMGBTN_REG_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächster Bereich : Nõchster Bereich */
Text [ en-US ] = "Next section" ;
};
String STR_IMGBTN_BKM_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Textmarke : Nõchste Textmarke */
Text [ en-US ] = "Next bookmark" ;
};
String STR_IMGBTN_GRF_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Grafik : Nõchste Grafik */
Text [ en-US ] = "Next graphic" ;
};
String STR_IMGBTN_OLE_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächstes OLE-Objekt : Nächstes OLE object */
- /* ### ACHTUNG: Neuer Text in Resource? Nächstes OLE-Objekt : Nõchstes OLE-Objekt */
Text [ en-US ] = "Next OLE object" ;
};
String STR_IMGBTN_OUTL_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Überschrift : Nõchste šberschrift */
Text [ en-US ] = "Next heading" ;
};
String STR_IMGBTN_SEL_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Markierung : Nõchste Markierung */
Text [ en-US ] = "Next selection" ;
};
String STR_IMGBTN_FTN_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Fußnote : Nõchste Fu˜note */
Text [ en-US ] = "Next footnote" ;
};
String STR_IMGBTN_MARK_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächster Merker : Nõchster Merker */
Text [ en-US ] = "Next Reminder" ;
};
String STR_IMGBTN_POSTIT_DOWN
{
- /* ### ACHTUNG: Neuer Text in Resource? Nächste Notiz : Nõchste Notiz */
Text [ en-US ] = "Next Note" ;
};
String STR_IMGBTN_SRCH_REP_DOWN
@@ -384,12 +334,10 @@ String STR_IMGBTN_GRF_UP
};
String STR_IMGBTN_OLE_UP
{
- /* ### ACHTUNG: Neuer Text in Resource? Voriges OLE-Objekt : Voriges OLE object */
Text [ en-US ] = "Previous OLE object" ;
};
String STR_IMGBTN_OUTL_UP
{
- /* ### ACHTUNG: Neuer Text in Resource? Vorige Überschrift : Vorige šberschrift */
Text [ en-US ] = "Previous heading" ;
};
String STR_IMGBTN_SEL_UP
@@ -398,7 +346,6 @@ String STR_IMGBTN_SEL_UP
};
String STR_IMGBTN_FTN_UP
{
- /* ### ACHTUNG: Neuer Text in Resource? Vorige Fußnote : Vorige Fu˜note */
Text [ en-US ] = "Previous footnote" ;
};
String STR_IMGBTN_MARK_UP
@@ -445,11 +392,6 @@ ImageButton BTN_NAVI
ImageBitmap = Bitmap { File = "punkt.bmp" ; };
MaskColor = IMAGE_MASK_COLOR ;
};
- Image IMG_BTN_H
- {
- ImageBitmap = Bitmap { File = "punkt_h.bmp" ; };
- MaskColor = IMAGE_MASK_COLOR ;
- };
String ST_QUICK
{
Text [ en-US ] = "Navigation" ;
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 608c3e8afff0..1753f9b2dd9a 100755..100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,9 +116,7 @@
#include <editeng/editview.hxx>
#include <svl/languageoptions.hxx>
-#include <editeng/langitem.hxx>
#include <svtools/langtab.hxx>
-#include <svl/slstitm.hxx>
#include <docsh.hxx>
#include <svl/undo.hxx>
@@ -167,7 +166,7 @@ SwAnnotationShell::~SwAnnotationShell()
if ( !pPostItMgr ||
!pPostItMgr->HasActiveSidebarWin() )
{
- DBG_ASSERT(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
+ OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
return 0;
}
return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager();
@@ -372,10 +371,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -384,10 +383,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
rView.GetWindow(), &aTmp, rView.GetWrtShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -397,7 +396,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
try
{
- uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
+ uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -423,7 +422,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -448,12 +447,11 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
aDlgAttr.Put( aEditAttr );
aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
- //CHINA001 SwCharDlg* pDlg = new SwCharDlg(pView->GetWindow(), *pView, aDlgAttr, 0, sal_True);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet )
{
@@ -496,13 +494,12 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
- //CHINA001 SwParaDlg* pDlg = new SwParaDlg(GetView().GetWindow(), GetView(), aDlgAttr, DLG_STD, 0, sal_True);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet)
{
@@ -903,7 +900,6 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) )
aFormats.AddClipbrdFormat( SOT_FORMAT_RTF );
- //if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) )
aFormats.AddClipbrdFormat( SOT_FORMAT_STRING );
rSet.Put( aFormats );
}
@@ -1024,15 +1020,6 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
break;
}
case FN_HIDE_NOTE:
- /*
- if ( Mgr()->GetActiveSidebarWin() == this )
- {
- Mgr()->SetActivePostIt(0);
- // put the cursor back into the document
- SwitchToFieldPos();
- }
- Mgr()->Hide(mpFld);
- */
break;
case FN_HIDE_ALL_NOTES:
pPostItMgr->Hide();
@@ -1164,7 +1151,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
{
Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog")
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog"))
, xContext), UNO_QUERY);
Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
if( xInit.is() )
@@ -1174,7 +1161,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
Sequence<Any> aSeq(1);
Any* pArray = aSeq.getArray();
PropertyValue aParam;
- aParam.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam.Value <<= makeAny(xDialogParentWindow);
pArray[0] <<= makeAny(aParam);
xInit->initialize( aSeq );
@@ -1305,53 +1292,70 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet)
void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
{
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
- if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
+ if (!pPostItMgr || !pPostItMgr->HasActiveSidebarWin())
return;
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
+ if (!pOLV)
+ return;
+
using namespace ::com::sun::star::i18n;
+
+ sal_uInt32 nMode = 0;
+
+ switch( rReq.GetSlot() )
{
- sal_uInt32 nMode = 0;
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
+ case SID_TRANSLITERATE_UPPER:
+ nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ break;
+ case SID_TRANSLITERATE_LOWER:
+ nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ break;
+ case SID_TRANSLITERATE_HALFWIDTH:
+ nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ break;
+ case SID_TRANSLITERATE_FULLWIDTH:
+ nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ break;
+ case SID_TRANSLITERATE_HIRAGANA:
+ nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ break;
+ case SID_TRANSLITERATE_KATAGANA:
+ nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ break;
- switch( rReq.GetSlot() )
- {
- case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
- break;
- case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
- break;
- case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
- break;
- case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
- break;
- case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
- break;
- case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
- break;
- case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
- break;
- case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
- break;
- case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
- break;
+ default:
+ OSL_ENSURE(!this, "wrong dispatcher");
+ }
- default:
- ASSERT(!this, "falscher Dispatcher");
- }
+ if( nMode )
+ pOLV->TransliterateText( nMode );
+}
- if( nMode )
- {
- pOLV->TransliterateText( nMode );
- }
+void SwAnnotationShell::ExecRotateTransliteration( SfxRequest & rReq )
+{
+ if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
+ {
+ SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
+ if (!pPostItMgr || !pPostItMgr->HasActiveSidebarWin())
+ return;
+
+ OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
+
+ if (!pOLV)
+ return;
+
+ pOLV->TransliterateText(m_aRotateCase.getNextMode());
}
}
@@ -1680,3 +1684,5 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
rReq.Done();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 3c95ad5635d0..6bb2f67d20d3 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,7 +120,6 @@
FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
-
//Fuer die Erkennung der Id, die variable von Gallery mit SID_GALLERY_BG_BRUSH
//ankommt.
static sal_uInt8 nParagraphPos;
@@ -152,7 +152,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
-
SFX_IMPL_INTERFACE(SwBaseShell, SfxShell, SW_RES(0))
{
SFX_CHILDWINDOW_REGISTRATION(SvxIMapDlgChildWindow::GetChildWindowId());
@@ -164,8 +163,6 @@ TYPEINIT1(SwBaseShell,SfxShell)
/*--------------------------------------------------------------------
Beschreibung: statics
--------------------------------------------------------------------*/
-
-
void lcl_UpdateIMapDlg( SwWrtShell& rSh )
{
Graphic aGrf( rSh.GetIMapGraphic() );
@@ -181,16 +178,11 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh )
SvxIMapDlgChildWindow::UpdateIMapDlg(
aGrf, rURL.GetMap(), pList, pEditObj );
- sal_uInt16 nCount = (sal_uInt16)pList->Count();
- if(nCount)
- for( sal_uInt16 i = nCount; i; i-- )
- {
- delete pList->GetObject(i-1);
- }
+ for ( size_t i = 0, n = pList->size(); i < n; ++i )
+ delete pList->at( i );
delete pList;
}
-
sal_Bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel )
{
Graphic aGraf( rSh.GetIMapGraphic() );
@@ -212,7 +204,6 @@ sal_Bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel )
/*--------------------------------------------------------------------
Beschreibung: loeschen
--------------------------------------------------------------------*/
-
void SwBaseShell::ExecDelete(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -231,10 +222,6 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
sal_Bool bLeft = rSh.Left( CRSR_SKIP_CHARS, sal_True, 1, sal_False );
if( bLeft )
{
- // JP 28.03.96: ein Backspace im Absatz ohne Nummer wird zum Delete
- //rSh.SwapPam();
- //rSh.DelRight( sal_False );
-
rSh.DelLeft();
}
else
@@ -252,7 +239,7 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
rSh.DelLeft();
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_FAIL("wrong Dispatcher");
return;
}
rReq.Done();
@@ -261,10 +248,6 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
rTmpEditWin.SetUseInputLanguage( sal_False );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
{
//Achtung: Suizid gefaehrdet! Nach Paste, Paste special kann der die
@@ -420,7 +403,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
}
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_FAIL("wrong Dispatcher");
return;
}
if(!bIgnore)
@@ -430,7 +413,6 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
/*--------------------------------------------------------------------
Beschreibung: ClipBoard-Status
--------------------------------------------------------------------*/
-
void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
@@ -487,7 +469,6 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
/*--------------------------------------------------------------------
Beschreibung: Undo ausfuehren
--------------------------------------------------------------------*/
-
void SwBaseShell::ExecUndo(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -519,7 +500,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
rSh.Do( SwWrtShell::REPEAT );
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_FAIL("wrong Dispatcher");
}
if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); }
@@ -528,7 +509,6 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
/*--------------------------------------------------------------------
Beschreibung: Zustand Undo
--------------------------------------------------------------------*/
-
void SwBaseShell::StateUndo(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
@@ -602,7 +582,6 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet)
/*--------------------------------------------------------------------
Beschreibung: Slot-Id auswerten bzw. Dispatchen
--------------------------------------------------------------------*/
-
void SwBaseShell::Execute(SfxRequest &rReq)
{
const SfxPoolItem *pItem;
@@ -765,22 +744,6 @@ void SwBaseShell::Execute(SfxRequest &rReq)
{
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) );
GetView().GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON, &aMediaURLItem, 0L );
-/*
- String sURL( pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) );
- String sLabel( pGal->GetURL().getBase() );
- String sTarget; // empty string!
-
- bool bIsHTMLMode =
- 0 == ( HTMLMODE_ON &
- ::GetHtmlMode( GetView().GetDocShell() ) );
-
- // in Writer, we insert a button which plays the
- // sound. In Writer/Web, we just insert a (text) link.
- if( bIsHTMLMode )
- InsertURLButton( sURL, sTarget, sLabel );
- else
- rSh.InsertURL( SwFmtINetFmt( sURL, sTarget ), sLabel );
-*/
}
}
}
@@ -875,11 +838,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwConvertTableDlg* pDlg = pFact->CreateSwConvertTableDlg(
GetView(),DLG_CONV_TEXT_TABLE , bToTable);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute() )
{
pDlg->GetValues( cDelim, aInsTblOpts, pTAFmt );
@@ -1182,7 +1145,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
static_cast<const SfxBoolItem*>( pItem )->GetValue();
// set form design mode
- DBG_ASSERT( GetView().GetFormShell() != NULL, "form shell?" );
+ OSL_ENSURE( GetView().GetFormShell() != NULL, "form shell?" );
SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE );
aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
GetView().GetFormShell()->Execute( aReq );
@@ -1241,7 +1204,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
case FN_PAGE_STYLE_SET_PAPER_SIZE:
case FN_PAGE_STYLE_SET_PAPER_BIN:
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
break;
@@ -1268,13 +1231,13 @@ void SwBaseShell::Execute(SfxRequest &rReq)
}
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_FAIL("wrong Dispatcher");
}
}
}
-/* -----------------14.04.99 15:10-------------------
+/* --------------------------------------------------
* Hier wird der State fuer SID_IMAP / SID_CONTOUR behandelt,
* wenn die Grafik ausgeswappt ist
* --------------------------------------------------*/
@@ -1284,16 +1247,17 @@ IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , EMPTYARG )
SwWrtShell &rSh = GetShell();
if( CNT_GRF == rSh.SwEditShell::GetCntType() &&
GRAPHIC_NONE != ( nGrfType = rSh.GetGraphicType() ) &&
- aGrfUpdateSlots.Count() )
+ !aGrfUpdateSlots.empty() )
{
sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT);
SfxViewFrame* pVFrame = GetView().GetViewFrame();
sal_uInt16 nSlot;
- for( sal_uInt16 n = 0; n < aGrfUpdateSlots.Count(); ++n )
+ std::set<sal_uInt16>::iterator it;
+ for( it = aGrfUpdateSlots.begin(); it != aGrfUpdateSlots.end(); ++it )
{
sal_Bool bSetState = sal_False;
sal_Bool bState = sal_False;
- switch( nSlot = aGrfUpdateSlots[ n ] )
+ switch( nSlot = *it )
{
case SID_IMAP:
case SID_IMAP_EXEC:
@@ -1365,7 +1329,7 @@ IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , EMPTYARG )
pVFrame->GetBindings().SetState( aBool );
}
}
- aGrfUpdateSlots.RemoveAt( 0, aGrfUpdateSlots.Count() );
+ aGrfUpdateSlots.clear();
}
return 0;
}
@@ -1454,7 +1418,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
break;
case SID_IMAP:
{
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// improve efficiency:
// If selected object is protected, item has to disabled.
const sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT);
@@ -1470,7 +1434,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
const sal_Bool bIsGraphicSelection =
rSh.GetSelectionType() == nsSelectionType::SEL_GRF;
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// avoid unnecessary loading of selected graphic.
// The graphic is only needed, if the dialog is open.
//wenn die Grafik ausgeswappt ist, dann muss der
@@ -1498,9 +1462,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
rSet.Put(aBool);
}
}
- // <--
}
- // <--
}
break;
case SID_IMAP_EXEC:
@@ -1549,7 +1511,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
sal_Bool bDisable = sal_False;
if( !bHas && !bOk )
bDisable = sal_True;
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// avoid unnecessary loading of selected graphic.
// The graphic is only needed, if the dialog is open.
// wenn die Grafik ausgeswappt ist, dann muss der Status
@@ -1560,23 +1522,20 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
{
if( AddGrfUpdateSlot( nWhich ))
rSh.GetGraphic(sal_False); // start the loading
- // --> OD 2007-07-04 #i75481#
+ // #i75481#
bDisable = sal_True;
- // <--
}
else if( bHas && bOk )
bDisable = !lcl_UpdateContourDlg( rSh, nSel );
else if( bOk )
{
- // --> OD 2007-07-04 #i75481#
+ // #i75481#
// apply fix #i59688# only for selected graphics
if ( nSel & nsSelectionType::SEL_GRF )
bDisable = GRAPHIC_NONE == rSh.GetGraphicType();
else
bDisable = GRAPHIC_NONE == rSh.GetIMapGraphic().GetType();
- // <--
}
- // <--
if( bDisable )
rSet.DisableItem( nWhich );
@@ -1820,8 +1779,6 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
/*--------------------------------------------------------------------
Beschreibung: Slots mit dieser Statusmethode disablen
--------------------------------------------------------------------*/
-
-
void SwBaseShell::StateDisableItems( SfxItemSet &rSet )
{
SfxWhichIter aIter(rSet);
@@ -1837,8 +1794,6 @@ void SwBaseShell::StateDisableItems( SfxItemSet &rSet )
/*--------------------------------------------------------------------
Beschreibung: Slots mit dieser Statusmethode disablen
--------------------------------------------------------------------*/
-
-
void SwBaseShell::StateStyle( SfxItemSet &rSet )
{
sal_Bool bParentCntProt = GetShell().IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
@@ -1863,11 +1818,6 @@ void SwBaseShell::StateStyle( SfxItemSet &rSet )
GetView().GetDocShell()->StateStyleSheet(rSet, &GetShell());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
{
SwWrtShell &rSh = GetShell();
@@ -1895,15 +1845,14 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
break;
case FN_WRAP_ANCHOR_ONLY:
aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly());
- // --> OD 2006-06-02 #b6432130#
+ //
// keep previous wrapping
- // --> OD 2006-09-21 #138144# - adjust fix #b6432130#
+ //
// switch to wrap SURROUND_PARALLEL, if previous wrap is SURROUND_NONE
if ( nOldSurround != SURROUND_NONE )
{
nSurround = nOldSurround;
}
- // <--
break;
case FN_FRAME_WRAP_CONTOUR:
aWrap.SetContour(!aWrap.IsContour());
@@ -1959,7 +1908,6 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
/*--------------------------------------------------------------------
Beschreibung: Update der Statuszeile erzwingen
--------------------------------------------------------------------*/
-
void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh )
{
eFrameMode = eMode;
@@ -1975,7 +1923,7 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh )
}
else if( eMode == FLY_DRAG_END )
{
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_POSITION, SID_ATTR_SIZE, 0
};
@@ -1986,7 +1934,6 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh )
/*--------------------------------------------------------------------
Beschreibung: Ctor
--------------------------------------------------------------------*/
-
SwBaseShell::SwBaseShell(SwView& rVw) :
SfxShell( &rVw ),
rView(rVw),
@@ -1999,7 +1946,6 @@ SwBaseShell::SwBaseShell(SwView& rVw) :
rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl));
}
-
SwBaseShell::~SwBaseShell()
{
if( rView.GetCurShell() == this )
@@ -2010,10 +1956,6 @@ SwBaseShell::~SwBaseShell()
rView.GetWrtShell().SetGrfArrivedLnk( Link() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq )
{
const SfxItemSet *pArgs = rReq.GetArgs();
@@ -2139,10 +2081,6 @@ void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq )
rReq.Done();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwBaseShell::GetTxtCtrlState( SfxItemSet& rSet )
{
SwWrtShell &rSh = GetShell();
@@ -2229,10 +2167,6 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet )
delete pFntCoreSet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwBaseShell::GetBckColState(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
@@ -2240,7 +2174,6 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
sal_uInt16 nWhich = aIter.FirstWhich();
int nSelType = rSh.GetSelectionType();
-// if ( nSelType & nsSelectionType::SEL_GRF ||
if( nSelType & nsSelectionType::SEL_OLE )
{
rSet.DisableItem( SID_BACKGROUND_COLOR );
@@ -2290,10 +2223,6 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwBaseShell::ExecBckCol(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -2324,8 +2253,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
}
-// sal_Bool bMsgOk = sal_False;
-
switch (nSlot)
{
// RES_BACKGROUND (=SID_ATTR_BRUSH) muss ueber zwei IDs
@@ -2334,7 +2261,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
{
aBrushItem.SetGraphicPos(GPOS_NONE);
- //Brush &rBrush = aBrushItem.GetBrush();
if(pArgs)
{
const SvxColorItem& rNewColorItem = (const SvxColorItem&)
@@ -2360,9 +2286,8 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
}
break;
default:
-// bMsgOk = sal_False;
rReq.Ignore();
- DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" );
+ OSL_FAIL("unknown message in ExecuteAttr!" );
return;
}
@@ -2398,11 +2323,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
rReq.Done();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwBaseShell::GetBorderState(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
@@ -2434,11 +2354,6 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet)
rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode ));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwBaseShell::ExecDlg(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -2456,6 +2371,14 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
switch ( nSlot )
{
+ case FN_FORMAT_TITLEPAGE_DLG:
+ {
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ VclAbstractDialog* pDlg = pFact->CreateTitlePageDlg( pMDI );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ break;
case FN_FORMAT_PAGE_COLUMN_DLG:
case FN_FORMAT_PAGE_DLG:
{
@@ -2487,10 +2410,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
rSh.GetTabBorders( aSet );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
@@ -2504,10 +2427,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
aSet.Put( aMgr.GetAttrSet() );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
@@ -2522,10 +2445,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetAttr( *pDlg->GetOutputItemSet() );
@@ -2547,7 +2470,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
SfxAbstractDialog * pDlg = 0;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
// Tabellenzelle(n) selektiert?
@@ -2559,11 +2482,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
aSet.Put( aBrush );
if ( pDlg->Execute() == RET_OK )
{
- //aBrush = (SvxBrushItem) pDlg->GetOutputItemSet()->Get( RES_BACKGROUND );
rSh.SetBoxBackground( (SvxBrushItem&)
pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ));
@@ -2578,7 +2500,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetFlyFrmAttr((SfxItemSet &) *pDlg->GetOutputItemSet() );
@@ -2593,7 +2515,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetAttr( *pDlg->GetOutputItemSet() );
@@ -2609,29 +2531,22 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
}
break;
- default:DBG_ERROR("falscher Dispatcher (basesh.cxx)");
+ default:OSL_FAIL("wrong Dispatcher (basesh.cxx)");
}
if(!bDone)
rReq.Done();
}
-// ----------------------------------------------------------------------------
-
-
SwWrtShell& SwBaseShell::GetShell()
{
return rView.GetWrtShell();
}
-// ----------------------------------------------------------------------------
-
SwWrtShell* SwBaseShell::GetShellPtr()
{
return rView.GetWrtShellPtr();
}
-// ----------------------------------------------------------------------------
-
void SwBaseShell::InsertTable( SfxRequest& _rRequest )
{
const SfxItemSet* pArgs = _rRequest.GetArgs();
@@ -2710,9 +2625,9 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
if( !nCols || !nRows )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsTableDlg* pDlg = pFact->CreateInsTableDlg( DLG_INSERT_TABLE, rTempView );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute() )
{
pDlg->GetValues( aTableName, nRows, nCols, aInsTblOpts, aAutoName, pTAFmt );
@@ -2768,8 +2683,6 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
}
}
-// ----------------------------------------------------------------------------
-
void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
{
SwWrtShell &rSh = GetShell();
@@ -2781,12 +2694,12 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
{
int nSel = rSh.GetSelectionType();
SfxStringListItem aLst( nWhich );
- List *pLst = aLst.GetList();
+ std::vector<String> &rLst = aLst.GetList();
nParagraphPos = nGraphicPos = nOlePos = nFramePos = nTablePos =
nTableRowPos = nTableCellPos = nPagePos =
nHeaderPos = nFooterPos = 0;
sal_uInt8 nPos = 1;
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PAGE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_PAGE ) );
nPagePos = nPos++;
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
sal_Bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
@@ -2794,63 +2707,62 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
(nSel & nsSelectionType::SEL_TXT) )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PARAGRAPH ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_PARAGRAPH ) );
nParagraphPos = nPos++;
}
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
nSel & (nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE ) );
nTablePos = nPos++;
if(!bHtmlMode)
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_ROW ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE_ROW ) );
nTableRowPos = nPos++;
}
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_CELL), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE_CELL) );
nTableCellPos = nPos++;
}
if(!bHtmlMode)
{
if ( nSel & nsSelectionType::SEL_FRM )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FRAME ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_FRAME ) );
nFramePos = nPos++;
}
if ( nSel & nsSelectionType::SEL_GRF )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_GRAPHIC ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_GRAPHIC ) );
nGraphicPos = nPos++;
}
if ( nSel & nsSelectionType::SEL_OLE )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_OLE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_OLE ) );
nOlePos = nPos++;
}
const sal_uInt16 nType = rSh.GetFrmType(0,sal_True);
if ( nType & FRMTYPE_HEADER )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_HEADER ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_HEADER ) );
nHeaderPos = nPos++;
}
if ( nType & FRMTYPE_FOOTER )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FOOTER ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_FOOTER ) );
nFooterPos = nPos;
}
}
- if ( pLst->Count() )
- rSet.Put( aLst );
- else
+ if ( rLst.empty() )
rSet.DisableItem( nWhich );
+ else
+ rSet.Put( aLst );
break;
}
}
}
-
void SwBaseShell::ExecuteGallery(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -2919,16 +2831,17 @@ void SwBaseShell::ExecField( SfxRequest& rReq )
case FN_CHANGE_DBFIELD:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/beziersh.cxx b/sw/source/ui/shells/beziersh.cxx
index ce3f3c9cc1f6..2b047d644c19 100644
--- a/sw/source/ui/shells/beziersh.cxx
+++ b/sw/source/ui/shells/beziersh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,6 @@
#include <unomid.h>
-
SFX_IMPL_INTERFACE(SwBezierShell, SwBaseShell, SW_RES(STR_SHELLNAME_BEZIER))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_DRAW_POPUPMENU));
@@ -63,11 +63,6 @@ SFX_IMPL_INTERFACE(SwBezierShell, SwBaseShell, SW_RES(STR_SHELLNAME_BEZIER))
TYPEINIT1(SwBezierShell,SwBaseShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwBezierShell::SwBezierShell(SwView &_rView):
SwBaseShell( _rView )
{
@@ -79,11 +74,6 @@ SwBezierShell::SwBezierShell(SwView &_rView):
pSdrView->SetEliminatePolyPointLimitAngle(1500L);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwBezierShell::Execute(SfxRequest &rReq)
{
SwWrtShell *pSh = &GetShell();
@@ -140,7 +130,7 @@ void SwBezierShell::Execute(SfxRequest &rReq)
case SID_BEZIER_INSERT:
{
GetView().GetEditWin().SetBezierMode(nSlotId);
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{
SID_BEZIER_INSERT,
SID_BEZIER_MOVE,
@@ -200,7 +190,7 @@ void SwBezierShell::Execute(SfxRequest &rReq)
{
pSdrView->SetMarkedPointsSmooth(eKind);
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{
SID_BEZIER_SMOOTH,
SID_BEZIER_EDGE,
@@ -239,11 +229,6 @@ void SwBezierShell::Execute(SfxRequest &rReq)
pSdrView->GetModel()->SetChanged(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwBezierShell::GetState(SfxItemSet &rSet)
{
SdrView* pSdrView = GetShell().GetDrawView();
@@ -352,5 +337,4 @@ void SwBezierShell::GetState(SfxItemSet &rSet)
}
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index 7798c49ac119..63b75a1acb1d 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,15 +30,8 @@
#include "precompiled_sw.hxx"
-
-
-
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdview.hxx>
@@ -55,11 +49,6 @@
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
{
SwWrtShell* pSh = &GetShell();
@@ -104,15 +93,15 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
sal_Bool bHasMarked = pView->AreObjectsMarked();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
+ OSL_ENSURE(pFact, "Dialogdiet Factory fail!");
AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL,
&aNewAttr,
pDoc,
pView);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
- if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+ if(pColorItem->GetColorTable() == &XColorTable::GetStdColorTable())
pDlg->DontDeleteColorTable();
if (pDlg->Execute() == RET_OK)
{
@@ -123,7 +112,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), sal_False);
pSh->EndAction();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, 0
};
@@ -146,13 +135,13 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
+ OSL_ENSURE(pFact, "Dialogdiet Factory fail!");
SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( NULL,
&aNewAttr,
pDoc,
pObj,
bHasMarked);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (pDlg->Execute() == RET_OK)
{
pSh->StartAction();
@@ -162,7 +151,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), sal_False);
pSh->EndAction();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_LINE_STYLE, SID_ATTR_LINE_WIDTH,
SID_ATTR_LINE_COLOR, 0
@@ -186,11 +175,6 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pDoc->SetChanged(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq)
{
SwWrtShell* pSh = &GetShell();
@@ -235,11 +219,6 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq)
pView->GetModel()->SetChanged(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
{
SdrView* pSdrView = GetShell().GetDrawView();
@@ -255,5 +234,4 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
rSet.Put(pSdrView->GetDefaultAttr());
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index dd632b66edcb..dcf352bf52aa 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,7 +69,7 @@
#define SwDrawShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
-#include "swabstdlg.hxx" //CHINA001
+#include "swabstdlg.hxx"
#include "misc.hrc"
using namespace ::com::sun::star;
@@ -83,11 +84,6 @@ SFX_IMPL_INTERFACE(SwDrawShell, SwDrawBaseShell, SW_RES(STR_SHELLNAME_DRAW))
TYPEINIT1(SwDrawShell,SwDrawBaseShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDrawShell::Execute(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -197,10 +193,10 @@ void SwDrawShell::Execute(SfxRequest &rReq)
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -209,10 +205,10 @@ void SwDrawShell::Execute(SfxRequest &rReq)
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -222,7 +218,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
{
try
{
- uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
+ uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -247,7 +243,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -289,7 +285,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
break;
default:
- DBG_ASSERT(!this, "falscher Dispatcher");
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
if (pSdrView->GetModel()->IsChanged())
@@ -298,12 +294,6 @@ void SwDrawShell::Execute(SfxRequest &rReq)
pSdrView->GetModel()->SetChanged(sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwDrawShell::GetState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
@@ -377,12 +367,6 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
svx::FontworkBar::getState( pSdrView, rSet );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwDrawShell::SwDrawShell(SwView &_rView) :
SwDrawBaseShell(_rView)
{
@@ -395,9 +379,6 @@ SwDrawShell::SwDrawShell(SwView &_rView) :
|* SfxRequests fuer FontWork bearbeiten
|*
\************************************************************************/
-
-
-
void SwDrawShell::ExecFormText(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -449,9 +430,6 @@ void SwDrawShell::ExecFormText(SfxRequest& rReq)
|* Statuswerte fuer FontWork zurueckgeben
|*
\************************************************************************/
-
-
-
void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
@@ -486,12 +464,10 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx
index 13b1f1059b8d..fca6bb3aaf07 100644
--- a/sw/source/ui/shells/drformsh.cxx
+++ b/sw/source/ui/shells/drformsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,7 +120,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
- ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+ OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
if( !xControlModel.is() )
return;
@@ -169,7 +170,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
break;
default:
- DBG_ASSERT(!this, "falscher Dispatcher");
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
@@ -196,7 +197,7 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet)
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
- ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+ OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
if( !xControlModel.is() )
return;
@@ -274,3 +275,4 @@ SwDrawFormShell::~SwDrawFormShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 70aba0ae2a8f..5b5756e265c0 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,11 +86,6 @@ SFX_IMPL_INTERFACE(SwDrawBaseShell, SwBaseShell, SW_RES(0))
TYPEINIT1(SwDrawBaseShell,SwBaseShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwDrawBaseShell::SwDrawBaseShell(SwView &_rView):
SwBaseShell( _rView )
{
@@ -105,11 +101,6 @@ SwDrawBaseShell::SwDrawBaseShell(SwView &_rView):
SwTransferable::CreateSelection( GetShell() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwDrawBaseShell::~SwDrawBaseShell()
{
GetView().ExitDraw();
@@ -117,11 +108,6 @@ SwDrawBaseShell::~SwDrawBaseShell()
SwTransferable::ClearSelection( GetShell() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwDrawBaseShell::Execute(SfxRequest &rReq)
{
SwWrtShell *pSh = &GetShell();
@@ -137,7 +123,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
//Sonderfall Align per Menue
if(pItem && nSlotId == SID_OBJECT_ALIGN)
{
- DBG_ASSERT(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem erwartet");
+ OSL_ENSURE(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem expected");
nSlotId = nSlotId + ((const SfxEnumItem*)pItem)->GetValue();
nSlotId++;
}
@@ -174,10 +160,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
pSh->GetObjAttr(aSet);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSwWrapDlg( GetView().GetWindow(), aSet, pSh, sal_True, RC_DLG_SWWRAPDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (pDlg->Execute() == RET_OK)
{
@@ -236,7 +222,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
pFact->CreateCaptionDialog( NULL, pSdrView, nAllowedAnchors );
pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
pDlg = pCaptionDlg;
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
}
else
@@ -249,7 +235,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
pFact->CreateSvxTransformTabDialog( NULL, NULL, pSdrView, nAllowedAnchors );
pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) );
pDlg = pTransform;
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
}
SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
@@ -294,7 +280,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
pSh->StartAllAction();
- // --> OD 2004-07-14 #i30451#
+ // #i30451#
pSh->StartUndo(UNDO_INSFMTATTR);
pSdrView->SetGeoAttrToMarked(*pOutSet);
@@ -377,7 +363,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
rBind.InvalidateAll(sal_False);
- // --> OD 2004-07-14 #i30451#
+ // #i30451#
pSh->EndUndo( UNDO_INSFMTATTR );
pSh->EndAllAction();
@@ -422,7 +408,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
{
pSh->LeaveSelFrmMode();
// #105852# FME
-// pSh->NoEdit();
}
bNotify = sal_True;
}
@@ -616,7 +601,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
}
default:
- DBG_ASSERT(!this, "falscher Dispatcher");
+ OSL_ENSURE(!this, "wrong Dispatcher");
return;
}
if(!bDone)
@@ -632,7 +617,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
GetView().AttrChangedNotify(pSh); // ggf Shellwechsel...
}
}
-/* -----------------------------27.02.2002 15:27------------------------------
+
+/* ---------------------------------------------------------------------------
Checks whether a given name is allowed for a group shape
---------------------------------------------------------------------------*/
IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNameDialog )
@@ -640,7 +626,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
SwWrtShell &rSh = GetShell();
SdrView *pSdrView = rSh.GetDrawView();
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- DBG_ASSERT(rMarkList.GetMarkCount() == 1, "wrong draw selection");
+ OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const String sCurrentName = pObj->GetName();
String sNewName;
@@ -652,19 +638,6 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
{
nRet = 1;
SdrModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel();
- // --> OD 2006-03-09 #i51726# - all drawing objects can be named now.
- // consider also drawing objects inside group objects
-// SdrPage* pPage = pModel->GetPage(0);
-// sal_uInt32 nCount = pPage->GetObjCount();
-// for( sal_uInt32 i=0; i< nCount; i++ )
-// {
-// SdrObject* pTemp = pPage->GetObj(i);
-// if(pObj != pTemp && pTemp->ISA(SdrObjGroup) && pTemp->GetName() == sNewName)
-// {
-// nRet = 0;
-// break;
-// }
-// }
SdrObjListIter aIter( *(pModel->GetPage(0)), IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
{
@@ -675,13 +648,10 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
break;
}
}
- // <--
}
return nRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
void SwDrawBaseShell::GetState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
@@ -774,11 +744,6 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_Bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
{
sal_Bool bDisable = GetShell().IsSelObjProtected(FLYPROTECT_CONTENT);
@@ -802,7 +767,7 @@ sal_Bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
return bDisable;
}
-/*-- 09.03.2004 13:15:03---------------------------------------------------
+/*-------------------------------------------------------------------------
Validate of drawing positions
-----------------------------------------------------------------------*/
IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation )
@@ -995,6 +960,4 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation
return 0;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index c9381d68db04..0deab441cb60 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,6 @@
#include <editeng/adjitem.hxx>
#include <editeng/crsditem.hxx>
#include <editeng/shdditem.hxx>
-#include <editeng/hyznitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
@@ -63,18 +63,13 @@
#include <svl/ctloptions.hxx>
#include <svtools/langtab.hxx>
#include <svl/languageoptions.hxx>
-#include <sfx2/bindings.hxx>
#include <vcl/msgbox.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/request.hxx>
#include <editeng/flditem.hxx>
#include <editeng/editstat.hxx>
#include <svx/hlnkitem.hxx>
#include <svx/htmlmode.hxx>
-#include <svl/languageoptions.hxx>
#include <svl/slstitm.hxx>
#include <editeng/langitem.hxx>
-#include <svtools/langtab.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/writingmodeitem.hxx>
@@ -86,26 +81,6 @@
#include <editeng/editview.hxx>
#include <vcl/outdev.hxx>
#include <editeng/hyznitem.hxx>
-#include <editeng/kernitem.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/lspcitem.hxx>
-#include <editeng/orphitem.hxx>
-#include <editeng/outliner.hxx>
-#include <editeng/postitem.hxx>
-#include <editeng/scripttypeitem.hxx>
-#include <editeng/shdditem.hxx>
-#include <editeng/spltitem.hxx>
-#include <svx/svdoutl.hxx>
-#include <svx/svdview.hxx>
-#include <editeng/udlnitem.hxx>
-#include <editeng/unolingu.hxx>
-#include <editeng/wghtitem.hxx>
-#include <editeng/widwitem.hxx>
-#include <editeng/writingmodeitem.hxx>
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/window.hxx>
#include <cmdid.h>
#include <doc.hxx>
@@ -132,14 +107,8 @@
#include "misc.hrc"
-#include <langhelper.hxx>
-
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDrawTextShell::Execute( SfxRequest &rReq )
{
SwWrtShell &rSh = GetShell();
@@ -317,10 +286,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR,0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet )
{
@@ -338,10 +307,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -350,10 +319,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -363,7 +332,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
{
try
{
- uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
+ uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -388,7 +357,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -414,10 +383,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aDlgAttr.Put(aEditAttr);
- // Die Werte sind erst einmal uebernommen worden, um den Dialog anzuzeigen.
- // Muss natuerlich noch geaendert werden
- // aDlgAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) );
-
aDlgAttr.Put( SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE) );
aDlgAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
aDlgAttr.Put( SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT ) );
@@ -425,10 +390,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet)
{
@@ -555,7 +520,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
return;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
if(nEEWhich && pNewAttrs)
@@ -575,10 +540,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDrawTextShell::GetState(SfxItemSet& rSet)
{
if (!IsTextEdit()) // Sonst manchmal Absturz!
@@ -801,9 +762,6 @@ ASK_ESCAPE:
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet)
{
if (!IsTextEdit()) // Sonst Absturz!
@@ -868,9 +826,6 @@ void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq)
{
if (!IsTextEdit()) // Sonst Absturz!
@@ -898,7 +853,7 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq)
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_FAIL("wrong dispatcher");
return;
}
}
@@ -945,11 +900,10 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
case SID_PASTE_SPECIAL:
rSet.DisableItem( SID_PASTE_SPECIAL );
break;
- // --> OD 2008-06-20 #151110#
+ // #151110#
case SID_CLIPBOARD_FORMAT_ITEMS:
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
break;
- // <--
}
nWhich = aIter.NextWhich();
}
@@ -958,7 +912,6 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
/*--------------------------------------------------------------------
Beschreibung: Hyperlink-Status
--------------------------------------------------------------------*/
-
void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
{
if (!IsTextEdit()) // Sonst Absturz!
@@ -1010,3 +963,4 @@ void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 8e4dfd362c15..20c5f0707644 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,19 +68,13 @@
#include <cmdid.h>
#include <helpid.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
#define SwDrawTextShell
#include <sfx2/msg.hxx>
#include <swslots.hxx>
-#ifndef _POPUP_HRC
#include <popup.hrc>
-#endif
#include <uitool.hxx>
#include <wview.hxx>
#include <swmodule.hxx>
@@ -88,12 +83,9 @@
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
-#include <svx/svxdlg.hxx>
-#include <svx/dialogs.hrc>
-
#include <cppuhelper/bootstrap.hxx>
-#include "swabstdlg.hxx" //CHINA001
+#include "swabstdlg.hxx"
#include "misc.hrc"
using namespace ::com::sun::star;
@@ -101,8 +93,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::i18n;
-
-
SFX_IMPL_INTERFACE(SwDrawTextShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_DRWTXT_POPUPMENU));
@@ -112,12 +102,6 @@ SFX_IMPL_INTERFACE(SwDrawTextShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
TYPEINIT1(SwDrawTextShell,SfxShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::Init()
{
SwWrtShell &rSh = GetShell();
@@ -146,11 +130,6 @@ void SwDrawTextShell::Init()
pOLV->ShowCursor();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwDrawTextShell::SwDrawTextShell(SwView &rV) :
SfxShell(&rV),
rView(rV)
@@ -165,28 +144,10 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) :
SetHelpId(SW_DRWTXTSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
-__EXPORT SwDrawTextShell::~SwDrawTextShell()
+SwDrawTextShell::~SwDrawTextShell()
{
if ( GetView().GetCurShell() == this )
rView.ResetSubShell();
-
- //MA 13. Nov. 96: Das kommt durchaus vor #33141#:
- //(doppel-)Klick von einem Texteditmode in ein anderes Objekt, zwischendurch
- //wird eine andere (Draw-)Shell gepusht, die alte aber noch nicht deletet.
- //Dann wird vor dem Flush wieder ein DrawTextShell gepusht und der Mode ist
- //eingeschaltet. In diesem Moment wird der Dispatcher geflusht und die alte
- //DrawTextShell zerstoert.
-// ASSERT( !pSdrView->IsTextEdit(), "TextEdit in DTor DrwTxtSh?" );
-// if (pSdrView->IsTextEdit())
-// GetShell().EndTextEdit(); // Danebengeklickt, Ende mit Edit
-
-// GetShell().Edit();
}
SwWrtShell& SwDrawTextShell::GetShell()
@@ -194,11 +155,9 @@ SwWrtShell& SwDrawTextShell::GetShell()
return rView.GetWrtShell();
}
-
/*--------------------------------------------------------------------
Beschreibung: Slots mit dieser Statusmethode disablen
--------------------------------------------------------------------*/
-
void SwDrawTextShell::StateDisableItems( SfxItemSet &rSet )
{
SfxWhichIter aIter(rSet);
@@ -211,15 +170,11 @@ void SwDrawTextShell::StateDisableItems( SfxItemSet &rSet )
}
}
-
/*************************************************************************
|*
|* Attribute setzen
|*
\************************************************************************/
-
-
-
void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr)
{
Rectangle aNullRect;
@@ -233,23 +188,11 @@ void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
sal_Bool SwDrawTextShell::IsTextEdit()
{
return pSdrView->IsTextEdit();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::ExecFontWork(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -268,12 +211,6 @@ void SwDrawTextShell::ExecFontWork(SfxRequest& rReq)
pVFrame->GetBindings().Invalidate(SID_FONTWORK);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::StateFontWork(SfxItemSet& rSet)
{
const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
@@ -285,9 +222,6 @@ void SwDrawTextShell::StateFontWork(SfxItemSet& rSet)
|* SfxRequests fuer FontWork bearbeiten
|*
\************************************************************************/
-
-
-
void SwDrawTextShell::ExecFormText(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -337,9 +271,6 @@ void SwDrawTextShell::ExecFormText(SfxRequest& rReq)
|* Statuswerte fuer FontWork zurueckgeben
|*
\************************************************************************/
-
-
-
void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
@@ -373,18 +304,12 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -414,7 +339,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
{
Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog")
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog"))
, xContext), UNO_QUERY);
Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
if( xInit.is() )
@@ -424,7 +349,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
Sequence<Any> aSeq(1);
Any* pArray = aSeq.getArray();
PropertyValue aParam;
- aParam.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam.Value <<= makeAny(xDialogParentWindow);
pArray[0] <<= makeAny(aParam);
xInit->initialize( aSeq );
@@ -473,14 +398,11 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
break;
default:
- ASSERT(!this, "unexpected slot-id");
+ OSL_ENSURE(!this, "unexpected slot-id");
}
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -589,7 +511,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
break;
default:
- ASSERT(!this, "unexpected slot-id");
+ OSL_ENSURE(!this, "unexpected slot-id");
return;
}
@@ -602,9 +524,6 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
/*--------------------------------------------------------------------
Beschreibung: Undo ausfuehren
--------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::ExecUndo(SfxRequest &rReq)
{
if( IsTextEdit() )
@@ -650,9 +569,6 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq)
/*--------------------------------------------------------------------
Beschreibung: Zustand Undo
--------------------------------------------------------------------*/
-
-
-
void SwDrawTextShell::StateUndo(SfxItemSet &rSet)
{
if ( !IsTextEdit() )
@@ -712,58 +628,79 @@ void SwDrawTextShell::StateUndo(SfxItemSet &rSet)
void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq )
{
+ if (!pSdrView)
+ return;
+
using namespace i18n;
+
+ sal_uInt32 nMode = 0;
+
+ switch( rReq.GetSlot() )
{
- sal_uInt32 nMode = 0;
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
+ case SID_TRANSLITERATE_UPPER:
+ nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ break;
+ case SID_TRANSLITERATE_LOWER:
+ nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ break;
- switch( rReq.GetSlot() )
- {
- case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
- break;
- case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
- break;
- case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
- break;
- case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
- break;
- case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
- break;
+ case SID_TRANSLITERATE_HALFWIDTH:
+ nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ break;
+ case SID_TRANSLITERATE_FULLWIDTH:
+ nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ break;
- case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
- break;
- case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
- break;
+ case SID_TRANSLITERATE_HIRAGANA:
+ nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ break;
+ case SID_TRANSLITERATE_KATAGANA:
+ nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ break;
- case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
- break;
- case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
- break;
+ default:
+ OSL_ENSURE(!this, "wrong dispatcher");
+ }
- default:
- ASSERT(!this, "falscher Dispatcher");
- }
+ if( nMode )
+ {
+ OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- if( nMode )
- {
- OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- pOLV->TransliterateText( nMode );
- }
+ if (!pOLV)
+ return;
+
+ pOLV->TransliterateText( nMode );
+ }
+}
+
+void SwDrawTextShell::ExecRotateTransliteration( SfxRequest & rReq )
+{
+ if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
+ {
+ if (!pSdrView)
+ return;
+
+ OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
+
+ if (!pOLV)
+ return;
+
+ pOLV->TransliterateText( m_aRotateCase.getNextMode() );
}
}
/*--------------------------------------------------------------------
Beschreibung: Sonderzeichen einfuegen (siehe SDraw: FUBULLET.CXX)
--------------------------------------------------------------------*/
-
void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
{
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
@@ -896,9 +833,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
rReq.Done();
}
}
-/*-- 22.10.2003 14:26:32---------------------------------------------------
- -----------------------------------------------------------------------*/
::svl::IUndoManager* SwDrawTextShell::GetUndoManager()
{
SwWrtShell &rSh = GetShell();
@@ -908,5 +843,4 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
return &pOutliner->GetUndoManager();
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 07d88ea5ac5d..9763e08bdc56 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include <hintids.hxx>
#include <svl/whiter.hxx>
#include <svtools/imapobj.hxx>
+#include <svtools/miscopt.hxx>
#include <svl/srchitem.hxx>
#include <svtools/imap.hxx>
#include <sfx2/viewfrm.hxx>
@@ -47,10 +49,9 @@
#include <sfx2/request.hxx>
#include <sfx2/objface.hxx>
#include <svx/hlnkitem.hxx>
-// --> OD 2009-07-07 #i73249#
+// #i73249#
#include <svx/svdview.hxx>
#include <vcl/msgbox.hxx>
-// <--
#include <doc.hxx>
#include <fmturl.hxx>
@@ -84,15 +85,21 @@
#include <shells.hrc>
#include "swabstdlg.hxx"
#include "misc.hrc"
-// --> OD 2009-07-14 #i73249#
+// #i73249#
#include <svx/dialogs.hrc>
-// <--
+#include <sfx2/filedlghelper.hxx>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/uno/Any.h>
+
+using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
// Prototypen ------------------------------------------------------------
-
void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine);
const SwFrmFmt* lcl_GetFrmFmtByName(SwWrtShell& rSh, const String& rName)
{
@@ -116,7 +123,9 @@ SFX_IMPL_INTERFACE(SwFrameShell, SwBaseShell, SW_RES(STR_SHELLNAME_FRAME))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_FRAME_TOOLBOX));
}
-
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XDispatchHelper.hpp>
void SwFrameShell::Execute(SfxRequest &rReq)
{
@@ -129,6 +138,135 @@ void SwFrameShell::Execute(SfxRequest &rReq)
switch ( nSlot )
{
+ case FN_EXPORT_OLE_AS_GRAPHIC:
+ {
+ const int nSel = rSh.GetSelectionType();
+ if (nSel & nsSelectionType::SEL_OLE)
+ {
+ sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
+ aDlgHelper.SetTitle(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as JPG" )));
+ String aExt(RTL_CONSTASCII_USTRINGPARAM("*.jpg"));
+ aDlgHelper.AddFilter( aExt, aExt );
+ aDlgHelper.SetCurrentFilter( aExt );
+ if( aDlgHelper.Execute() == ERRCODE_NONE )
+ {
+ String aFile(aDlgHelper.GetPath());
+ // copy the object
+ uno::Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController();
+ uno::Reference< frame::XFrame > xFrame = xController->getFrame();
+ uno::Reference< frame::XDispatchHelper > xDispatchHelper(::comphelper::getProcessServiceFactory()->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.DispatchHelper" )) ),
+ uno::UNO_QUERY );
+ uno::Reference< frame::XDispatchProvider > xDispatchProvider(xFrame,UNO_QUERY);
+ xDispatchHelper->executeDispatch(xDispatchProvider, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Copy")),
+ ::rtl::OUString(), 0,
+ Sequence < ::com::sun::star::beans::PropertyValue >());
+ // create new draw document
+ ::beans::PropertyValues aPropertyValue(1);
+ aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) );
+ aPropertyValue[0].Value <<= sal_Bool(sal_False);
+
+ uno::Reference< ::frame::XComponentLoader > xLoader(xFrame, UNO_QUERY);
+ uno::Reference< ::lang::XComponent > xDrawComponent( xLoader->loadComponentFromURL(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sdraw" ) ),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" ) ), 0,
+ aPropertyValue));
+
+ // paste it into draw
+ uno::Reference< frame::XModel > xDrawModel(xDrawComponent, UNO_QUERY);
+ xController = xDrawModel->getCurrentController();
+ xFrame = xController->getFrame();
+ uno::Reference< frame::XDispatchProvider > xDrawDispatchProvider(xFrame,UNO_QUERY);
+
+ xDispatchHelper->executeDispatch(xDrawDispatchProvider,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Paste")),
+ ::rtl::OUString(), 0,
+ Sequence < ::com::sun::star::beans::PropertyValue >());
+ xDispatchHelper->executeDispatch(xDrawDispatchProvider,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignUp")),
+ ::rtl::OUString(), 0,
+ Sequence < ::com::sun::star::beans::PropertyValue >());
+ xDispatchHelper->executeDispatch(xDrawDispatchProvider,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignCenter")),
+ ::rtl::OUString(), 0,
+ Sequence < ::com::sun::star::beans::PropertyValue >());
+ // export as jpeg
+ xController = xFrame->getController();
+ aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
+ aPropertyValue[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "draw_jpg_Export" ) );
+ uno::Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY );
+ xStorable->storeToURL(aFile, aPropertyValue);
+
+ // destroy draw document
+ xDrawComponent->dispose();
+ }
+ }
+ rReq.Ignore();
+ }
+ break;
+ case FN_EXPORT_OLE_AS_PDF:
+ {
+ const int nSel = rSh.GetSelectionType();
+ if (nSel & nsSelectionType::SEL_OLE)
+ {
+ sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
+ aDlgHelper.SetTitle(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as PDF" )));
+ String aExt(RTL_CONSTASCII_USTRINGPARAM("*.pdf"));
+ aDlgHelper.AddFilter( aExt, aExt );
+ aDlgHelper.SetCurrentFilter( aExt );
+ if( aDlgHelper.Execute() == ERRCODE_NONE )
+ {
+ String aFile(aDlgHelper.GetPath());
+ Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController();
+ ::beans::PropertyValues aPropertyValue(3);
+ aPropertyValue[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
+ aPropertyValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "writer_pdf_Export" ) );
+ Sequence< ::beans::PropertyValue > aSequence(10);
+ ::beans::PropertyValue aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ));
+ aValue.Value <<= sal_Bool(sal_False);
+ aSequence[0] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Quality" ));
+ aValue.Value <<= sal_Int32(90);
+ aSequence[1] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ));
+ aValue.Value <<= sal_Bool(sal_False);
+ aSequence[2] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ));
+ aValue.Value <<= sal_Int32(300);
+ aSequence[3] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ));
+ aValue.Value <<= sal_Bool(sal_False);
+ aSequence[4] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ));
+ aValue.Value <<= sal_Bool(sal_False);
+ aSequence[5] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ));
+ aValue.Value <<= sal_Bool(sal_True);
+ aSequence[6] = aValue;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormsType" ));
+ aValue.Value <<= sal_Int32(0);
+ aSequence[7] = aValue;
+ uno::Any aAny;
+ Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
+ xView->getSelection() >>= aAny;
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" ));
+ aValue.Value <<= aAny;
+ aSequence[8] = aValue;
+ aValue.Name = rtl::OUString();
+ aValue.Value <<= sal_Int32(0);
+ aSequence[9] = aValue;
+ aPropertyValue[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
+ aPropertyValue[1].Value <<= aSequence;
+ aPropertyValue[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
+ aPropertyValue[2].Value <<= sal_Bool(sal_True);
+ Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY );
+ xStorable->storeToURL(aFile, aPropertyValue);
+ }
+ }
+ rReq.Ignore();
+ }
+ break;
case FN_FRAME_TO_ANCHOR:
if ( rSh.IsFrmSelected() )
{
@@ -241,10 +379,10 @@ void SwFrameShell::Execute(SfxRequest &rReq)
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -253,10 +391,10 @@ void SwFrameShell::Execute(SfxRequest &rReq)
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -266,7 +404,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
{
try
{
- uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
+ uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -291,7 +429,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -420,10 +558,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if( nSel & nsSelectionType::SEL_OLE )
{
- // --> OD 2009-07-13 #i73249#
-// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText()));
+ // #i73249#
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
- // <--
}
const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE);
@@ -460,7 +596,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) ));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
GetView().GetViewFrame(),
GetView().GetWindow(),
@@ -470,7 +606,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
DLG_FRM_STD,
sal_False,
nDefPage);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() )
{
@@ -487,10 +623,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, sal_True, &pItem))
{
- // --> OD 2009-07-13 #i73249#
-// rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue());
+ // #i73249#
rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue());
- // <--
}
// Vorlagen-AutoUpdate
SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
@@ -542,7 +676,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
//needs cast - no non-const method available
SwFrmFmt* pPrevFmt = (SwFrmFmt*)
lcl_GetFrmFmtByName(rSh, sPrevName);
- DBG_ASSERT(pPrevFmt, "No frame found!");
+ OSL_ENSURE(pPrevFmt, "No frame found!");
if(pPrevFmt)
{
rSh.Chain(*pPrevFmt, *pCurrFlyFmt);
@@ -576,7 +710,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
//needs cast - no non-const method available
SwFrmFmt* pNextFmt = (SwFrmFmt*)
lcl_GetFrmFmtByName(rSh, sNextName);
- DBG_ASSERT(pNextFmt, "No frame found!");
+ OSL_ENSURE(pNextFmt, "No frame found!");
if(pNextFmt)
{
rSh.Chain(*(SwFrmFmt*)
@@ -605,7 +739,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror));
}
break;
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
case FN_TITLE_DESCRIPTION_SHAPE:
{
bUpdateMgr = sal_False;
@@ -637,9 +771,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
}
break;
- // <--
default:
- ASSERT( !this, "falscher Dispatcher" );
+ OSL_ENSURE( !this, "wrong dispatcher" );
return;
}
// Vorlagen-AutoUpdate
@@ -656,11 +789,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwFrameShell::GetState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
@@ -716,8 +844,9 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_HORZ_RIGHT:
case FN_FRAME_ALIGN_HORZ_LEFT:
if ( (eFrmType & FRMTYPE_FLY_INCNT) ||
- bProtect ||
- ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode) )
+ bProtect ||
+ ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER) &&
+ bHtmlMode ))
rSet.DisableItem( nWhich );
break;
case FN_FRAME_ALIGN_VERT_ROW_TOP:
@@ -727,10 +856,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect
- || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) )
+ || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) )
rSet.DisableItem( nWhich );
break;
+ case FN_EXPORT_OLE:
+ case FN_EXPORT_OLE_AS_PDF:
+ case FN_EXPORT_OLE_AS_GRAPHIC:
+ {
+ SvtMiscOptions aMiscOptions;
+ if ( !aMiscOptions.IsExperimentalMode() )
+ rSet.DisableItem( nWhich );
+ break;
+ }
+
case SID_OBJECT_ALIGN_UP :
case SID_OBJECT_ALIGN_MIDDLE :
case SID_OBJECT_ALIGN_DOWN :
@@ -738,7 +877,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_ALIGN_VERT_TOP:
case FN_FRAME_ALIGN_VERT_CENTER:
case FN_FRAME_ALIGN_VERT_BOTTOM:
- if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT) )
+ if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT))
rSet.DisableItem( nWhich );
else
{
@@ -873,7 +1012,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
}
break;
- // --> OD 2009-07-07 #i73249#
+ // #i73249#
case FN_TITLE_DESCRIPTION_SHAPE:
{
SwWrtShell &rWrtSh = GetShell();
@@ -886,7 +1025,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
}
break;
- // <--
default:
/* do nothing */;
break;
@@ -899,8 +1037,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
/*--------------------------------------------------------------------
Beschreibung: Ctor fuer FrameShell
--------------------------------------------------------------------*/
-
-
SwFrameShell::SwFrameShell(SwView &_rView) :
SwBaseShell( _rView )
{
@@ -919,12 +1055,6 @@ SwFrameShell::~SwFrameShell()
SwTransferable::ClearSelection( GetShell(), (ViewShell *) this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -972,9 +1102,8 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
if(aBorderLine.GetOutWidth() == 0)
{
- aBorderLine.SetInWidth(0);
- aBorderLine.SetOutWidth(DEF_LINE_WIDTH_0);
- aBorderLine.SetDistance(0);
+ aBorderLine.SetStyle( ::editeng::SOLID );
+ aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
}
//Distance nur setzen, wenn der Request vom Controller kommt
@@ -1100,24 +1229,15 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
}
-
-
void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine)
{
- if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth())
- rBorderLine.SetInWidth(pBorderLine->GetInWidth());
-
- if(pBorderLine->GetOutWidth() > rBorderLine.GetOutWidth())
- rBorderLine.SetOutWidth(pBorderLine->GetOutWidth());
-
- if(pBorderLine->GetDistance() > rBorderLine.GetDistance())
- rBorderLine.SetDistance(pBorderLine->GetDistance());
+ if(pBorderLine->GetWidth() > rBorderLine.GetWidth())
+ rBorderLine.SetWidth(pBorderLine->GetWidth());
+ rBorderLine.SetStyle(pBorderLine->GetStyle());
rBorderLine.SetColor(pBorderLine->GetColor());
}
-
-
void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
@@ -1153,3 +1273,4 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet)
rSet.DisableItem(FN_INSERT_FRAME);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index ba6704981b70..7ac1bc8f0f73 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <hintids.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
@@ -77,7 +76,7 @@
#include <swwait.hxx>
#include <shells.hrc>
#include <popup.hrc>
-
+#include <extedit.hxx>
#define SwGrfShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
@@ -115,6 +114,19 @@ void SwGrfShell::Execute(SfxRequest &rReq)
}
}
break;
+ case FN_EXTERNAL_EDIT:
+ {
+ /* When the graphic is selected to be opened via some external tool
+ * for advanced editing
+ */
+ GraphicObject *pGraphicObject = (GraphicObject *) rSh.GetGraphicObj();
+ if(0 != pGraphicObject)
+ {
+ EditWithExternalTool(pGraphicObject, &rSh);
+ }
+ }
+ break;
+
case SID_INSERT_GRAPHIC:
case FN_FORMAT_GRAFIC_DLG:
{
@@ -153,10 +165,8 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if ( nSlot == FN_FORMAT_GRAFIC_DLG )
{
- // --> OD 2009-07-13 #i73249#
-// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText()));
+ // #i73249#
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
- // <--
}
pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT);
@@ -202,14 +212,13 @@ void SwGrfShell::Execute(SfxRequest &rReq)
}
else
{
- // --> OD 2005-02-09 #119353# - robust
+ // #119353# - robust
const GraphicObject* pGrfObj = rSh.GetGraphicObj();
if ( pGrfObj )
{
aSet.Put( SvxBrushItem( *pGrfObj, GPOS_LT,
SID_ATTR_GRAF_GRAPHIC ) );
}
- // <--
}
aSet.Put( SfxBoolItem( FN_PARAM_GRF_CONNECT, sGrfNm.Len() > 0 ) );
@@ -228,12 +237,12 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame()));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_GRF,
GetView().GetViewFrame(),
GetView().GetWindow(),
aSet, sal_False, DLG_FRM_GRF);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( pDlg->Execute() )
{
rSh.StartAllAction();
@@ -329,11 +338,8 @@ void SwGrfShell::Execute(SfxRequest &rReq)
if ( SFX_ITEM_SET == pSet->GetItemState(
FN_SET_FRM_ALT_NAME, sal_True, &pItem ))
{
- // --> OD 2009-07-13 #i73249#
-// rSh.SetAlternateText(
-// ((const SfxStringItem*)pItem)->GetValue() );
+ // #i73249#
rSh.SetObjTitle( ((const SfxStringItem*)pItem)->GetValue() );
- // <--
}
SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN,
@@ -360,7 +366,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
@@ -489,7 +495,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
case SID_GRFFILTER_SOLARIZE:
if( GRAPHIC_BITMAP == nGrfType )
{
- // --> OD 2005-02-09 #119353# - robust
+ // #119353# - robust
const GraphicObject* pFilterObj( GetShell().GetGraphicObj() );
if ( pFilterObj )
{
@@ -499,12 +505,11 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
GetShell().ReRead( aEmptyStr, aEmptyStr,
&aFilterObj.GetGraphic() );
}
- // <--
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
}
if( aGrfSet.Count() )
GetShell().SetAttr( aGrfSet );
@@ -522,10 +527,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
// const GraphicObject* pGrfObj = ( bIsGrfCntnt ? rSh.GetGraphicObj() : NULL );
// sal_Bool bIsRenderGraphicGrfCntnt = ( pGrfObj && pGrfObj->IsRenderGraphic() );
- // --> OD 2006-11-03 #i59688#
-// sal_Bool bSwappedOut = rSh.IsGrfSwapOut( sal_True );
-// sal_Bool bBitmapType = !bSwappedOut && GRAPHIC_BITMAP == rSh.GetGraphicType();
- // <--
SetGetStateSet( &rSet );
@@ -546,6 +547,13 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
if( rSh.GetGraphicType() == GRAPHIC_NONE )
bDisable = sal_True;
break;
+ /*
+ * If the Graphic is None type it should be externally editable
+ */
+ case FN_EXTERNAL_EDIT:
+ if( rSh.GetGraphicType() == GRAPHIC_NONE )
+ bDisable = sal_True;
+ break;
case SID_COLOR_SETTINGS:
{
if ( bParentCntProt || !bIsGrfCntnt )
@@ -615,7 +623,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
case SID_ATTR_GRAF_TRANSPARENCE:
if( !bParentCntProt )
{
- // --> OD 2005-02-09 #119353# - robust
+ // #119353# - robust
const GraphicObject* pGrafObj = rSh.GetGraphicObj();
if ( pGrafObj )
{
@@ -655,16 +663,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
{
if( bParentCntProt || !bIsGrfCntnt )
bDisable = sal_True;
- // --> OD 2006-11-03 #i59688#
- // load graphic only if type is unknown
-// else if( bSwappedOut )
-// {
-// rSet.DisableItem( nWhich );
-// if( AddGrfUpdateSlot( nWhich ))
-// rSh.GetGraphic(sal_False); // start the loading
-// }
-// else
-// bDisable = !bBitmapType;
+ // #i59688# load graphic only if type is unknown
else
{
const sal_uInt16 eGraphicType( rSh.GetGraphicType() );
@@ -681,7 +680,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
bDisable = eGraphicType != GRAPHIC_BITMAP;
}
}
- // <--
}
break;
@@ -704,3 +702,5 @@ SwGrfShell::SwGrfShell(SwView &_rView) :
SetName(String::CreateFromAscii("Graphic"));
SetHelpId(SW_GRFSHELL);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx
index 8669c4e201c1..55dd195d84fe 100644
--- a/sw/source/ui/shells/grfshex.cxx
+++ b/sw/source/ui/shells/grfshex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,6 @@
#include <grfsh.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
-#include <docary.hxx>
#include <textsh.hxx>
#include <viewopt.hxx>
#include <swundo.hxx>
@@ -148,3 +148,5 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 6f00f198e33f..47a8ccbaa411 100755..100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,9 @@
#include <vcl/window.hxx>
#include <wrtsh.hxx>
+#include <doc.hxx>
+#include <docary.hxx>
+#include <charfmt.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -255,7 +259,7 @@ namespace SwLangHelper
sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang );
EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
- DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
+ OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
//get ScriptType
sal_uInt16 nLangWhichId = 0;
@@ -267,7 +271,7 @@ namespace SwLangHelper
case SCRIPTTYPE_COMPLEX : nLangWhichId = pEditEngine ? EE_CHAR_LANGUAGE_CTL : RES_CHRATR_CTL_LANGUAGE; break;
default:
bIsSingleScriptType = false;
- DBG_ERROR( "unexpected case" );
+ OSL_FAIL("unexpected case" );
}
if (bIsSingleScriptType)
{
@@ -298,8 +302,26 @@ namespace SwLangHelper
case EE_CHAR_LANGUAGE_CJK : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
case EE_CHAR_LANGUAGE_CTL : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
}
+ //Set the default document language
rWrtSh.SetDefault( SvxLanguageItem( nLang, nLangWhichId ) );
+ //Resolves: fdo#35282 Clear the language from all Text Styles, and
+ //fallback to default document language
+ const SwTxtFmtColls *pColls = rWrtSh.GetDoc()->GetTxtFmtColls();
+ for(sal_uInt16 i = 0, nCount = pColls->Count(); i < nCount; ++i)
+ {
+ SwTxtFmtColl &rTxtColl = *pColls->GetObject( i );
+ rTxtColl.ResetFmtAttr(nLangWhichId);
+ }
+ //Resolves: fdo#35282 Clear the language from all Character Styles,
+ //and fallback to default document language
+ const SwCharFmts *pCharFmts = rWrtSh.GetDoc()->GetCharFmts();
+ for(sal_uInt16 i = 0, nCount = pCharFmts->Count(); i < nCount; ++i)
+ {
+ SwCharFmt &rCharFmt = *pCharFmts->GetObject( i );
+ rCharFmt.ResetFmtAttr(nLangWhichId);
+ }
+
// #i102191: hard set respective language attribute in text document
// (for all text in the document - which should be selected by now...)
rWrtSh.SetAttr( SvxLanguageItem( nLang, nLangWhichId ) );
@@ -338,7 +360,7 @@ namespace SwLangHelper
// whole paragraph)
EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
- DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
+ OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
if (pEditEngine)
{
for (sal_uInt16 i = 0; i < 3; ++i)
@@ -355,16 +377,16 @@ namespace SwLangHelper
}
else // change language for all text
{
- SvUShortsSort aAttribs;
+ std::set<sal_uInt16> aAttribs;
for (sal_uInt16 i = 0; i < 3; ++i)
{
rWrtSh.SetDefault( SvxLanguageItem( LANGUAGE_NONE, aLangWhichId_Writer[i] ) );
- aAttribs.Insert( aLangWhichId_Writer[i] );
+ aAttribs.insert( aLangWhichId_Writer[i] );
}
// set all language attributes to default
// (for all text in the document - which should be selected by now...)
- rWrtSh.ResetAttr( &aAttribs );
+ rWrtSh.ResetAttr( aAttribs );
}
}
@@ -392,11 +414,11 @@ namespace SwLangHelper
}
else
{
- SvUShortsSort aAttribs;
- aAttribs.Insert( RES_CHRATR_LANGUAGE );
- aAttribs.Insert( RES_CHRATR_CJK_LANGUAGE );
- aAttribs.Insert( RES_CHRATR_CTL_LANGUAGE );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( RES_CHRATR_LANGUAGE );
+ aAttribs.insert( RES_CHRATR_CJK_LANGUAGE );
+ aAttribs.insert( RES_CHRATR_CTL_LANGUAGE );
+ rWrtSh.ResetAttr( aAttribs );
}
}
@@ -436,7 +458,7 @@ namespace SwLangHelper
// there is more than one language...
nLang = LANGUAGE_DONTKNOW;
}
- DBG_ASSERT( nLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+ OSL_ENSURE( nLang != LANGUAGE_SYSTEM, "failed to get the language?" );
return nLang;
}
@@ -487,7 +509,7 @@ namespace SwLangHelper
}
}
}
- DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+ OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
return nCurrentLang;
}
@@ -535,7 +557,7 @@ namespace SwLangHelper
}
}
}
- DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+ OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
return nCurrentLang;
}
@@ -608,3 +630,4 @@ namespace SwLangHelper
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx
index 45746e286857..ae432afef3ce 100644
--- a/sw/source/ui/shells/listsh.cxx
+++ b/sw/source/ui/shells/listsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,7 @@
#include <tools/shl.hxx>
#include <svl/srchitem.hxx>
-// --> FME 2005-01-04 #i35572#
#include <numrule.hxx>
-// <--
#include <fmtornt.hxx>
#include "wrtsh.hxx"
#include "swmodule.hxx"
@@ -75,7 +74,7 @@ SFX_IMPL_INTERFACE(SwListShell, SwBaseShell, SW_RES(STR_SHELLNAME_LIST))
TYPEINIT1(SwListShell,SwBaseShell)
-// --> FME 2005-01-04 #i35572# Functionality of Numbering/Bullet toolbar
+// #i35572# Functionality of Numbering/Bullet toolbar
// for outline numbered paragraphs should match the functions for outlines
// available in the navigator. Therefore the code in the following
// function is quite similar the the code in SwContentTree::ExecCommand.
@@ -144,7 +143,6 @@ void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bUp )
rSh.Pop( sal_False );
}
}
-// <--
void SwListShell::Execute(SfxRequest &rReq)
{
@@ -152,11 +150,10 @@ void SwListShell::Execute(SfxRequest &rReq)
sal_uInt16 nSlot = rReq.GetSlot();
SwWrtShell& rSh = GetShell();
- // --> FME 2005-01-04 #i35572#
+ // #i35572#
const SwNumRule* pCurRule = rSh.GetCurNumRule();
- ASSERT( pCurRule, "SwListShell::Execute without NumRule" )
+ OSL_ENSURE( pCurRule, "SwListShell::Execute without NumRule" );
bool bOutline = pCurRule && pCurRule->IsOutlineRule();
- // <--
switch (nSlot)
{
@@ -242,7 +239,7 @@ void SwListShell::Execute(SfxRequest &rReq)
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
@@ -293,3 +290,4 @@ SwListShell::SwListShell(SwView &_rView) :
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/mediash.cxx b/sw/source/ui/shells/mediash.cxx
index ed73541da8d6..f65827e42f1b 100644
--- a/sw/source/ui/shells/mediash.cxx
+++ b/sw/source/ui/shells/mediash.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,7 @@
#include "precompiled_sw.hxx"
-
-
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <hintids.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
@@ -71,12 +68,8 @@
#include <usrpref.hxx>
#include <edtwin.hxx>
#include <swwait.hxx>
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
-#ifndef _POPUP_HRC
#include <popup.hrc>
-#endif
#include <sfx2/objface.hxx>
#include <svx/svdomedia.hxx>
@@ -94,8 +87,6 @@ SFX_IMPL_INTERFACE(SwMediaShell, SwBaseShell, SW_RES(STR_SHELLNAME_MEDIA))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_MEDIA_TOOLBOX));
}
-// ------------------------------------------------------------------------------
-
void SwMediaShell::ExecMedia(SfxRequest &rReq)
{
SwWrtShell* pSh = &GetShell();
@@ -167,8 +158,6 @@ void SwMediaShell::ExecMedia(SfxRequest &rReq)
}
}
-// ------------------------------------------------------------------------------
-
void SwMediaShell::GetMediaState(SfxItemSet &rSet)
{
SfxWhichIter aIter( rSet );
@@ -211,8 +200,6 @@ void SwMediaShell::GetMediaState(SfxItemSet &rSet)
}
}
-// ------------------------------------------------------------------------------
-
SwMediaShell::SwMediaShell(SwView &_rView) :
SwBaseShell(_rView)
@@ -220,3 +207,5 @@ SwMediaShell::SwMediaShell(SwView &_rView) :
SetName(String::CreateFromAscii("Media Playback"));
SetHelpId(SW_MEDIASHELL);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/navsh.cxx b/sw/source/ui/shells/navsh.cxx
new file mode 100644
index 000000000000..506c7e99f747
--- /dev/null
+++ b/sw/source/ui/shells/navsh.cxx
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Maja Djordjevic < ovcica@gmail.com > ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com>
+ * Caolan McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+
+#include "cmdid.h"
+#include <svx/svdview.hxx>
+#include <svl/srchitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/whiter.hxx>
+#include <svx/svdopath.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/objface.hxx>
+
+#include "wrtsh.hxx"
+#include "view.hxx"
+#include "edtwin.hxx"
+#include "helpid.h"
+#include "globals.hrc"
+
+#include "navsh.hxx"
+
+
+#include "popup.hrc"
+#include "shells.hrc"
+#define SwNavigationShell
+#include "swslots.hxx"
+
+#include <unomid.h>
+
+#include "navmgr.hxx"
+
+
+SFX_IMPL_INTERFACE(SwNavigationShell, SwBaseShell, SW_RES(STR_SHELLNAME_NAVIGATION))
+{
+}
+
+SwNavigationShell::SwNavigationShell(SwView &_rView):
+ SwBaseShell( _rView )
+
+{
+ SetName(C2S("Navigation"));
+ SetHelpId(SW_NAVIGATIONSHELL);
+}
+
+void SwNavigationShell::Execute(SfxRequest &rReq)
+{
+ SwWrtShell *pSh = &GetShell();
+ SdrView* pSdrView = pSh->GetDrawView();
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ sal_uInt16 nSlotId = rReq.GetSlot();
+ sal_Bool bChanged = pSdrView->GetModel()->IsChanged();
+ pSdrView->GetModel()->SetChanged(sal_False);
+ SwNavigationMgr& aSwNavigationMgr = pSh->GetNavigationMgr();
+ const SfxPoolItem* pItem;
+ if(pArgs)
+ pArgs->GetItemState(nSlotId, sal_False, &pItem);
+ switch (nSlotId)
+ {
+ case FN_NAVIGATION_BACK:
+ aSwNavigationMgr.goBack();
+ break;
+
+ case FN_NAVIGATION_FORWARD:
+ aSwNavigationMgr.goForward();
+ break;
+ default:
+ break;
+ }
+ if (pSdrView->GetModel()->IsChanged())
+ GetShell().SetModified();
+ else if (bChanged)
+ pSdrView->GetModel()->SetChanged(sal_True);
+}
+
+/*--------------------------------------------------------------------
+ determine if the buttons should be enabled/disabled
+ --------------------------------------------------------------------*/
+
+
+void SwNavigationShell::GetState(SfxItemSet &rSet)
+{
+ SwWrtShell *pSh = &GetShell();
+ SfxWhichIter aIter( rSet );
+ sal_uInt16 nWhich = aIter.FirstWhich();
+ SwNavigationMgr& aNavigationMgr = pSh->GetNavigationMgr();
+ while( nWhich )
+ {
+ switch( nWhich )
+ {
+ case FN_NAVIGATION_BACK:
+ {
+ if (!aNavigationMgr.backEnabled()) {
+ rSet.DisableItem(FN_NAVIGATION_BACK);
+ }
+ }
+ break;
+ case FN_NAVIGATION_FORWARD:
+ {
+ if (!aNavigationMgr.forwardEnabled())
+ rSet.DisableItem(FN_NAVIGATION_FORWARD);
+ }
+ break;
+ default:
+ break;
+ }
+ nWhich = aIter.NextWhich();
+ }
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/olesh.cxx b/sw/source/ui/shells/olesh.cxx
index a4eef5cdbf1d..a971998beb74 100644
--- a/sw/source/ui/shells/olesh.cxx
+++ b/sw/source/ui/shells/olesh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,26 +36,14 @@
#include <sfx2/objitem.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <frmsh.hxx>
-#ifndef _OLESH_HXX
#include <olesh.hxx>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _POPUP_HRC
#include <popup.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
#define SwOleShell
@@ -78,3 +67,4 @@ SwOleShell::SwOleShell(SwView &_rView) :
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src
index 8e6527206d77..23efd4977883 100644
--- a/sw/source/ui/shells/shells.src
+++ b/sw/source/ui/shells/shells.src
@@ -152,7 +152,6 @@ String STR_PAGE
};
String RID_TEXT_TOOLBOX
{
- /* ### ACHTUNG: Neuer Text in Resource? Textobjektleiste : Textleiste */
Text [ en-US ] = "Text Object Bar" ;
Text [ x-comment ] = " ";
};
diff --git a/sw/source/ui/shells/slotadd.cxx b/sw/source/ui/shells/slotadd.cxx
index 9d162f57aa6f..ab6850ce6aae 100644
--- a/sw/source/ui/shells/slotadd.cxx
+++ b/sw/source/ui/shells/slotadd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,9 +53,7 @@
#include <editeng/wrlmitem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/opaqitem.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
#include <editeng/tstpitem.hxx>
-#endif
#include <editeng/akrnitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/kernitem.hxx>
@@ -82,9 +81,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/fhgtitem.hxx>
-#ifndef _SVX_CNTRITEM_HXX //autogen
#include <editeng/cntritem.hxx>
-#endif
#include <editeng/colritem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/sizeitem.hxx>
@@ -148,3 +145,4 @@
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 9f0639d9622c..bfc441a22d5e 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,8 +86,6 @@
#include <dialog.hrc>
-
-
//!!! new: insert table
/*
#include <svx/htmlmode.hxx>
@@ -96,19 +95,10 @@
*/
//!!!
-#ifndef _POPUP_HRC
#include <popup.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
-#ifndef _TABLE_HRC
-#include <table.hrc>
-#endif
#include <cmdid.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <helpid.h>
#include <unobaseclass.hxx>
@@ -119,22 +109,18 @@
#include "swabstdlg.hxx"
#include <table.hrc>
+using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
-//-----------------------------------------------------------------------------
-
SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell, SW_RES(STR_SHELLNAME_TABLE))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TAB_POPUPMENU));
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TABLE_TOOLBOX));
}
-
TYPEINIT1(SwTableShell,SwBaseShell)
-/************************************************************************/
-
-const sal_uInt16 __FAR_DATA aUITableAttrRange[] =
+const sal_uInt16 aUITableAttrRange[] =
{
FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_NAME,
FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
@@ -155,7 +141,7 @@ const sal_uInt16 __FAR_DATA aUITableAttrRange[] =
RES_FRAMEDIR, RES_FRAMEDIR,
RES_ROW_SPLIT, RES_ROW_SPLIT,
FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION,
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
// <-- collapsing borders
0
@@ -173,9 +159,6 @@ static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem )
rSh.SetTblAttr( aSet );
}
-/************************************************************************/
-
-
static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
{
SwFrmFmt *pFmt = rSh.GetTableFmt();
@@ -195,8 +178,6 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
sal_uInt16 nBackgroundDestination = rSh.GetViewOptions()->GetTblDest();
rSet.Put(SwBackgroundDestinationItem(SID_BACKGRND_DESTINATION, nBackgroundDestination ));
SvxBrushItem aBrush( RES_BACKGROUND );
-// rSh.GetBoxBackground(aBrush);
-// rSet.Put( aBrush );
if(rSh.GetRowBackground(aBrush))
rSet.Put( aBrush, SID_ATTR_BRUSH_ROW );
else
@@ -303,9 +284,6 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
return pRep;
}
-/************************************************************************/
-
-
void ItemSetToTableParam( const SfxItemSet& rSet,
SwWrtShell &rSh )
{
@@ -451,7 +429,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
rSh.SetTableName( *pFmt, ((const SfxStringItem*)pItem)->GetValue() );
// kopiere die ausgesuchten Attribute in den ItemSet
- static sal_uInt16 __READONLY_DATA aIds[] =
+ static sal_uInt16 aIds[] =
{
RES_PAGEDESC,
RES_BREAK,
@@ -460,7 +438,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
RES_UL_SPACE,
RES_SHADOW,
RES_FRAMEDIR,
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
RES_COLLAPSING_BORDERS,
// <-- collapsing borders
0
@@ -483,24 +461,15 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
rSh.EndAllAction();
}
-/************************************************************************/
-
-
static void lcl_TabGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine)
{
- if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth())
- rBorderLine.SetInWidth(pBorderLine->GetInWidth());
-
- if(pBorderLine->GetOutWidth() > rBorderLine.GetOutWidth())
- rBorderLine.SetOutWidth(pBorderLine->GetOutWidth());
-
- if(pBorderLine->GetDistance() > rBorderLine.GetDistance())
- rBorderLine.SetDistance(pBorderLine->GetDistance());
+ if(pBorderLine->GetWidth() > rBorderLine.GetWidth())
+ rBorderLine.SetWidth(pBorderLine->GetWidth());
+ rBorderLine.SetStyle(pBorderLine->GetStyle());
rBorderLine.SetColor(pBorderLine->GetColor());
}
-
void SwTableShell::Execute(SfxRequest &rReq)
{
sal_Bool bUseDialog = sal_True;
@@ -518,23 +487,6 @@ void SwTableShell::Execute(SfxRequest &rReq)
{
case SID_ATTR_BORDER:
{
-/* sal_Bool bPopCrsr = sal_False;
- if ( !rReq.IsAPI() )
- {
- //Keine Tabellenselektion -> Aenderung wird auf die gesamte
- //Tabelle.
- if ( !rSh.IsTableMode() )
- {
- rSh.StartAction();
- bPopCrsr = sal_True;
- rSh.Push();
- rSh.EnterStdMode();
- rSh.MoveTable( fnTableCurr, fnTableStart );
- rSh.SttSelect();
- rSh.MoveTable( fnTableCurr, fnTableEnd );
- rSh.EndSelect();
- }
- }*/
if(!pArgs)
break;
//Items erzeugen, weil wir sowieso nacharbeiten muessen
@@ -558,7 +510,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
aBox.SetDistance( Max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) );
}
else
- {ASSERT( !this, "Wo ist das Box-Item?" )}
+ OSL_ENSURE( !this, "where is BoxItem?" );
//since the drawing layer also supports borders the which id might be a different one
SvxBoxInfoItem aInfo( SID_ATTR_BORDER_INNER );
@@ -592,8 +544,8 @@ void SwTableShell::Execute(SfxRequest &rReq)
if(aBorderLine.GetOutWidth() == 0)
{
- aBorderLine.SetInWidth(0);
- aBorderLine.SetOutWidth(DEF_LINE_WIDTH_0);
+ aBorderLine.SetStyle( ::editeng::SOLID );
+ aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
}
sal_Bool bLine = sal_False;
@@ -610,9 +562,6 @@ void SwTableShell::Execute(SfxRequest &rReq)
if ((pBorderLine = aInfo.GetVert()) != NULL)
aInfo.SetLine(&aBorderLine, BOXINFO_LINE_VERT), bLine |= sal_True;
-// if ( bPopCrsr && !bLine )
-// aBox.SetDistance( 0 );
-
aCoreSet.Put( aBox );
aCoreSet.Put( aInfo );
rSh.SetTabBorders( aCoreSet );
@@ -624,12 +573,6 @@ void SwTableShell::Execute(SfxRequest &rReq)
rReq.AppendItem( aInfo );
bCallDone = sal_True;
-/* if ( bPopCrsr )
- {
- rSh.KillPams();
- rSh.Pop(sal_False);
- rSh.EndAction();
- }*/
}
break;
case FN_INSERT_TABLE:
@@ -649,10 +592,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
if ( bUseDialog )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwTableTabDlg( GetView().GetWindow(), GetPool(), &aCoreSet, &rSh, DLG_FORMAT_TABLE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
rSh.GetTblAttr(aCoreSet);
@@ -726,12 +669,12 @@ void SwTableShell::Execute(SfxRequest &rReq)
sCurText, SID_ATTR_NUMBERFORMAT_INFO ));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet,
pView->GetViewFrame()->GetFrame().GetFrameInterface(),
RC_DLG_SWNUMFMTDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (RET_OK == pDlg->Execute())
{
@@ -821,7 +764,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
aInfoBox.Execute();
break;
}
- default: ASSERT( !this, "unbekannter Returnwert MergeTab.");
+ default: OSL_ENSURE( !this, "unknown return value MergeTab.");
}
break;
case FN_TABLE_ADJUST_CELLS:
@@ -874,10 +817,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
case SID_AUTOFORMAT:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh , DLG_AUTOFMT_TABLE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -885,17 +828,17 @@ void SwTableShell::Execute(SfxRequest &rReq)
case FN_TABLE_SET_ROW_HEIGHT:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_ROW_HEIGHT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
break;
case FN_NUMBER_BULLETS:
case FN_NUM_BULLET_ON:
- ASSERT( !this, "Funktion darf zur Zeit nicht gerufen werden." );
+ OSL_ENSURE( !this, "function may not be called now." );
break;
case FN_TABLE_INSERT_COL:
@@ -949,7 +892,6 @@ void SwTableShell::Execute(SfxRequest &rReq)
ItemSetToTableParam( aSet, rSh );
rSh.EndUndo( nUndoId );
}
- // <--
bCallDone = sal_True;
break;
@@ -1044,10 +986,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSplitTableDialog* pDlg = pFact->CreateSplitTblDialog( GetView().GetWindow(), rSh );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) );
delete pDlg;
@@ -1064,9 +1006,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
if( bPrev && bNext )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwVclDialog( DLG_MERGE_TABLE, GetView().GetWindow(), bPrev );
- DBG_ASSERT(pDlg, "dialogdiet pDlg fail!");
+ OSL_ENSURE(pDlg, "dialogdiet pDlg fail!");
if( RET_OK != pDlg->Execute())
bPrev = bNext = sal_False;
delete pDlg;
@@ -1087,7 +1029,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
: TBLVAR_CHGABS ) );
SfxBindings& rBind = GetView().GetViewFrame()->GetBindings();
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 aInva[] =
{ FN_TABLE_MODE_FIX,
FN_TABLE_MODE_FIX_PROP,
FN_TABLE_MODE_VARIABLE,
@@ -1237,15 +1179,12 @@ void SwTableShell::Execute(SfxRequest &rReq)
break;
default:
- ASSERT( !this, "falscher Dispatcher" );
+ OSL_ENSURE( !this, "wrong Dispatcher" );
return;
}
if(bCallDone)
rReq.Done();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwTableShell::GetState(SfxItemSet &rSet)
{
@@ -1296,7 +1235,6 @@ void SwTableShell::GetState(SfxItemSet &rSet)
case FN_INSERT_TABLE:
// Irgendeinen Wert "putten", damit Controller enabled bleibt.
// Statt "Insert:Table" erscheint dann "Format:Table".
-// rSet.Put(SfxUInt16Item(nSlot, 1));
break;
case FN_TABLE_OPTIMAL_HEIGHT:
@@ -1428,10 +1366,6 @@ void SwTableShell::GetState(SfxItemSet &rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwTableShell::SwTableShell(SwView &_rView) :
SwBaseShell(_rView)
{
@@ -1439,10 +1373,6 @@ SwTableShell::SwTableShell(SwView &_rView) :
SetHelpId(SW_TABSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwTableShell::GetFrmBorderState(SfxItemSet &rSet)
{
SfxItemSet aCoreSet( GetPool(),
@@ -1454,10 +1384,6 @@ void SwTableShell::GetFrmBorderState(SfxItemSet &rSet)
rSet.Put( aCoreSet );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwTableShell::ExecTableStyle(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
@@ -1468,24 +1394,6 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq)
case SID_FRAME_LINESTYLE:
case SID_FRAME_LINECOLOR:
{
-/* Tabellenselektion ist abgeschafft
- sal_Bool bPopCrsr = sal_False;
- if ( !rReq.IsAPI() )
- {
- //Keine Tabellenselektion -> Aenderung wird auf die gesamte
- //Tabelle.
- if ( !rSh.IsTableMode() )
- {
- bPopCrsr = sal_True;
- rSh.Push();
- rSh.StartAction();
- rSh.EnterStdMode();
- rSh.MoveTable( fnTableCurr, fnTableStart );
- rSh.SttSelect();
- rSh.MoveTable( fnTableCurr, fnTableEnd );
- rSh.EndSelect();
- }
- }*/
if ( rReq.GetSlot() == SID_FRAME_LINESTYLE )
{
const SvxLineItem &rLineItem = (const SvxLineItem&)pArgs->
@@ -1501,18 +1409,12 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq)
}
rReq.Done();
-/* if ( bPopCrsr )
- {
- rSh.KillPams();
- rSh.Pop(sal_False);
- rSh.EndAction();
- }*/
+
break;
}
}
}
-
void SwTableShell::GetLineStyleState(SfxItemSet &rSet)
{
SfxItemSet aCoreSet( GetPool(),
@@ -1580,7 +1482,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
@@ -1596,3 +1498,4 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx
index 584da30a17ca..16e47464ad21 100644
--- a/sw/source/ui/shells/textdrw.cxx
+++ b/sw/source/ui/shells/textdrw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,9 +43,7 @@
#include <swundo.hxx>
#include <basesh.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <docsh.hxx>
#include <sfx2/docfile.hxx>
@@ -53,12 +52,8 @@
#include <unomid.h>
-
using namespace ::com::sun::star;
using ::rtl::OUString;
-/*---------------------------------------------------------------------------
- Beschreibung:
- ----------------------------------------------------------------------------*/
void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, const String& rTxt)
{
@@ -92,7 +87,7 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
- ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+ OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
if( !xControlModel.is() )
return;
@@ -140,4 +135,4 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con
rSh.EndAction();
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 6100149def78..6ca3e8be76bf 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************ *************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,6 @@
#include <view.hxx>
#include <wrtsh.hxx>
#include <basesh.hxx>
-#include <wrtsh.hxx>
#include <flddat.hxx>
#include <numrule.hxx>
#include <textsh.hxx>
@@ -71,7 +71,6 @@
#include <shells.hrc>
#include <sfx2/app.hxx>
-#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include "swabstdlg.hxx"
#include "dialog.hrc"
@@ -85,7 +84,6 @@
using namespace nsSwDocInfoSubType;
-
extern sal_Bool bNoInterrupt; // in mainwn.cxx
String& lcl_AppendRedlineStr( String& rStr, sal_uInt16 nRedlId )
@@ -105,7 +103,6 @@ String& lcl_AppendRedlineStr( String& rStr, sal_uInt16 nRedlId )
}
// STATIC DATA -----------------------------------------------------------
-
void SwTextShell::ExecField(SfxRequest &rReq)
{
SwWrtShell& rSh = GetShell();
@@ -151,10 +148,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
default:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSwFldEditDlg( GetView(),RC_DLG_SWFLDEDITDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -242,7 +239,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_FIELD_FORMAT, sal_False, &pItem ))
nFormat = ((SfxUInt32Item *)pItem)->GetValue();
- DBG_WARNING("Command is not yet used");
+ OSL_FAIL("Command is not yet used");
sal_Unicode cSeparator = ' ';
SwInsertFld_Data aData(nType, 0, aPar1, aPar2, nFormat, GetShellPtr(), cSeparator );
bRes = aFldMgr.InsertFld(aData);
@@ -402,7 +399,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if (pRedline)
{
sComment = pRedline->GetComment();
- if ( sComment == String(rtl::OUString::createFromAscii("")) )
+ if ( !sComment.Len() )
GetView().GetDocShell()->Broadcast(SwRedlineHint(pRedline,SWREDLINE_INSERTED));
const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS,&GetView()));
}
@@ -419,9 +416,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
sal_Bool bTravel = sal_False;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT );
- DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
+ OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()");
SfxItemSet aSet(GetPool(), fnGetRange());
aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT));
aSet.Put(SvxPostItAuthorItem(pRedline->GetAuthorString(), SID_ATTR_POSTIT_AUTHOR));
@@ -464,9 +461,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
bTravel |= bNext|bPrev;
SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact2, "Dialogdiet fail!");
+ OSL_ENSURE(pFact2, "Dialogdiet fail!");
AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->HideAuthor();
String sTitle(SW_RES(STR_REDLINE_COMMENT));
@@ -525,10 +522,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractJavaEditDialog* pDlg = pFact->CreateJavaEditDialog( DLG_JAVAEDIT,
pMDI, &rSh);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() )
{
aType = pDlg->GetType();
@@ -604,7 +601,7 @@ FIELD_INSERT:
}
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
}
@@ -641,12 +638,6 @@ void SwTextShell::StateField( SfxItemSet &rSet )
break;
case FN_EDIT_FIELD:
{
- /* #108536# Fields can be selected, too now. Removed
-
- if( rSh.HasSelection() )
- rSet.DisableItem(nWhich);
- else ...
- */
if( !bGetField )
{
@@ -722,11 +713,6 @@ void SwTextShell::StateField( SfxItemSet &rSet )
}
}
-/*---------------------------------------------------------------------------
- Beschreibung:
- ----------------------------------------------------------------------------*/
-
-
void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
{
const String& rName = rHlnkItem.GetName();
@@ -891,4 +877,4 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn )
return 0;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx
index fab748cf45f8..6bb71bc7ef6a 100644
--- a/sw/source/ui/shells/textglos.cxx
+++ b/sw/source/ui/shells/textglos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
-#include "errhdl.hxx"
#include "view.hxx"
-#include "initui.hxx"
#include "cmdid.h"
#include "textsh.hxx"
#include "initui.hxx"
@@ -46,7 +45,6 @@
#include <misc.hrc>
// STATIC DATA -----------------------------------------------------------
-
void SwTextShell::ExecGlossary(SfxRequest &rReq)
{
sal_uInt16 nSlot = rReq.GetSlot();
@@ -88,7 +86,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
aShortName = (( const SfxStringItem *)pItem)->GetValue();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( aGroup );
@@ -104,7 +102,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
{
String aGroup = (( const SfxStringItem *)pItem)->GetValue();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( aGroup );
@@ -120,7 +118,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_1, sal_False, &pItem ))
aName = (( const SfxStringItem *)pItem)->GetValue();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( aGroup );
@@ -131,7 +129,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
}
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
if(bUpdateList)
@@ -142,4 +140,4 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
}
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index 81238471dcbe..c052ff5d6963 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,9 +52,7 @@
#include <index.hrc>
#include <globals.hrc>
-
// STATIC DATA -----------------------------------------------------------
-
void SwTextShell::ExecIdx(SfxRequest &rReq)
{
const SfxItemSet *pArgs = rReq.GetArgs();
@@ -70,9 +69,9 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
case FN_EDIT_AUTH_ENTRY_DLG :
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( pMDI, GetShell(), DLG_EDIT_AUTHMARK);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -98,19 +97,19 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{ // Mehrere Marken, welche solls denn sein ?
//
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK,
pMDI, aMgr);
- DBG_ASSERT(pMultDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pMultDlg, "Dialogdiet fail!");
nRet = pMultDlg->Execute();
delete pMultDlg;
}
if( nRet == RET_OK)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg( DLG_EDIT_IDXMARK, pMDI, GetShell(), aMgr.GetCurTOXMark() );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -155,11 +154,11 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
aSet.Put(*pSet);
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX,
pMDI, aSet, rSh, (SwTOXBase* )pCurTOX,
USHRT_MAX, bGlobal);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -168,18 +167,17 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{
SwWrtShell& rSh = GetShell();
const SwTOXBase* pBase = rSh.GetCurTOX();
- DBG_ASSERT(pBase, "no TOXBase to remove");
+ OSL_ENSURE(pBase, "no TOXBase to remove");
if( pBase )
rSh.DeleteTOX(*pBase, sal_True);
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
-
void SwTextShell::GetIdxState(SfxItemSet &rSet)
{
SwWrtShell& rSh = GetShell();
@@ -215,7 +213,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, sal_True));
}
- else //if( SFX_ITEM_UNKNOWN != rSet.GetItemState( FN_EDIT_IDX_ENTRY_DLG ))
+ else
{
sal_Bool bEnableEdit = sal_True;
@@ -257,5 +255,4 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
}
}
-// -----------------------------------------------------------------------
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index d4c309cf2a2d..b7353106c99e 100755..100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,12 +128,6 @@ using ::rtl::OUString;
#include <frmui.hrc>
#include <unomid.h>
-
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TEXT_POPUPMENU));
@@ -144,18 +139,14 @@ SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT))
SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG);
}
-
-
TYPEINIT1(SwTextShell,SwBaseShell)
-
-
void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
- ASSERT( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
- "Falsche Shell auf dem Dispatcher" );
+ OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
+ "wrong shell on dispatcher" );
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
@@ -181,9 +172,9 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
: CHAR_HARDHYPHEN;
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACorr && pACfg->IsAutoFmtByInput() &&
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr && rACfg.IsAutoFmtByInput() &&
pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
@@ -261,7 +252,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")),
uno::makeAny( ::rtl::OUString( pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) );
}
}
@@ -312,17 +303,17 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
try
{
if ( sClassLocation.Len() )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")),
uno::makeAny(
::rtl::OUString(
URIHelper::SmartRel2Abs(
INetURLObject(), sClassLocation,
URIHelper::GetMaybeFileHdl()) ) ) );
uno::Sequence< beans::PropertyValue > aSeq;
- if ( aCommandList.Count() )
+ if ( aCommandList.size() )
{
aCommandList.FillSequence( aSeq );
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginCommands"), uno::makeAny( aSeq ) );
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) );
}
}
catch ( uno::Exception& )
@@ -336,7 +327,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
else
{
- DBG_ASSERT( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
+ OSL_ENSURE( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
rSh.InsertObject( xObj, pName, sal_True, nSlot);
rReq.Done();
}
@@ -372,31 +363,27 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
aMargin = pMarginItem->GetSize();
if ( pURLItem )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameURL"), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) );
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) );
if ( pNameItem )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameName"), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) );
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) );
if ( eScroll == ScrollingAuto )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll")),
uno::makeAny( sal_True ) );
else
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode")),
uno::makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) );
- //if ( aFrmDescr.IsFrameBorderSet() )
if ( pBorderItem )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder")),
uno::makeAny( (sal_Bool) pBorderItem->GetValue() ) );
- /*else
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder"),
- makeAny( sal_True ) );*/
if ( pMarginItem )
{
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth")),
uno::makeAny( sal_Int32( aMargin.Width() ) ) );
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight")),
uno::makeAny( sal_Int32( aMargin.Height() ) ) );
}
}
@@ -433,9 +420,6 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SwFrmFmt* pTblFmt = GetShell().GetTableFmt();
String aCurrentTblName = pTblFmt->GetName();
- // String aText( String::CreateFromAscii("<.>") ); // was used for UI
- // aText.Insert( rWrtShell.GetBoxNms(), 2);
- // aText.Insert( aCurrentTblName, 1 );
aRangeString = aCurrentTblName;
aRangeString += OUString::valueOf( sal_Unicode('.') );
aRangeString += GetShell().GetBoxNms();
@@ -529,8 +513,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Bool bSingleCol = sal_False;
if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if( HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport ||
HTML_CFG_MSIE_40 == nExport ||
@@ -576,7 +560,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
else
{
- static sal_uInt16 __READONLY_DATA aFrmAttrRange[] =
+ static sal_uInt16 aFrmAttrRange[] =
{
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
@@ -612,10 +596,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet, sal_True);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(pDlg->Execute() && pDlg->GetOutputItemSet())
{
//local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
@@ -678,10 +662,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER,
pParent );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
// MessageBox fuer fehlende Grafiken
if(!pDlg->HasImages())
InfoBox( pParent, SW_RES(MSG_NO_RULER)).Execute();
@@ -733,16 +717,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case FN_FORMAT_COLUMN :
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pColDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN);
- DBG_ASSERT(pColDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pColDlg, "Dialogdiet fail!");
pColDlg->Execute();
delete pColDlg;
}
break;
default:
- ASSERT( !this, "falscher Dispatcher" );
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
@@ -755,7 +739,6 @@ bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
return bRet;
}
-
void SwTextShell::StateInsert( SfxItemSet &rSet )
{
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
@@ -768,11 +751,10 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSh.Push();
const sal_Bool bCrsrInHidden = rSh.SelectHiddenRange();
- // --> OD 2009-08-05 #i103839#, #b6855246#
+ // #i103839#
// Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <sal_False>
// in order to avoid that the view jumps to the visible cursor.
rSh.Pop();
- // <--
while ( nWhich )
{
@@ -817,8 +799,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSet.DisableItem( nWhich );
else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
rSet.DisableItem(nWhich);
}
@@ -893,7 +875,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
}
break;
case FN_INSERT_HRULER :
- if((rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden )
+ if ( (rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden )
rSet.DisableItem(nWhich);
break;
case FN_FORMAT_COLUMN :
@@ -923,10 +905,6 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwTextShell::ExecDelete(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -966,7 +944,7 @@ void SwTextShell::ExecDelete(SfxRequest &rReq)
rSh.DelLine();
break;
default:
- ASSERT(!this, "falscher Dispatcher");
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
rReq.Done();
@@ -975,56 +953,53 @@ void SwTextShell::ExecDelete(SfxRequest &rReq)
void SwTextShell::ExecTransliteration( SfxRequest & rReq )
{
using namespace ::com::sun::star::i18n;
- {
- sal_uInt32 nMode = 0;
-
- switch( rReq.GetSlot() )
- {
- case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
- break;
- case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
- break;
- case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
- break;
- case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
- break;
- case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
- break;
+ sal_uInt32 nMode = 0;
- case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
- break;
- case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
- break;
+ switch( rReq.GetSlot() )
+ {
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
+ case SID_TRANSLITERATE_UPPER:
+ nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ break;
+ case SID_TRANSLITERATE_LOWER:
+ nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ break;
- case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
- break;
- case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
- break;
+ case SID_TRANSLITERATE_HALFWIDTH:
+ nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ break;
+ case SID_TRANSLITERATE_FULLWIDTH:
+ nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ break;
- default:
- ASSERT(!this, "falscher Dispatcher");
- }
+ case SID_TRANSLITERATE_HIRAGANA:
+ nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ break;
+ case SID_TRANSLITERATE_KATAGANA:
+ nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ break;
- if( nMode )
- GetShell().TransliterateText( nMode );
+ default:
+ OSL_ENSURE(!this, "wrong dispatcher");
}
-}
-
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+ if( nMode )
+ GetShell().TransliterateText( nMode );
+}
+void SwTextShell::ExecRotateTransliteration( SfxRequest & rReq )
+{
+ if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
+ GetShell().TransliterateText( m_aRotateCase.getNextMode() );
+}
SwTextShell::SwTextShell(SwView &_rView) :
SwBaseShell(_rView), pPostItFldMgr( 0 )
@@ -1033,18 +1008,10 @@ SwTextShell::SwTextShell(SwView &_rView) :
SetHelpId(SW_TEXTSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwTextShell::~SwTextShell()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
const SfxItemSet *pArgs = rReq.GetArgs();
@@ -1126,7 +1093,6 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
delete pDlg;
}
- sal_Bool bFontChanged = sal_False;
if( aChars.Len() )
{
rSh.StartAllAction();
@@ -1159,7 +1125,6 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
// #108876# a font attribute has to be set always due to a guessed script type
if( aNewFont.GetName().Len() )
{
- bFontChanged = sal_True;
SvxFontItem aNewFontItem( aFont );
aNewFontItem.SetFamilyName( aNewFont.GetName());
aNewFontItem.SetFamily( aNewFont.GetFamily());
@@ -1195,13 +1160,12 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
rSh.ClearMark();
- // --> FME 2007-07-09 #i75891#
+ // #i75891#
// SETATTR_DONTEXPAND does not work if there are already hard attributes.
// Therefore we have to restore the font attributes.
rSh.SetMark();
rSh.SetAttr( aRestoreSet );
rSh.ClearMark();
- // <--
rSh.UpdateAttr();
aFont = aNewFontItem;
@@ -1219,4 +1183,4 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
}
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index db0bbe8599e5..f1c8c6ff9e06 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,7 +103,6 @@
#include <web.hrc>
#include "paratr.hxx"
#include <crsskip.hxx>
-#include <docstat.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/app.hxx>
#include <breakit.hxx>
@@ -116,7 +116,6 @@
#include <IDocumentStatistics.hxx>
#include <sfx2/sfxdlg.hxx>
-#include <svl/languageoptions.hxx>
#include <unotools/lingucfg.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
@@ -132,7 +131,6 @@
using namespace ::com::sun::star;
-
void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq )
{
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView()));
@@ -182,10 +180,10 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c
if ( bUseDialog && GetActiveView() )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwCharDlg( rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, DLG_CHAR );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( FN_INSERT_HYPERLINK == nSlot )
pDlg->SetCurPageId(TP_CHAR_URL);
}
@@ -262,10 +260,6 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c
delete pDlg;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
short lcl_AskRedlineMode(Window *pWin)
{
MessBox aQBox( pWin, 0,
@@ -429,7 +423,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
String aStr;
SFX_REQUEST_ARG( rReq, pFont, SfxStringItem, FN_PARAM_1 , sal_False );
-// SFX_REQUEST_ARG( rReq, pCharset, SfxInt16Item, FN_PARAM_2 , sal_False );
SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nSlot , sal_False );
if ( pNameItem )
aStr = pNameItem->GetValue();
@@ -444,7 +437,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT );
SvxFontItem aFont( rFont.GetFamily(), pFont->GetValue(),
rFont.GetStyleName(), rFont.GetPitch(), RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT );
- //pCharset ? (CharSet) pCharset->GetValue() : RTL_TEXTENCODING_DONTKNOW );
rWrtSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND );
rWrtSh.ResetSelect(0, sal_False);
rWrtSh.EndSelect();
@@ -457,10 +449,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_INSERT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE,
GetView().GetWindow(), rWrtSh, sal_False );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->SetHelpId(GetStaticInterface()->GetSlot(nSlot)->GetCommand());
if ( pDlg->Execute() == RET_OK )
{
@@ -470,7 +462,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
aReq.AppendItem( SfxStringItem( nId, pDlg->GetStr() ) );
if ( pDlg->GetFontName().Len() )
aReq.AppendItem( SfxStringItem( FN_PARAM_1, pDlg->GetFontName() ) );
- //aReq.AppendItem( SfxStringItem( FN_PARAM_2, pDlg->GetCharSet() ) );
ExecuteSlot( aReq );
}
@@ -481,10 +472,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), rWrtSh, DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -499,33 +490,31 @@ void SwTextShell::Execute(SfxRequest &rReq)
// #i78856, reset all attributes but not the language attributes
// (for this build an array of all relevant attributes and
// remove the languages from that)
- SvUShortsSort aAttribs;
+ std::set<sal_uInt16> aAttribs;
- sal_uInt16 __FAR_DATA aResetableSetRange[] = {
+ sal_uInt16 aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_LANGUAGE - 1,
RES_CHRATR_LANGUAGE + 1, RES_CHRATR_CJK_LANGUAGE - 1,
RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1,
RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
- RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
- sal_uInt16 __FAR_DATA *pUShorts = aResetableSetRange;
+ sal_uInt16 *pUShorts = aResetableSetRange;
while (*pUShorts)
{
sal_uInt16 nL = pUShorts[1] - pUShorts[0] + 1;
sal_uInt16 nE = pUShorts[0];
for (sal_uInt16 i = 0; i < nL; ++i)
- aAttribs.Insert( nE++ );
+ aAttribs.insert( aAttribs.end(), nE++ );
pUShorts += 2;
}
- rWrtSh.ResetAttr( &aAttribs );
+ rWrtSh.ResetAttr( aAttribs );
rReq.Done();
break;
}
@@ -546,10 +535,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwBreakDlg* pDlg = pFact->CreateSwBreakDlg( GetView().GetWindow(), rWrtSh, DLG_BREAK );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
nKind = pDlg->GetKind();
@@ -594,10 +583,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwInsertBookmarkDlg( GetView().GetWindow(), rWrtSh, rReq, DLG_INSERT_BOOKMARK );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -615,7 +604,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
case FN_AUTOFORMAT_REDLINE_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
aFlags.bWithRedlining = sal_True;
@@ -627,10 +616,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
pVFrame->ToggleChildWindow(FN_REDLINE_ACCEPT);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwModalRedlineAcceptDlg* pDlg = pFact->CreateSwModalRedlineAcceptDlg( &GetView().GetEditWin(), DLG_MOD_REDLINE_ACCEPT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
switch (lcl_AskRedlineMode(&GetView().GetEditWin()))
{
@@ -659,7 +648,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_AUTOFORMAT_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
rWrtSh.AutoFormat( &aFlags );
@@ -668,11 +657,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case FN_AUTOFORMAT_AUTO:
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !pACfg->IsAutoFmtByInput();
- if( bSet != pACfg->IsAutoFmtByInput() )
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !rACfg.IsAutoFmtByInput();
+ if( bSet != rACfg.IsAutoFmtByInput() )
{
- pACfg->SetAutoFmtByInput( bSet );
+ rACfg.SetAutoFmtByInput( bSet );
GetView().GetViewFrame()->GetBindings().Invalidate( nSlot );
if ( !pItem )
rReq.AppendItem( SfxBoolItem( GetPool().GetWhich(nSlot), bSet ) );
@@ -684,7 +673,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
// erstmal auf Blank defaulten
sal_Unicode cChar = ' ';
- rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get()->GetAutoCorrect(), cChar );
+ rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get().GetAutoCorrect(), cChar );
rReq.Done();
}
break;
@@ -692,10 +681,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_SORTING_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rWrtSh, DLG_SORTING );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -705,10 +694,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, rWrtSh);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -820,9 +809,9 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SelWrd();
}
//now remove the attribute
- SvUShortsSort aAttribs;
- aAttribs.Insert( RES_TXTATR_INETFMT );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( RES_TXTATR_INETFMT );
+ rWrtSh.ResetAttr( aAttribs );
if(!bSel)
{
rWrtSh.Pop(sal_False);
@@ -877,11 +866,13 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
+
+ sal_Bool bApplyCharUnit = ::HasCharUnit(0 != PTR_CAST(SwWebView, &GetView()));
+ SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit));
+
SfxItemSet aCoreSet( GetPool(),
RES_PARATR_BEGIN, RES_PARATR_END - 1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
- // <--
RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS,
SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS,
@@ -894,10 +885,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT,
FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME,
0);
- // --> OD 2008-01-16 #newlistlevelattrs#
// get also the list level indent values merged as LR-SPACE item, if needed.
rWrtSh.GetCurAttr( aCoreSet, true );
- // <--
aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE,
::GetHtmlMode(GetView().GetDocShell())));
@@ -935,12 +924,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
SfxBoolItem aStart( FN_NUMBER_NEWSTART, rWrtSh.IsNumRuleStart() );
aCoreSet.Put(aStart);
- // --> OD 2008-02-29 #refactorlists#
-// SfxUInt16Item aStartAt(FN_NUMBER_NEWSTART_AT,
-// rWrtSh.IsNodeNumStart());
SfxUInt16Item aStartAt( FN_NUMBER_NEWSTART_AT,
rWrtSh.GetNodeNumStart() );
- // <--
aCoreSet.Put(aStartAt);
}
SfxAbstractTabDialog* pDlg = NULL;
@@ -948,10 +933,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
if ( bUseDialog && GetActiveView() )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet,DLG_STD, DLG_PARA,NULL, sal_False, nDefPage );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
SfxItemSet* pSet = NULL;
if ( !bUseDialog )
@@ -992,7 +977,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
rReq.Done( *pSet );
::SfxToSwPageDescAttr( rWrtSh, *pSet );
- // --> OD 2006-12-06 #i56253#
+ // #i56253#
// enclose all undos.
// Thus, check conditions, if actions will be performed.
const bool bUndoNeeded( pSet->Count() ||
@@ -1002,18 +987,15 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
rWrtSh.StartUndo( UNDO_INSATTR );
}
- // <--
if( pSet->Count() )
{
rWrtSh.StartAction();
-// rWrtSh.StartUndo( UNDO_START );
if ( SFX_ITEM_SET == pSet->GetItemState(FN_DROP_TEXT, sal_False, &pItem) )
{
if ( ((SfxStringItem*)pItem)->GetValue().Len() )
rWrtSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue());
}
rWrtSh.SetAttr( *pSet );
-// rWrtSh.EndUndo( UNDO_END );
rWrtSh.EndAction();
SwTxtFmtColl* pColl = rWrtSh.GetCurTxtFmtColl();
if(pColl && pColl->IsAutoUpdateFmt())
@@ -1030,12 +1012,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
//if it's set to something different than USHRT_MAX
sal_Bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue();
- // --> OD 2007-06-11 #b6560525#
+ //
// Default value for restart value has to be USHRT_MAX
// in order to indicate that the restart value of the list
// style has to be used on restart.
sal_uInt16 nNumStart = USHRT_MAX;
- // <--
if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) )
{
nNumStart = ((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue();
@@ -1049,12 +1030,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SetNodeNumStart(nNumStart);
rWrtSh.SetNumRuleStart(sal_False);
}
- // --> OD 2006-12-06 #i56253#
+ // #i56253#
if ( bUndoNeeded )
{
rWrtSh.EndUndo( UNDO_INSATTR );
}
- // <--
}
delete pDlg;
@@ -1062,22 +1042,19 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case FN_NUM_CONTINUE:
{
- // --> OD 2008-03-18 #refactorlists#
String sContinuedListId;
const SwNumRule* pRule =
rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId );
- // --> OD 2009-08-26 #i86492#
+ // #i86492#
// Search also for bullet list
if ( !pRule )
{
pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId );
}
- // <--
if ( pRule )
{
rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId );
}
- // <--
}
break;
case FN_SELECT_PARA:
@@ -1111,30 +1088,15 @@ void SwTextShell::Execute(SfxRequest &rReq)
SwEditWin& rEditWin = GetView().GetEditWin();
rEditWin.SetTextColor(aSet);
SwApplyTemplate* pApply = rEditWin.GetApplyTemplate();
- SvxColorItem aItem(aSet, RES_CHRATR_COLOR);
- // besteht eine Selektion, wird sie gleich gefaerbt
- if(!pApply && rWrtSh.HasSelection())
+ // If there is a selection, then set the color on it
+ // otherwise, it'll be the color for the next text to be typed
+ if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
{
rWrtSh.SetAttr(SvxColorItem (aSet, RES_CHRATR_COLOR));
}
- else if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
- {
- GetView().GetViewFrame()->GetDispatcher()->Execute(SID_ATTR_CHAR_COLOR_EXT);
- }
rReq.Done();
-/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht
- SwEditWin& rEdtWin = GetView().GetEditWin();
-
- SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
- SvxColorItem aItem(aSet, RES_CHRATR_COLOR);
-
- if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
- {
- GetShell().SetAttr(aItem);
- }
-*/
}
}
break;
@@ -1165,15 +1127,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
rReq.Done();
-/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht
- if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
- {
- Brush aBrush(pItem ? BRUSH_SOLID : BRUSH_NULL);
- if(pItem)
- aBrush.SetColor( aSet );
- GetShell().SetAttr( SvxBrushItem(aBrush, RES_CHRATR_BACKGROUND) );
- }
-*/
}
break;
case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
@@ -1288,7 +1241,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
try
{
- uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
+ uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -1334,7 +1287,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -1342,17 +1295,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwTextShell::GetState( SfxItemSet &rSet )
{
SwWrtShell &rSh = GetShell();
@@ -1477,7 +1424,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_AUTOFORMAT_AUTO:
{
- rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get()->IsAutoFmtByInput() ));
+ rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get().IsAutoFmtByInput() ));
}
break;
case FN_GLOSSARY_DLG:
@@ -1592,7 +1539,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
GetViewFrame()->GetChildWindow( nWhich ) ));
break;
case FN_EDIT_HYPERLINK:
- case FN_REMOVE_HYPERLINK:
case FN_COPY_HYPERLINK_LOCATION:
{
SfxItemSet aSet(GetPool(),
@@ -1605,6 +1551,20 @@ void SwTextShell::GetState( SfxItemSet &rSet )
}
}
break;
+ case FN_REMOVE_HYPERLINK:
+ {
+ SfxItemSet aSet(GetPool(),
+ RES_TXTATR_INETFMT,
+ RES_TXTATR_INETFMT);
+ rSh.GetCurAttr(aSet);
+
+ // If a hyperlink is selected, either alone or along with other text...
+ if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, sal_True )) == 0) || rSh.HasReadonlySel())
+ {
+ rSet.DisableItem(nWhich);
+ }
+ }
+ break;
case SID_TRANSLITERATE_HALFWIDTH:
case SID_TRANSLITERATE_FULLWIDTH:
case SID_TRANSLITERATE_HIRAGANA:
@@ -1683,15 +1643,8 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_NUM_CONTINUE:
{
- // --> OD 2009-08-26 #i86492#
- // Allow continuation of previous list, even if at current cursor
- // a list is active.
-// if ( rSh.GetCurNumRule() )
-// rSet.DisableItem(nWhich);
-// else
- // <--
{
- // --> OD 2009-08-26 #i86492#
+ // #i86492#
// Search also for bullet list
String aDummy;
const SwNumRule* pRule =
@@ -1700,7 +1653,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{
pRule = rSh.SearchNumRule( false, false, false, -1, aDummy );
}
- // <--
if ( !pRule )
rSet.DisableItem(nWhich);
}
@@ -1722,14 +1674,16 @@ void SwTextShell::GetState( SfxItemSet &rSet )
nWhich = aIter.NextWhich();
}
}
-/* -----------------------------2002/07/05 10:31------------------------------
- Switch on/off header of footer of a page style - if an empty name is
- given all styles are changed
- ---------------------------------------------------------------------------*/
+
+/*
+ * Switch on/off header of footer of a page style - if an empty name is
+ * given all styles are changed
+ */
void SwTextShell::ChangeHeaderOrFooter(
const String& rStyleName, sal_Bool bHeader, sal_Bool bOn, sal_Bool bShowWarning)
{
SwWrtShell& rSh = GetShell();
+ rSh.addCurrentPosition();
rSh.StartAllAction();
rSh.StartUndo( UNDO_HEADER_FOOTER ); // #i7983#
sal_Bool bExecute = sal_True;
@@ -1742,9 +1696,9 @@ void SwTextShell::ChangeHeaderOrFooter(
String sTmp(aDesc.GetName());
if( !rStyleName.Len() || rStyleName == sTmp )
{
- if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
- ((bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
- (!bHeader && aDesc.GetMaster().GetFooter().IsActive())))
+ if( (bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
+ (bHeader && aDesc.GetMaster().GetHeader().IsActive())) ||
+ (!bHeader && aDesc.GetMaster().GetFooter().IsActive()))
{
bShowWarning = sal_False;
//Actions have to be closed while the dialog is showing
@@ -1788,3 +1742,4 @@ void SwTextShell::ChangeHeaderOrFooter(
rSh.EndAllAction();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx
index 3fe98d06eb45..00f0b25c8f7c 100644
--- a/sw/source/ui/shells/textsh2.cxx
+++ b/sw/source/ui/shells/textsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
-#if STLPORT_VERSION>=321
#include <cstdarg>
-#endif
#include <svtools/svmedit.hxx>
#include <svl/eitem.hxx>
@@ -40,9 +39,7 @@
#include <sfx2/event.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svl/stritem.hxx>
#include <svl/itemset.hxx>
#include <sfx2/request.hxx>
@@ -90,7 +87,6 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans;
-
#define DB_DD_DELIM 0x0b
struct DBTextStruct_Impl
@@ -100,10 +96,7 @@ struct DBTextStruct_Impl
Reference<XResultSet> xCursor;
Reference<XConnection> xConnection;
};
-inline void AddSelList( List& rLst, long nRow )
-{
- rLst.Insert( (void*)nRow , LIST_APPEND );
-}
+
void SwTextShell::ExecDB(SfxRequest &rReq)
{
const SfxItemSet *pArgs = rReq.GetArgs();
@@ -251,15 +244,11 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct )
{
if( pDBStruct )
@@ -288,7 +277,7 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct )
{
SwDBData aDBData = pDBStruct->aDBData;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
::std::auto_ptr<AbstractSwInsertDBColAutoPilot>pDlg (pFact->CreateSwInsertDBColAutoPilot( pThis->GetView(),
xSource,
xColSupp,
@@ -308,5 +297,4 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct )
return 0;
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index f699e2cc3853..8732d0dbe84b 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svl/whiter.hxx>
#include <svl/stritem.hxx>
#include <svl/itemiter.hxx>
@@ -52,29 +51,19 @@
#include "paratr.hxx"
#include <fmtinfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <uitool.hxx>
-#ifndef _TEXTSH_HXX
#include <textsh.hxx>
-#endif
#include <num.hxx>
#include <swundo.hxx>
#include <fmtcol.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <globals.h>
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include "swabstdlg.hxx"
#include "chrdlg.hrc"
@@ -191,7 +180,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
rSh.DontExpandFmt();
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
}
@@ -291,72 +280,11 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
}
-
-
-#ifdef CFRONT
-
-void lcl_SetAdjust(SvxAdjust eAdjst, SfxItemSet& rSet)
-{
- rSet.Put(SvxAdjustItem(eAdjst,RES_PARATR_ADJUST ));
-}
-
-
-
-void lcl_SetLineSpace(sal_uInt8 ePropL,SfxItemSet& rSet)
-{
- SvxLineSpacingItem aLineSpacing(ePropL, RES_PARATR_LINESPACING );
- aLineSpacing.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- if( 100 == ePropL )
- aLineSpacing.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
- else
- aLineSpacing.SetPropLineSpace(ePropL);
- rSet.Put( aLineSpacing );
-}
-
-
-
-void SwTextShell::ExecParaAttr(SfxRequest &rReq)
-{
- // gleiche beide Attribute holen, ist nicht teuerer !!
- SfxItemSet aSet( GetPool(), RES_PARATR_LINESPACING, RES_PARATR_ADJUST );
-
- switch (rReq.GetSlot())
- {
- case FN_SET_LEFT_PARA: lcl_SetAdjust(ADJLEFT,aSet); break;
- case FN_SET_RIGHT_PARA: lcl_SetAdjust(ADJRIGHT,aSet); break;
- case FN_SET_CENTER_PARA: lcl_SetAdjust(ADJCENTER,aSet); break;
- case SID_ATTR_PARA_ADJUST_BLOCK:lcl_SetAdjust(ADJBLOCK,aSet); break;
-
- case FN_SET_LINE_SPACE_1: lcl_SetLineSpace(100,aSet); break;
- case FN_SET_LINE_SPACE_15: lcl_SetLineSpace(150,aSet); break;
- case FN_SET_LINE_SPACE_2: lcl_SetLineSpace(200,aSet); break;
-
- default:
- DBG_ERROR("SwTextShell::ExecParaAttr falscher Dispatcher");
- return;
- }
- SwWrtShell& rWrtSh = GetShell();
- SwTxtFmtColl* pColl = rWrtSh.GetCurTxtFmtColl();
- if(pColl && pColl->IsAutoUpdateFmt())
- {
- rWrtSh.AutoUpdatePara(pColl, *pSet);
- }
- else
- {
- rWrtSh.SetAttr( aSet );
- rReq.Done( aSet );
- }
-}
-
-#else
-
-
-
void SwTextShell::ExecParaAttr(SfxRequest &rReq)
{
SvxAdjust eAdjst;
@@ -427,18 +355,6 @@ SET_LINESPACE:
case SID_ATTR_PARA_LEFT_TO_RIGHT :
case SID_ATTR_PARA_RIGHT_TO_LEFT :
{
- sal_Bool bSet = sal_True;
- int eState = pArgs ? pArgs->GetItemState(nSlot) : SFX_ITEM_DISABLED;
- if (pArgs && SFX_ITEM_SET == eState)
- bSet = ((const SfxBoolItem&)pArgs->Get(nSlot)).GetValue();
-/*
-// toggling of the slots not used anymore
-
- if(!bSet)
- nSlot = SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot ?
- SID_ATTR_PARA_RIGHT_TO_LEFT :
- SID_ATTR_PARA_LEFT_TO_RIGHT;
-*/
SfxItemSet aAdjustSet( GetPool(),
RES_PARATR_ADJUST, RES_PARATR_ADJUST );
GetShell().GetCurAttr(aAdjustSet);
@@ -448,7 +364,6 @@ SET_LINESPACE:
{
int eAdjust = (int)(( const SvxAdjustItem& )
aAdjustSet.Get(RES_PARATR_ADJUST)).GetAdjust();
-// bChgAdjust = SVX_ADJUST_CENTER != eAdjust && SVX_ADJUST_BLOCK != eAdjust;
bChgAdjust = (SVX_ADJUST_LEFT == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) ||
(SVX_ADJUST_RIGHT == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot);
}
@@ -485,23 +400,19 @@ SET_LINESPACE:
aRule.SetLevel(i, aFmt, aRule.Get(i) != 0);
}
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aSetRule( pCurRule->GetName(),
pCurRule->Get( 0 ).GetPositionAndSpaceMode() );
- // <--
aSetRule.SetSvxRule( aRule, GetShell().GetDoc());
aSetRule.SetAutoRule( sal_True );
- // --> OD 2008-03-17 #refactorlists#
// no start or continuation of a list - list style is only changed
GetShell().SetCurNumRule( aSetRule, false );
- // <--
}
}
}
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
SwWrtShell& rWrtSh = GetShell();
@@ -515,10 +426,6 @@ SET_LINESPACE:
rReq.Done();
}
-#endif
-
-
-
void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -558,11 +465,11 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
HINT_END, HINT_END, 0);
rSh.GetCurAttr(aSet);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aSet,
rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (pDlg->Execute() == RET_OK)
{
rSh.StartAction();
@@ -604,7 +511,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
}
@@ -845,3 +752,4 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx
index 8670a296f4bb..2b27752741db 100644
--- a/sw/source/ui/shells/txtcrsr.cxx
+++ b/sw/source/ui/shells/txtcrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,32 +32,22 @@
#include <sfx2/request.hxx>
#include <svl/eitem.hxx>
-#ifndef __SBX_SBXVARIABLE_HXX //autogen
#include <basic/sbxvar.hxx>
-#endif
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _TEXTSH_HXX
#include <textsh.hxx>
-#endif
#include <num.hxx>
#include <edtwin.hxx>
#include <crsskip.hxx>
#include <doc.hxx>
#include <docsh.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <globals.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <svx/svdouno.hxx>
#include <svx/fmshell.hxx>
@@ -106,7 +97,7 @@ void SwTextShell::ExecBasicMove(SfxRequest &rReq)
case FN_CHAR_RIGHT: rSh.Right( CRSR_SKIP_CELLS, bSelect, 1, sal_False, sal_True ); break;
case FN_LINE_UP: rSh.Up ( bSelect, 1 ); break;
case FN_LINE_DOWN: rSh.Down ( bSelect, 1 ); break;
- default: ASSERT(sal_False, falscher Dispatcher); return;
+ default: OSL_FAIL("wrong Dispatcher"); return;
}
}
@@ -143,7 +134,7 @@ void SwTextShell::ExecMove(SfxRequest &rReq)
case FN_SELECT_WORD: bRet = rSh.SelNearestWrd(); break;
case SID_SELECTALL: bRet = 0 != rSh.SelAll(); break;
- default: ASSERT(sal_False, falscher Dispatcher); return;
+ default: OSL_FAIL("wrong dispatcher"); return;
}
if ( bRet )
@@ -180,7 +171,7 @@ void SwTextShell::ExecMovePage(SfxRequest &rReq)
case FN_END_OF_PAGE_SEL:
case FN_END_OF_PAGE: rSh.EndPg ( FN_END_OF_PAGE_SEL == nSlot ); break;
- default: ASSERT(sal_False, falscher Dispatcher); return;
+ default: OSL_FAIL("wrong dispatcher"); return;
}
rReq.Done();
}
@@ -197,7 +188,7 @@ void SwTextShell::ExecMoveCol(SfxRequest &rReq)
case FN_END_OF_NEXT_COLUMN: rSh.EndOfNextColumn ( sal_False ); break;
case FN_START_OF_PREV_COLUMN: rSh.StartOfPrevColumn( sal_False ); break;
case FN_END_OF_PREV_COLUMN: rSh.EndOfPrevColumn ( sal_False ); break;
- default: ASSERT(sal_False, falscher Dispatcher); return;
+ default: OSL_FAIL("wrong dispatcher"); return;
}
rReq.Done();
}
@@ -208,39 +199,38 @@ void SwTextShell::ExecMoveLingu(SfxRequest &rReq)
GetView().GetEditWin().FlushInBuffer();
sal_uInt16 nSlot = rReq.GetSlot();
- sal_Bool bRet = sal_False;
switch ( nSlot )
{
case FN_NEXT_WORD_SEL:
- case FN_NEXT_WORD: bRet = rSh.NxtWrd( FN_NEXT_WORD_SEL == nSlot );
+ case FN_NEXT_WORD: rSh.NxtWrd( FN_NEXT_WORD_SEL == nSlot );
break;
case FN_START_OF_PARA_SEL:
- case FN_START_OF_PARA: bRet = rSh.SttPara( FN_START_OF_PARA_SEL == nSlot );
+ case FN_START_OF_PARA: rSh.SttPara( FN_START_OF_PARA_SEL == nSlot );
break;
case FN_END_OF_PARA_SEL:
- case FN_END_OF_PARA: bRet = rSh.EndPara( FN_END_OF_PARA_SEL == nSlot );
+ case FN_END_OF_PARA: rSh.EndPara( FN_END_OF_PARA_SEL == nSlot );
break;
case FN_PREV_WORD_SEL:
- case FN_PREV_WORD: bRet = rSh.PrvWrd( FN_PREV_WORD_SEL == nSlot );
+ case FN_PREV_WORD: rSh.PrvWrd( FN_PREV_WORD_SEL == nSlot );
break;
case FN_NEXT_SENT_SEL:
- case FN_NEXT_SENT: bRet = rSh.FwdSentence( FN_NEXT_SENT_SEL == nSlot );
+ case FN_NEXT_SENT: rSh.FwdSentence( FN_NEXT_SENT_SEL == nSlot );
break;
case FN_PREV_SENT_SEL:
- case FN_PREV_SENT: bRet = rSh.BwdSentence( FN_PREV_SENT_SEL == nSlot );
+ case FN_PREV_SENT: rSh.BwdSentence( FN_PREV_SENT_SEL == nSlot );
break;
- case FN_NEXT_PARA: bRet = rSh.FwdPara ( sal_False );
+ case FN_NEXT_PARA: rSh.FwdPara ( sal_False );
break;
- case FN_PREV_PARA: bRet = rSh.BwdPara ( sal_False );
+ case FN_PREV_PARA: rSh.BwdPara ( sal_False );
break;
- default: ASSERT(sal_False, falscher Dispatcher); return;
+ default: OSL_FAIL("wrong dispatcher"); return;
}
rReq.Done();
}
@@ -358,7 +348,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
@@ -368,3 +358,4 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index d3a8338e9416..09ea84b3c6e9 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/request.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
@@ -96,10 +95,6 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
break;
case FN_NUMBER_BULLETS:
{
- // --> OD 2008-02-29 #refactorlists#
-// // per default sal_True, damit die Schleife im Dialog richtig arbeitet!
-// sal_Bool bHasChild = sal_True;
- // <--
SfxItemSet aSet(GetPool(),
SID_HTML_MODE, SID_HTML_MODE,
SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
@@ -130,11 +125,9 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
aRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
aSet.Put(SvxNumBulletItem(aRule));
- // --> OD 2008-02-29 #refactorlists# - removed <bHasChild>
- ASSERT( GetShell().GetNumLevel() < MAXLEVEL,
+ OSL_ENSURE( GetShell().GetNumLevel() < MAXLEVEL,
"<SwTextShell::ExecEnterNum()> - numbered node without valid list level. Serious defect -> please inform OD." );
sal_uInt16 nLevel = GetShell().GetNumLevel();
- // <--
if( nLevel < MAXLEVEL )
{
nLevel = 1<<nLevel;
@@ -143,12 +136,9 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
}
else
{
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 );
@@ -163,13 +153,12 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
aFmt.SetLSpace(720);
aFmt.SetAbsLSpace(n * 720);
}
- // --> FME 2005-01-21 #i38904# Default alignment for
+ // #i38904# Default alignment for
// numbering/bullet should be rtl in rtl paragraph:
if ( bRightToLeft )
{
aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
}
- // <--
aSvxRule.SetLevel( n, aFmt, sal_False );
}
aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
@@ -183,10 +172,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
pDocSh->PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(pDocSh)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET,
GetView().GetWindow(), &aSet, GetShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
sal_uInt16 nRet = pDlg->Execute();
const SfxPoolItem* pItem;
if( RET_OK == nRet )
@@ -197,22 +186,17 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
rReq.Done();
SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
pSetRule->UnLinkGraphics();
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aSetRule( pCurRule
? pCurRule->GetName()
: GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule( sal_True );
- // --> OD 2008-03-17 #refactorlists#
// No start of new list, if an existing list style is edited.
// Otherwise start a new list.
const bool bCreateList = (pCurRule == 0);
GetShell().SetCurNumRule( aSetRule, bCreateList );
- // <--
}
// wenn der Dialog mit OK verlassen wurde, aber nichts ausgewaehlt
// wurde dann muss die Numerierung zumindest eingeschaltet werden,
@@ -222,18 +206,13 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
rReq.AppendItem( *pItem );
rReq.Done();
SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aSetRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule( sal_True );
- // --> OD 2008-03-17 #refactorlists#
// start new list
GetShell().SetCurNumRule( aSetRule, true );
- // <--
}
}
else if(RET_USER == nRet)
@@ -243,9 +222,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
}
break;
default:
- ASSERT(sal_False, falscher Dispatcher);
+ OSL_FAIL("wrong dispatcher");
return;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/smartmenu/stmenu.cxx b/sw/source/ui/smartmenu/stmenu.cxx
index 2181cc989ca6..16e02a3d13ab 100644
--- a/sw/source/ui/smartmenu/stmenu.cxx
+++ b/sw/source/ui/smartmenu/stmenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,12 +37,8 @@
#include <SwSmartTagMgr.hxx>
-#ifndef _STMENU_HRC
#include <stmenu.hrc>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <breakit.hxx>
#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
@@ -57,8 +54,6 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView,
mpSwView ( pSwView ),
mxTextRange( xTextRange )
{
- //CreateAutoMnemonics();
-
Reference <frame::XController> xController = mpSwView->GetController();
const lang::Locale aLocale( SW_BREAKITER()->GetLocale( (LanguageType)GetAppLanguage() ) );
@@ -184,3 +179,5 @@ sal_uInt16 SwSmartTagPopup::Execute( const Rectangle& rWordPos, Window* pWin )
return nId;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx
index ce370ced3304..ba251cd045b9 100644
--- a/sw/source/ui/table/chartins.cxx
+++ b/sw/source/ui/table/chartins.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,7 +83,7 @@ Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize, co
Point aRet;
- DBG_ASSERT( pParentWin, "Window not found" );
+ OSL_ENSURE( pParentWin, "Window not found" );
if (pParentWin)
{
Rectangle aObjPixel = pParentWin->LogicToPixel( rLogicChart, pParentWin->GetMapMode() );
@@ -148,11 +149,6 @@ Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize, co
return aRet;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-
void SwInsertChart(Window* pParent, SfxBindings* pBindings )
{
(void) pParent;
@@ -177,9 +173,6 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
{
SwFrmFmt* pTblFmt = rWrtShell.GetTableFmt();
String aCurrentTblName = pTblFmt->GetName();
-// String aText( String::CreateFromAscii("<.>") ); // was used for UI
-// aText.Insert( rWrtShell.GetBoxNms(), 2);
-// aText.Insert( aCurrentTblName, 1 );
aRangeString = aCurrentTblName;
aRangeString += OUString::valueOf( sal_Unicode('.') );
aRangeString += rWrtShell.GetBoxNms();
@@ -203,7 +196,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
{
uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- C2U("com.sun.star.comp.chart2.WizardDialog")
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.WizardDialog"))
, xContext), uno::UNO_QUERY);
uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY );
if( xInit.is() )
@@ -213,10 +206,10 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
uno::Sequence<uno::Any> aSeq(2);
uno::Any* pArray = aSeq.getArray();
beans::PropertyValue aParam1;
- aParam1.Name = C2U("ParentWindow");
+ aParam1.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam1.Value <<= uno::makeAny(xDialogParentWindow);
beans::PropertyValue aParam2;
- aParam2.Name = C2U("ChartModel");
+ aParam2.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel"));
aParam2.Value <<= uno::makeAny(xChartModel);
pArray[0] <<= uno::makeAny(aParam1);
pArray[1] <<= uno::makeAny(aParam2);
@@ -230,7 +223,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
{
//get dialog size:
awt::Size aDialogAWTSize;
- if( xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") )
+ if( xDialogProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) )
>>= aDialogAWTSize )
{
Size aDialogSize( aDialogAWTSize.Width, aDialogAWTSize.Height );
@@ -242,14 +235,14 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
aSwRect = pFlyFrmFmt->GetAnchoredObj()->GetObjRectWithSpaces();
Rectangle aRect( aSwRect.SVRect() );
Point aDialogPos = SwGetChartDialogPos( &rWrtShell.GetView().GetEditWin(), aDialogSize, aRect );
- xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"),
+ xDialogProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Position")),
uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
}
}
}
catch( uno::Exception& )
{
- DBG_ERROR( "Chart wizard couldn't be positioned automatically\n" );
+ OSL_FAIL("Chart wizard couldn't be positioned automatically\n" );
}
}
@@ -261,7 +254,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
}
else
{
- DBG_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
+ OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
"dialog execution failed" );
}
}
@@ -273,7 +266,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
}
-void __EXPORT AutoEdit::KeyInput( const KeyEvent& rEvt )
+void AutoEdit::KeyInput( const KeyEvent& rEvt )
{
sal_uInt16 nCode = rEvt.GetKeyCode().GetCode();
if( nCode != KEY_SPACE )
@@ -283,3 +276,4 @@ void __EXPORT AutoEdit::KeyInput( const KeyEvent& rEvt )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/chartins.src b/sw/source/ui/table/chartins.src
index b4cd8fdbeff0..a65c8801db20 100644
--- a/sw/source/ui/table/chartins.src
+++ b/sw/source/ui/table/chartins.src
@@ -102,8 +102,6 @@ ModelessDialog DLG_INSERT_CHART
HelpID = "sw:PushButton:DLG_INSERT_CHART:BT_PREV";
Pos = MAP_APPFONT ( 130 , 151 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- // ### ACHTUNG: Neuer Text in Resource? << ~Zurück : << Zurück
- /* ### ACHTUNG: Neuer Text in Resource? << ~Zurück : << ~Zur³ck */
TabStop = TRUE ;
Disable = TRUE ;
Text [ en-US ] = "<< ~Back" ;
diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx
index d9e3d64b22e2..e3cb3f1b3536 100644
--- a/sw/source/ui/table/colwd.cxx
+++ b/sw/source/ui/table/colwd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,27 +39,15 @@
#include <colwd.hxx>
#include <tablemgr.hxx>
#include <wrtsh.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
#include <usrpref.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _COLWD_HRC
#include <colwd.hrc>
-#endif
-#ifndef _TABLE_HRC
#include <table.hrc>
-#endif
IMPL_LINK_INLINE_START( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG )
@@ -121,3 +110,4 @@ void SwTableWidthDlg::Apply()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 411868ac6b3d..f2752fe92781 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -233,10 +234,10 @@ SwConvertTableDlg:: ~SwConvertTableDlg()
IMPL_LINK( SwConvertTableDlg, AutoFmtHdl, PushButton*, pButton )
{
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute())
pDlg->FillAutoFmtOfIndex( pTAutoFmt );
delete pDlg;
@@ -279,3 +280,5 @@ IMPL_LINK(SwConvertTableDlg, ReapeatHeaderCheckBoxHdl, void*, EMPTYARG)
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index e6ad93335c0d..9f8a711c4533 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -184,9 +185,6 @@ IMPL_LINK_INLINE_START( SwInsTableDlg, ModifyName, Edit *, pEdit )
}
IMPL_LINK_INLINE_END( SwInsTableDlg, ModifyName, Edit *, EMPTYARG )
-/*-----------------15.04.98 11:36-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField )
{
if(pField == &aColEdit)
@@ -220,10 +218,10 @@ IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField )
IMPL_LINK( SwInsTableDlg, AutoFmtHdl, PushButton*, pButton )
{
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute())
pDlg->FillAutoFmtOfIndex( pTAutoFmt );
delete pDlg;
@@ -251,3 +249,4 @@ IMPL_LINK(SwInsTableDlg, ModifyRepeatHeaderNF_Hdl, void*, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/mergetbl.cxx b/sw/source/ui/table/mergetbl.cxx
index 377959ec89cc..dc5c41cec24a 100644
--- a/sw/source/ui/table/mergetbl.cxx
+++ b/sw/source/ui/table/mergetbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,12 +36,8 @@
#include <swtypes.hxx>
#include <mergetbl.hxx>
-#ifndef _MERGETBL_HRC
#include <mergetbl.hrc>
-#endif
-#ifndef _TABLE_HRC
#include <table.hrc>
-#endif
SwMergeTblDlg::SwMergeTblDlg( Window *pParent, sal_Bool& rWithPrev )
@@ -64,3 +61,4 @@ void SwMergeTblDlg::Apply()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index a1d1770136d7..676bc8a038db 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,24 +45,14 @@
#include <rowht.hxx>
#include <wrtsh.hxx>
#include <frmatr.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <swmodule.hxx>
#include <usrpref.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _ROWHT_HRC
#include <rowht.hrc>
-#endif
-#ifndef _TABLE_HRC
#include <table.hrc>
-#endif
@@ -118,3 +109,4 @@ SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/rowht.src b/sw/source/ui/table/rowht.src
index b9abcd05ce94..c947ed7405d5 100644
--- a/sw/source/ui/table/rowht.src
+++ b/sw/source/ui/table/rowht.src
@@ -35,7 +35,6 @@ ModalDialog DLG_ROW_HEIGHT
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 157 , 60 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Zeilenhöhe : Zellenhöhe */
Text [ en-US ] = "Row Height" ;
Moveable = TRUE ;
OKButton BT_OK
@@ -80,7 +79,6 @@ ModalDialog DLG_ROW_HEIGHT
HelpID = "sw:CheckBox:DLG_ROW_HEIGHT:CB_AUTOHEIGHT";
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~dynamisch anpassen : auto. H~öhe */
TabStop = TRUE ;
Text [ en-US ] = "~Fit to size" ;
};
diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx
index 7037e2b0aa05..35315ca22ef2 100644
--- a/sw/source/ui/table/splittbl.cxx
+++ b/sw/source/ui/table/splittbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,9 +39,7 @@
#include <splittbl.hrc>
#include <table.hrc>
#include <tblenum.hxx>
-/*-----------------17.03.98 10:56-------------------
---------------------------------------------------*/
SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) :
SvxStandardDialog(pParent, SW_RES(DLG_SPLIT_TABLE)),
aOKPB( this, SW_RES(PB_OK )),
@@ -58,9 +57,6 @@ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) :
aCntntCopyRB.Check();
}
-/*-----------------17.03.98 10:56-------------------
-
---------------------------------------------------*/
void SwSplitTblDlg::Apply()
{
m_nSplit = HEADLINE_CNTNTCOPY;
@@ -77,3 +73,4 @@ void SwSplitTblDlg::Apply()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx
index a6b96ab8930c..a3ca467f4d1a 100644
--- a/sw/source/ui/table/swtablerep.cxx
+++ b/sw/source/ui/table/swtablerep.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <vcl/msgbox.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
-#include <svx/htmlmode.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -49,53 +47,25 @@
#include <fmtrowsplt.hxx>
#include <svx/htmlmode.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <uitool.hxx>
#include <frmatr.hxx>
-#ifndef _TABLEPG_HXX
#include <tablepg.hxx>
-#endif
#include <tablemgr.hxx>
#include <pagedesc.hxx>
#include <poolfmt.hxx>
#include <SwStyleNameMapper.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _TABLEDLG_HRC
#include <tabledlg.hrc>
-#endif
-#ifndef _TABLE_HRC
#include <table.hrc>
-#endif
#include "swtablerep.hxx"
-#ifdef DEBUG_TBLDLG
-void DbgTColumn(TColumn* pTColumn, sal_uInt16 nCount)
-{
- for(sal_uInt16 i = 0; i < nCount; i++)
- {
- String sMsg(i);
- sMsg += pTColumn[i].bVisible ? " v " : " h ";
- sMsg += pTColumn[i].nWidth;
- DBG_ERROR(sMsg)
- }
-}
-#endif
-
-
-/*-----------------20.08.96 09.43-------------------
---------------------------------------------------*/
SwTableRep::SwTableRep( const SwTabCols& rTabCol, sal_Bool bCplx )
:
nTblWidth(0),
@@ -128,15 +98,11 @@ SwTableRep::SwTableRep( const SwTabCols& rTabCol, sal_Bool bCplx )
nAllCols++;
}
-/*-----------------20.08.96 09.43-------------------
---------------------------------------------------*/
SwTableRep::~SwTableRep()
{
delete[] pTColumns;
}
-/*-----------------20.08.96 13.33-------------------
---------------------------------------------------*/
sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
{
long nOldLeft = rTabCols.GetLeft(),
@@ -152,10 +118,6 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
break;
}
-#ifdef DEBUG_TBLDLG
-#define DbgTColumn(pTColumns, nAllCols);
-#endif
-
SwTwips nPos = 0;
SwTwips nLeft = GetLeftSpace();
rTabCols.SetLeft(nLeft);
@@ -176,10 +138,6 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
pOldTColumns[nAllCols - 1].nWidth = rTabCols.GetRight() - rTabCols.GetLeft() - nStart;
pOldTColumns[nAllCols - 1].bVisible = sal_True;
-#ifdef DEBUG_TBLDLG
-#define DbgTColumn(pOldTColumns, nAllCols);
-#endif
-
sal_uInt16 nOldPos = 0;
sal_uInt16 nNewPos = 0;
SwTwips nOld = 0;
@@ -239,3 +197,5 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
rTabCols.SetRight(rTabCols.GetRightMax());
return bSingleLine;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 9fe0b570cc6f..25708a3843c9 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,13 +33,10 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <vcl/msgbox.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
-#include <svx/htmlmode.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -55,35 +53,23 @@
#include "access.hrc"
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <uitool.hxx>
#include <frmatr.hxx>
#include <tabledlg.hxx>
-#ifndef _TABLEPG_HXX
#include <tablepg.hxx>
-#endif
#include <tablemgr.hxx>
#include <pagedesc.hxx>
#include <uiitems.hxx>
#include <poolfmt.hxx>
#include <SwStyleNameMapper.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _TABLEDLG_HRC
#include <tabledlg.hrc>
-#endif
-#ifndef _TABLE_HRC
#include <table.hrc>
-#endif
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
#include <svx/flagsdef.hxx>
@@ -92,41 +78,6 @@
using namespace ::com::sun::star;
-#ifdef DEBUG_TBLDLG
-void DbgTblRep(SwTableRep* pRep)
-{
- DBG_ERROR(String(pRep->GetColCount()))
- DBG_ERROR(String(pRep->GetAllColCount()))
- SwTwips nSum = 0;
- for(sal_uInt16 i = 0; i < pRep->GetAllColCount(); i++)
- {
- String sMsg(i);
- sMsg += pRep->GetColumns()[i].bVisible ? " v " : " h ";
- sMsg += pRep->GetColumns()[i].nWidth;
- nSum +=pRep->GetColumns()[i].nWidth;
- DBG_ERROR(sMsg)
- }
- String sMsg("Spaltensumme: ");
- sMsg += nSum;
- sMsg += " Tblbreite: ";
- sMsg += pRep->GetWidth();
- DBG_ERROR(sMsg)
- sMsg = "Gesamt/Links/Rechts: ";
- sMsg += pRep->GetSpace();
- sMsg += '/';
- sMsg += pRep->GetLeftSpace();
- sMsg += '/';
- sMsg += pRep->GetRightSpace();
- DBG_ERROR(sMsg)
- sMsg = "Align: ";
- sMsg += pRep->GetAlign();
- DBG_ERROR(sMsg)
-
-};
-
-#endif
-
-
SwFormatTablePage::SwFormatTablePage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage(pParent, SW_RES( TP_FORMAT_TABLE ), rSet ),
aOptionsFL(this, SW_RES( FL_OPTIONS )),
@@ -183,8 +134,7 @@ SwFormatTablePage::SwFormatTablePage( Window* pParent, const SfxItemSet& rSet )
Init();
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwFormatTablePage::Init()
{
aLeftMF.MetricField::SetMin(-999999);
@@ -225,7 +175,7 @@ void SwFormatTablePage::Init()
IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, CheckBox *, pBtn )
{
- DBG_ASSERT(pTblData, "Tabellendaten nicht da?");
+ OSL_ENSURE(pTblData, "table data not available?");
sal_Bool bIsChecked = pBtn->IsChecked();
sal_Int64 nLeft = aLeftMF.DenormalizePercent(aLeftMF.GetValue(FUNIT_TWIP ));
sal_Int64 nRight = aRightMF.DenormalizePercent(aRightMF.GetValue(FUNIT_TWIP ));
@@ -259,8 +209,7 @@ IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, CheckBox *, pBtn )
return 0;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK( SwFormatTablePage, AutoClickHdl, CheckBox *, pBox )
{
sal_Bool bRestore = sal_True,
@@ -332,9 +281,7 @@ IMPL_LINK( SwFormatTablePage, RightModifyHdl, MetricField *, EMPTYARG )
if(aFreeBtn.IsChecked())
{
sal_Bool bEnable = aRightMF.GetValue() == 0;
-// aWidthMF.Enable(bEnable);
aRelWidthCB.Enable(bEnable);
-// aWidthFT.Enable(bEnable);
if ( !bEnable )
{
aRelWidthCB.Check(sal_False);
@@ -347,8 +294,7 @@ IMPL_LINK( SwFormatTablePage, RightModifyHdl, MetricField *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK_INLINE_START( SwFormatTablePage, UpDownLoseFocusHdl, MetricField *, pEdit )
{
if( &aRightMF == pEdit)
@@ -460,16 +406,14 @@ void SwFormatTablePage::ModifyHdl( Edit* pEdit )
bModified = sal_True;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
SfxTabPage* SwFormatTablePage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwFormatTablePage( pParent, rAttrSet );
}
-/*------------------------------------------------------------------------
--------------------------------------------------------------------------*/
+
sal_Bool SwFormatTablePage::FillItemSet( SfxItemSet& rCoreSet )
{
// Testen, ob eins der Control noch den Focus hat
@@ -517,8 +461,7 @@ sal_Bool SwFormatTablePage::FillItemSet( SfxItemSet& rCoreSet )
return bModified;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwFormatTablePage::Reset( const SfxItemSet& )
{
const SfxItemSet& rSet = GetItemSet();
@@ -654,7 +597,7 @@ void SwFormatTablePage::Reset( const SfxItemSet& )
//text direction
if( SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, sal_True, &pItem ) )
{
- sal_uInt32 nVal = ((SvxFrameDirectionItem*)pItem)->GetValue();
+ sal_uIntPtr nVal = ((SvxFrameDirectionItem*)pItem)->GetValue();
sal_uInt16 nPos = aTextDirectionLB.GetEntryPos( (void*) nVal );
aTextDirectionLB.SelectEntryPos( nPos );
aTextDirectionLB.SaveValue();
@@ -667,11 +610,10 @@ void SwFormatTablePage::Reset( const SfxItemSet& )
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwFormatTablePage::ActivatePage( const SfxItemSet& rSet )
{
- DBG_ASSERT(pTblData, "Tabellendaten nicht da?");
+ OSL_ENSURE(pTblData, "table data not available?");
if(SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_REP ))
{
SwTwips nCurWidth = text::HoriOrientation::FULL != pTblData->GetAlign() ?
@@ -694,8 +636,7 @@ void SwFormatTablePage::ActivatePage( const SfxItemSet& rSet )
}
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet )
{
// os: VCL sorgt nicht dafuer, dass das aktive Control im
@@ -799,8 +740,6 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet )
pTblData->SetAlign(nAlign);
}
-
- // if( text::HoriOrientation::CENTER && lWidth != (SwTwips)aWidthMF.GetSavedValue())
if(pTblData->GetWidth() != lWidth )
{
pTblData->SetWidthChanged();
@@ -810,9 +749,6 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet )
if(pTblData->HasWidthChanged())
_pSet->Put(SwPtrItem(FN_TABLE_REP, pTblData));
}
-#ifdef DEBUG_TBLDLG
-DbgTblRep(pTblData)
-#endif
}
return sal_True;
}
@@ -883,16 +819,14 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
{
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
SfxTabPage* SwTableColumnPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwTableColumnPage( pParent, rAttrSet );
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::Reset( const SfxItemSet& )
{
const SfxItemSet& rSet = GetItemSet();
@@ -939,8 +873,7 @@ void SwTableColumnPage::Reset( const SfxItemSet& )
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::Init(sal_Bool bWeb)
{
FieldUnit aMetric = ::GetDfltMetric(bWeb);
@@ -967,8 +900,7 @@ void SwTableColumnPage::Init(sal_Bool bWeb)
aProportionalCB.SetClickHdl( aLk );
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox )
{
//Anzeigefenster verschieben
@@ -1009,8 +941,7 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox )
return 0;
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK_INLINE_START( SwTableColumnPage, UpHdl, PercentField *, pEdit )
{
bModified = sal_True;
@@ -1019,8 +950,7 @@ IMPL_LINK_INLINE_START( SwTableColumnPage, UpHdl, PercentField *, pEdit )
};
IMPL_LINK_INLINE_END( SwTableColumnPage, UpHdl, PercentField *, pEdit )
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK_INLINE_START( SwTableColumnPage, DownHdl, PercentField *, pEdit )
{
bModified = sal_True;
@@ -1029,8 +959,7 @@ IMPL_LINK_INLINE_START( SwTableColumnPage, DownHdl, PercentField *, pEdit )
};
IMPL_LINK_INLINE_END( SwTableColumnPage, DownHdl, PercentField *, pEdit )
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK_INLINE_START( SwTableColumnPage, LoseFocusHdl, PercentField *, pEdit )
{
if(pEdit->IsModified())
@@ -1042,8 +971,7 @@ IMPL_LINK_INLINE_START( SwTableColumnPage, LoseFocusHdl, PercentField *, pEdit )
};
IMPL_LINK_INLINE_END( SwTableColumnPage, LoseFocusHdl, PercentField *, pEdit )
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
IMPL_LINK( SwTableColumnPage, ModeHdl, CheckBox*, pBox )
{
sal_Bool bCheck = pBox->IsChecked();
@@ -1056,8 +984,7 @@ IMPL_LINK( SwTableColumnPage, ModeHdl, CheckBox*, pBox )
return 0;
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
sal_Bool SwTableColumnPage::FillItemSet( SfxItemSet& )
{
for( sal_uInt16 i = 0; i < MET_FIELDS; i++ )
@@ -1076,8 +1003,7 @@ sal_Bool SwTableColumnPage::FillItemSet( SfxItemSet& )
return bModified;
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::ModifyHdl( PercentField* pEdit )
{
sal_uInt16 nAktPos;
@@ -1093,8 +1019,7 @@ void SwTableColumnPage::ModifyHdl( PercentField* pEdit )
UpdateCols( nAktPos );
};
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
{
SwTwips nSum = 0;
@@ -1145,7 +1070,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
nDiff = 0;
SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
}
- DBG_ASSERT(nDiff >= 0, "nDiff < 0 kann hier nicht sein!");
+ OSL_ENSURE(nDiff >= 0, "nDiff < 0 cannot be here!");
}
}
}
@@ -1153,7 +1078,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
{
// Differenz wird ueber die Tabellenbreite ausgeglichen,
// andere Spalten bleiben unveraendert
- DBG_ASSERT(nDiff <= pTblData->GetSpace() - nTableWidth, "Maximum falsch eingestellt" );
+ OSL_ENSURE(nDiff <= pTblData->GetSpace() - nTableWidth, "wrong maximum" );
SwTwips nActSpace = pTblData->GetSpace() - nTableWidth;
if(nDiff > nActSpace)
{
@@ -1169,7 +1094,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
{
// Alle Spalten werden proportional mitveraendert, die Tabellenbreite wird
// entsprechend angepasst
- DBG_ASSERT(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "Maximum falsch eingestellt" );
+ OSL_ENSURE(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "wrong maximum" );
long nAdd = nDiff;
if(nDiff * nNoOfVisibleCols > pTblData->GetSpace() - nTableWidth)
{
@@ -1196,35 +1121,8 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
}
nTableWidth += nAdd;
-
- }
- else
- {
-// Die Differenz wird gleichmaessig auf alle anderen Spalten aufgeteilt
-// die Tabellenbreite bleibt konstant
-/*
- SwTwips nDiffn = nDiff/(nNoOfVisibleCols - 1);
- if(nDiff < 0 && (nNoOfVisibleCols - 1) * nDiffn != nDiff)
- nDiffn-- ;
- sal_uInt16 nStart = nAktPos++;
- if(nAktPos == nNoOfVisibleCols)
- nStart = 0;
- for(sal_uInt16 i = 0; i < nNoOfVisibleCols; i++ )
- {
- if((nVisWidth = GetVisibleWidth(i)) + nDiff < MINLAY)
- {
- nAdd += nVisWidth - MINLAY;
- SetVisibleWidth(i, MINLAY);
- }
- }
-*/
-
}
-#ifdef DEBUG_TBLDLG
-DbgTblRep(pTblData)
-#endif
-
if(!bPercentMode)
aSpaceED.SetValue(aSpaceED.Normalize( pTblData->GetSpace() - nTableWidth) , FUNIT_TWIP);
@@ -1237,8 +1135,7 @@ DbgTblRep(pTblData)
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::ActivatePage( const SfxItemSet& )
{
bPercentMode = pTblData->GetWidthPercent() != 0;
@@ -1277,17 +1174,12 @@ void SwTableColumnPage::ActivatePage( const SfxItemSet& )
aModifyTableCB.Enable( !bPercentMode && bModifyTbl );
aProportionalCB.Enable(!bPercentMode && bModifyTbl );
-/* if(pTblData->IsLineSelected() && pTblData->IsComplex())
- {
-
- }*/
aSpaceED.SetValue(aSpaceED.Normalize(
pTblData->GetSpace() - nTableWidth) , FUNIT_TWIP);
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
int SwTableColumnPage::DeactivatePage( SfxItemSet* _pSet )
{
if(_pSet)
@@ -1345,16 +1237,12 @@ int SwTableColumnPage::DeactivatePage( SfxItemSet* _pSet )
}
pTblData->SetWidthChanged();
}
-#ifdef DEBUG_TBLDLG
-DbgTblRep(pTblData)
-#endif
_pSet->Put(SwPtrItem( FN_TABLE_REP, pTblData ));
}
return sal_True;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
SwTwips SwTableColumnPage::GetVisibleWidth(sal_uInt16 nPos)
{
sal_uInt16 i=0;
@@ -1366,16 +1254,14 @@ SwTwips SwTableColumnPage::GetVisibleWidth(sal_uInt16 nPos)
i++;
}
SwTwips nReturn = pTblData->GetColumns()[i].nWidth;
- DBG_ASSERT(i < nNoOfCols, "Array index out of range");
+ OSL_ENSURE(i < nNoOfCols, "Array index out of range");
while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols)
nReturn += pTblData->GetColumns()[++i].nWidth;
-// return (*ppTableColumns)[i].nWidth;
return nReturn;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
{
sal_uInt16 i=0;
@@ -1385,15 +1271,14 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
nPos--;
i++;
}
- DBG_ASSERT(i < nNoOfCols, "Array index out of range");
+ OSL_ENSURE(i < nNoOfCols, "Array index out of range");
pTblData->GetColumns()[i].nWidth = nNewWidth;
while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols)
pTblData->GetColumns()[++i].nWidth = 0;
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
+
SwTableTabDlg::SwTableTabDlg(Window* pParent, SfxItemPool& ,
const SfxItemSet* pItemSet, SwWrtShell* pSh ) :
SfxTabDialog(pParent, SW_RES(DLG_FORMAT_TABLE), pItemSet,0),
@@ -1402,7 +1287,7 @@ SwTableTabDlg::SwTableTabDlg(Window* pParent, SfxItemPool& ,
{
FreeResource();
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_FORMAT_TABLE, &SwFormatTablePage::Create, 0 );
AddTabPage(TP_TABLE_TEXTFLOW, &SwTextFlowPage::Create, 0 );
AddTabPage(TP_TABLE_COLUMN, &SwTableColumnPage::Create, 0 );
@@ -1411,8 +1296,6 @@ SwTableTabDlg::SwTableTabDlg(Window* pParent, SfxItemPool& ,
}
-/*------------------------------------------------------------------------
-------------------------------------------------------------------------*/
void SwTableTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
@@ -1439,8 +1322,6 @@ void SwTableTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
}
}
-/*-----------------12.12.96 12.22-------------------
---------------------------------------------------*/
SwTextFlowPage::SwTextFlowPage( Window* pParent,
const SfxItemSet& rSet ) :
SfxTabPage(pParent, SW_RES( TP_TABLE_TEXTFLOW ), rSet ),
@@ -1517,22 +1398,16 @@ SwTextFlowPage::SwTextFlowPage( Window* pParent,
HeadLineCBClickHdl();
}
-/*-----------------12.12.96 12.22-------------------
---------------------------------------------------*/
SwTextFlowPage::~SwTextFlowPage()
{
}
-/*-----------------12.12.96 12.22-------------------
---------------------------------------------------*/
SfxTabPage* SwTextFlowPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwTextFlowPage(pParent, rAttrSet);
}
-/*-----------------12.12.96 12.22-------------------
---------------------------------------------------*/
sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet )
{
sal_Bool bModified = sal_False;
@@ -1649,13 +1524,11 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet )
}
-/*-----------------12.12.96 12.22-------------------
---------------------------------------------------*/
void SwTextFlowPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pItem;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_Bool bFlowAllowed = !bHtmlMode || pHtmlOpt->IsPrintLayoutExtension();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_Bool bFlowAllowed = !bHtmlMode || rHtmlOpt.IsPrintLayoutExtension();
if(bFlowAllowed)
{
// Einfuegen der vorhandenen Seitenvorlagen in die Listbox
@@ -1835,9 +1708,6 @@ void SwTextFlowPage::Reset( const SfxItemSet& rSet )
HeadLineCBClickHdl();
}
-/*-----------------16.04.98 14:48-------------------
-
---------------------------------------------------*/
void SwTextFlowPage::SetShell(SwWrtShell* pSh)
{
@@ -1850,8 +1720,6 @@ void SwTextFlowPage::SetShell(SwWrtShell* pSh)
}
}
-/*-----------------12.12.96 16.18-------------------
---------------------------------------------------*/
IMPL_LINK( SwTextFlowPage, PageBreakHdl_Impl, CheckBox*, EMPTYARG )
{
if( aPgBrkCB.IsChecked() )
@@ -1890,8 +1758,6 @@ IMPL_LINK( SwTextFlowPage, PageBreakHdl_Impl, CheckBox*, EMPTYARG )
return 0;
}
-/*-----------------12.12.96 16.18-------------------
---------------------------------------------------*/
IMPL_LINK( SwTextFlowPage, ApplyCollClickHdl_Impl, CheckBox*, EMPTYARG )
{
sal_Bool bEnable = sal_False;
@@ -1914,8 +1780,6 @@ IMPL_LINK( SwTextFlowPage, ApplyCollClickHdl_Impl, CheckBox*, EMPTYARG )
return 0;
}
-/*-----------------12.12.96 16.18-------------------
---------------------------------------------------*/
IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, RadioButton*, pBtn )
{
if ( aPgBrkCB.IsChecked() )
@@ -1946,8 +1810,6 @@ IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, RadioButton*, pBtn )
return 0;
}
-/*-----------------12.12.96 16.18-------------------
---------------------------------------------------*/
IMPL_LINK( SwTextFlowPage, PageBreakTypeHdl_Impl, RadioButton*, pBtn )
{
if ( pBtn == &aColBrkRB || aPgBrkAfterRB.IsChecked() )
@@ -1962,17 +1824,13 @@ IMPL_LINK( SwTextFlowPage, PageBreakTypeHdl_Impl, RadioButton*, pBtn )
PageBreakPosHdl_Impl( &aPgBrkBeforeRB );
return 0;
}
-/*-----------------17.11.2003 11:30-----------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwTextFlowPage, SplitHdl_Impl, CheckBox*, pBox )
{
aSplitRowCB.Enable(pBox->IsChecked());
return 0;
}
-/*-----------------17.11.2003 11:30-----------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwTextFlowPage, SplitRowHdl_Impl, TriStateBox*, pBox )
{
pBox->EnableTriState(sal_False);
@@ -1986,9 +1844,6 @@ IMPL_LINK( SwTextFlowPage, HeadLineCBClickHdl, void*, EMPTYARG )
return 0;
}
-/*-----------------30.05.97 07:37-------------------
-
---------------------------------------------------*/
void SwTextFlowPage::DisablePageBreak()
{
bPageBreak = sal_False;
@@ -2005,3 +1860,4 @@ void SwTextFlowPage::DisablePageBreak()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src
index 51248119c5f1..1a0fc0ea55ee 100644
--- a/sw/source/ui/table/tabledlg.src
+++ b/sw/source/ui/table/tabledlg.src
@@ -616,7 +616,6 @@ TabPage TP_TABLE_TEXTFLOW
// Disable = TRUE;
Pos = MAP_APPFONT ( 178 , 14 ) ;
Size = MAP_APPFONT ( 70 , 10 ) ;
- // ### ACHTUNG: Neuer Text in Resource? S~palte : ~Spalte
Text [ en-US ] = "Col~umn" ;
};
RadioButton RB_PAGEBREAKBEFORE
diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx
index 7d4272880643..9887e91955f0 100644
--- a/sw/source/ui/table/tablemgr.cxx
+++ b/sw/source/ui/table/tablemgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,6 @@
#include <sot/clsids.hxx>
#include "edtwin.hxx"
-#include "errhdl.hxx"
#include "wrtsh.hxx"
#include "cmdid.h"
#include "frmatr.hxx"
@@ -66,10 +66,10 @@ void SwTableFUNC::ColWidthDlg( Window *pParent )
{
InitTabCols();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwTableWidthDlg( pParent, *this ,DLG_COL_WIDTH );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
}
@@ -113,7 +113,7 @@ SwTwips SwTableFUNC::GetColWidth(sal_uInt16 nNum) const
SwTwips SwTableFUNC::GetMaxColWidth( sal_uInt16 nNum ) const
{
- ASSERT(nNum <= aCols.Count(), "Index out of Area");
+ OSL_ENSURE(nNum <= aCols.Count(), "Index out of Area");
if ( GetColCount() > 0 )
{
@@ -138,13 +138,12 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth )
// aktuelle Breite setzen
// alle folgenden Verschieben
sal_Bool bCurrentOnly = sal_False;
- SwTwips nWidth = 0;
if ( aCols.Count() > 0 )
{
if(aCols.Count() != GetColCount())
bCurrentOnly = sal_True;
- nWidth = GetColWidth(nNum);
+ SwTwips nWidth = GetColWidth(nNum);
int nDiff = (int)(nNewWidth - nWidth);
if( !nNum )
@@ -175,7 +174,7 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth )
void SwTableFUNC::InitTabCols()
{
- ASSERT(pSh, keine Shell);
+ OSL_ENSURE(pSh, "no Shell");
if( pFmt && pSh)
pSh->GetTabCols( aCols );
@@ -314,22 +313,22 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart(
else if (nColLen > 1)
eDataRowSource = chart::ChartDataRowSource_COLUMNS;
else {
- DBG_ERROR( "unexpected state" );
+ OSL_FAIL("unexpected state" );
}
}
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1,
uno::makeAny( rCellRange ), beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1,
uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1,
uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1,
uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE );
xDataReceiver->setArguments( aArgs );
}
@@ -367,7 +366,7 @@ sal_uInt16 SwTableFUNC::GetColCount() const
int SwTableFUNC::GetRightSeparator(int nNum) const
{
- DBG_ASSERT( nNum < (int)GetColCount() ,"Index out of range");
+ OSL_ENSURE( nNum < (int)GetColCount() ,"Index out of range");
int i = 0;
while( nNum >= 0 )
{
@@ -380,3 +379,4 @@ int SwTableFUNC::GetRightSeparator(int nNum) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/tablepg.hxx b/sw/source/ui/table/tablepg.hxx
index 07f408ec8556..5103c031a2e6 100644
--- a/sw/source/ui/table/tablepg.hxx
+++ b/sw/source/ui/table/tablepg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,15 +28,9 @@
#ifndef _SWTABLEPG_HXX
#define _SWTABLEPG_HXX
#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <actctrl.hxx>
#include "prcntfld.hxx"
#include "swtypes.hxx"
@@ -176,9 +171,6 @@ public:
};
-/*-----------------12.12.96 11.48-------------------
- Textfluss
---------------------------------------------------*/
class SwTextFlowPage : public SfxTabPage
{
FixedLine aFlowFL;
@@ -236,3 +228,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index e64c5110a942..e525bc978f21 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,12 +36,8 @@
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <vcl/svapp.hxx>
#include <svl/zforlist.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -51,18 +48,12 @@
#include <svx/framelinkarray.hxx>
#include "swmodule.hxx"
#include "swtypes.hxx"
-#ifndef _VIEW_HXX
#include "view.hxx"
-#endif
#include "wrtsh.hxx"
#include "tblafmt.hxx"
-#ifndef _TAUTOFMT_HXX
#include "tautofmt.hxx"
-#endif
#include "shellres.hxx"
-#ifndef _TAUTOFMT_HRC
#include "tautofmt.hrc"
-#endif
using namespace com::sun::star;
@@ -170,7 +161,7 @@ void SwStringInputDlg::GetInputString( String& rString ) const
}
-__EXPORT SwStringInputDlg::~SwStringInputDlg()
+SwStringInputDlg::~SwStringInputDlg()
{
}
@@ -224,7 +215,7 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell,
//------------------------------------------------------------------------
-__EXPORT SwAutoFormatDlg::~SwAutoFormatDlg()
+SwAutoFormatDlg::~SwAutoFormatDlg()
{
delete pWndPreview;
@@ -337,8 +328,6 @@ IMPL_LINK( SwAutoFormatDlg, CheckHdl, Button *, pBtn )
pData->SetBackground( bCheck );
else if ( pBtn == &aBtnAlignment )
pData->SetJustify( bCheck );
-// else if ( pBtn == &aBtnAdjust )
-// pData->SetIncludeWidthHeight( bCheck );
else
bDataChgd = sal_False;
@@ -608,12 +597,12 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell*
else
mbRTL = pWrtShell->IsTableRightToLeft();
- DBG_ASSERT( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
+ OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
if ( m_xMSF.is() )
{
m_xBreak = uno::Reference< i18n::XBreakIterator >(
m_xMSF->createInstance (
- rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),
uno::UNO_QUERY);
}
pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM );
@@ -623,7 +612,7 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell*
//------------------------------------------------------------------------
-__EXPORT AutoFmtPreview::~AutoFmtPreview()
+AutoFmtPreview::~AutoFmtPreview()
{
delete pNumFmt;
}
@@ -764,9 +753,6 @@ MAKENUMSTR:
Rectangle cellRect = maArray.GetCellRect( nCol, nRow );
Point aPos = cellRect.TopLeft();
sal_uInt16 nRightX = 0;
-// sal_Bool bJustify = aCurData.IsJustify();
-// ScHorJustifyAttr aHorJustifyItem;
-// CellHorJustify eJustification;
Size theMaxStrSize( cellRect.GetWidth() - FRAME_OFFSET,
cellRect.GetHeight() - FRAME_OFFSET );
@@ -795,9 +781,6 @@ MAKENUMSTR:
while( theMaxStrSize.Width() <= aStrSize.Width() &&
cellString.Len() > 1 )
{
-// if( eJustification == SVX_HOR_JUSTIFY_RIGHT )
-// cellString.Erase( 0, 1 );
-// else
cellString.Erase( cellString.Len() - 1 );
aScriptedText.SetText( cellString, m_xBreak );
aStrSize = aScriptedText.GetTextSize();
@@ -806,18 +789,6 @@ MAKENUMSTR:
nRightX = (sal_uInt16)( cellRect.GetWidth()
- aStrSize.Width()
- FRAME_OFFSET );
- //-------------
- // Ausrichtung:
- //-------------
- /* if ( bJustify )
- {
- aCurData.GetHorJustify( nFmtIndex, aHorJustifyItem );
- eJustification = (CellHorJustify)aHorJustifyItem.GetValue();
- }
- else
- {
- eJustification = SC_HOR_JUSTIFY_STANDARD;
- }*/
//-----------------------------
// vertikal (immer zentrieren):
@@ -827,7 +798,6 @@ MAKENUMSTR:
//-----------
// horizontal
//-----------
-/* if ( eJustification != SC_HOR_JUSTIFY_STANDARD )*/
if( mbRTL )
aPos.X() += nRightX;
else if (aCurData.IsJustify())
@@ -922,7 +892,7 @@ void AutoFmtPreview::PaintCells()
//------------------------------------------------------------------------
-void __EXPORT AutoFmtPreview::Init()
+void AutoFmtPreview::Init()
{
SetBorderStyle( GetBorderStyle() | WINDOW_BORDER_MONO );
maArray.Initialize( 5, 5 );
@@ -950,7 +920,7 @@ void AutoFmtPreview::CalcCellArray( sal_Bool _bFitWidth )
//------------------------------------------------------------------------
-inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const SvxBorderLine* pBorder )
+inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder )
{
rStyle.Set( pBorder, 0.05, 5 );
}
@@ -1051,7 +1021,9 @@ void AutoFmtPreview::DoPaint( const Rectangle& /*rRect*/ )
//------------------------------------------------------------------------
-void __EXPORT AutoFmtPreview::Paint( const Rectangle& rRect )
+void AutoFmtPreview::Paint( const Rectangle& rRect )
{
DoPaint( rRect );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/table/tautofmt.src b/sw/source/ui/table/tautofmt.src
index e338dc9a4b73..1b3d66b79905 100644
--- a/sw/source/ui/table/tautofmt.src
+++ b/sw/source/ui/table/tautofmt.src
@@ -214,8 +214,6 @@ ModalDialog DLG_AUTOFMT_TABLE
};
String STR_INVALID_AFNAME
{
- /* ### ACHTUNG: Neuer Text in Resource? Sie haben einen ungültigen Namen angegeben.\nDas AutoFormat konnte nicht angelegt werden.\nWählen Sie einen anderen Namen. : Sie haben einen ungültigen Namen angegeben.\nDas Autoformat konnte nicht angelegt werden.\nWählen Sie einen anderen Namen. */
- /* ### ACHTUNG: Neuer Text in Resource? Sie haben einen ungültigen Namen angegeben.\nDas AutoFormat konnte nicht angelegt werden.\nWählen Sie einen anderen Namen. : Sie haben einen ungültigen Namen angegeben.\nDas Autoformat konnte nicht angelegt werden.\nWählen Sie einen anderen Namen. */
Text [ en-US ] = "You have entered an invalid name.\nThe desired AutoFormat could not be created. \nTry again using a different name." ;
};
};
diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx
index c3927935870b..0fa7a6a00071 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,12 +33,8 @@
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <format.hxx>
#include <charfmt.hxx>
#include <fmtcol.hxx>
@@ -67,14 +64,7 @@
#include <swundo.hxx> // fuer die UndoIds
#include <boost/shared_ptr.hpp>
-//#define FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES 1
-#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
-#include <cellatr.hxx>
-#endif
-
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
namespace
{
@@ -129,9 +119,6 @@ SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool& rPool
FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION,
FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
-#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
- RES_BOXATR_FORMAT, RES_BOXATR_FORMAT,
-#endif
0);
}
else if( nSelectionType & nsSelectionType::SEL_TXT )
@@ -192,11 +179,6 @@ void lcl_getTableAttributes( SfxItemSet& rSet, SwWrtShell &rSh )
rSh.GetRowSplit(pSplit);
if(pSplit)
rSet.Put(*pSplit);
-
- //-- numberformat in cells
-#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
- rSh.GetTblBoxFormulaAttrs( rSet ); //RES_BOXATR_FORMAT
-#endif
}
void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
@@ -285,17 +267,6 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
if( SFX_ITEM_SET == rSet.GetItemState( RES_ROW_SPLIT, sal_False, &pItem) )
rSh.SetRowSplit(*static_cast<const SwFmtRowSplit*>(pItem));
-
- //-- numberformat in cells
-#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem ))
- {
- SfxItemSet aBoxSet( *rSet.GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMAT );
- aBoxSet.Put( SwTblBoxNumFormat( ((SfxUInt32Item*)pItem)->GetValue() ));
- rSh.SetTblBoxFormulaAttrs( aBoxSet );
-
- }
-#endif
}
}//end anonymous namespace
@@ -451,7 +422,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
}
typedef boost::shared_ptr< SfxPoolItem > SfxPoolItemSharedPtr;
typedef std::vector< SfxPoolItemSharedPtr > ItemVector;
-// #144857# collect all PoolItems from the applied styles
+// collect all PoolItems from the applied styles
void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSet )
{
const sal_uInt16* pRanges = rStyleAttrSet.GetRanges();
@@ -468,7 +439,7 @@ void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSe
pRanges += 2;
}
}
-// #144857# remove all items that are inherited from the styles
+// remove all items that are inherited from the styles
void lcl_RemoveEqualItems( SfxItemSet& rTemplateItemSet, ItemVector& rItemVector )
{
ItemVector::iterator aEnd = rItemVector.end();
@@ -510,9 +481,9 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
if( pStyle )
{
SwFmtCharFmt aFmt(pStyle->GetCharFmt());
- // #144857# collect items from character style
+ // collect items from character style
lcl_AppendSetItems( aItemVector, aFmt.GetCharFmt()->GetAttrSet());
- sal_uInt16 nFlags=0; //(nMode & KEY_SHIFT) ? SETATTR_DONTREPLACE : SETATTR_DEFAULT;
+ sal_uInt16 nFlags=0;
rWrtShell.SetAttr( aFmt, nFlags );
}
}
@@ -521,7 +492,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
SwDocStyleSheet* pStyle = (SwDocStyleSheet*)pPool->Find(m_aParaStyle, SFX_STYLE_FAMILY_PARA);
if( pStyle )
{
- // #144857# collect items from paragraph style
+ // collect items from paragraph style
lcl_AppendSetItems( aItemVector, pStyle->GetCollection()->GetAttrSet());
rWrtShell.SetTxtFmtColl( pStyle->GetCollection() );
}
@@ -547,7 +518,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
if(pTemplateItemSet)
{
pTemplateItemSet->Put( *m_pItemSet );
- // #144857# only _set_ attributes that differ from style attributes should be applied - the style is applied anyway
+ // only _set_ attributes that differ from style attributes should be applied - the style is applied anyway
lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
@@ -615,3 +586,5 @@ void SwFormatClipboard::Erase()
m_bPersistentCopy = false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 7abdbbb85d7b..790cfb62c123 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,16 +82,14 @@
#define SwPagePreView
#include <sfx2/msg.hxx>
#include <swslots.hxx>
-// OD 12.12.2002 #103492#
#include <pagepreviewlayout.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
using namespace ::com::sun::star;
-
SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreView, "PrintPreview")
{
SFX_VIEW_REGISTRATION(SwDocShell);
@@ -107,17 +106,13 @@ SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX))
SW_RES(RID_PVIEW_TOOLBOX));
}
-
TYPEINIT1(SwPagePreView,SfxViewShell)
#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS )
#define MIN_PREVIEW_ZOOM 25
#define MAX_PREVIEW_ZOOM 600
-/* */
-/* -----------------26.11.2002 10:41-----------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn)
{
static sal_uInt16 aZoomArr[] =
@@ -139,24 +134,18 @@ sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn)
}
return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM;
};
-/* -----------------02.12.2002 09:11-----------------
- *
- * --------------------------------------------------*/
+
void lcl_InvalidateZoomSlots(SfxBindings& rBindings)
{
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 const aInval[] =
{
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, FN_PREVIEW_ZOOM, FN_STAT_ZOOM,
0
};
rBindings.Invalidate( aInval );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
// erstmal der Zoom-Dialog
-
class SwPreViewZoomDlg : public SvxStandardDialog
{
FixedText aRowLbl;
@@ -175,11 +164,6 @@ public:
~SwPreViewZoomDlg();
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) :
SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_ZOOM) ),
aRowLbl(this,SW_RES(FT_ROW)),
@@ -196,13 +180,7 @@ SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) :
aColEdit.SetValue( rParent.GetCol() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwPreViewZoomDlg::~SwPreViewZoomDlg() {}
-
-
void SwPreViewZoomDlg::Apply()
{
((SwPagePreViewWin*)GetParent())->CalcWish(
@@ -210,13 +188,7 @@ void SwPreViewZoomDlg::Apply()
sal_uInt8(aColEdit.GetValue()) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
// alles fuers SwPagePreViewWin
-
-
SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
: Window( pParent, WinBits( WB_CLIPCHILDREN) ),
mpViewShell( 0 ),
@@ -224,7 +196,7 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
mbCalcScaleForPreviewLayout( true ),
maPaintedPreviewDocRect( Rectangle(0,0,0,0) )
{
- SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW ); //#106611#
+ SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW );
SetHelpId(HID_PAGEPREVIEW);
SetFillColor( GetBackground().GetColor() );
SetLineColor( GetBackground().GetColor());
@@ -233,26 +205,15 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(sal_False);
mnRow = pUsrPref->GetPagePrevRow(); // 1 Zeile
mnCol = pUsrPref->GetPagePrevCol(); // 1 Spalte
- // OD 24.03.2003 #108282# - member <mnVirtPage> no longer exists.
mnSttPage = USHRT_MAX;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPagePreViewWin::~SwPagePreViewWin()
{
if( mpViewShell )
delete mpViewShell;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::Paint( const Rectangle& rRect )
{
if( !mpViewShell || !mpViewShell->GetLayout() )
@@ -281,16 +242,12 @@ void SwPagePreViewWin::Paint( const Rectangle& rRect )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
{
if( !mpViewShell || !mpViewShell->GetLayout() )
return;
sal_uInt16 nOldCol = mnCol;
- // OD 02.12.2002 #103492# - update <mnRow> and <mnCol>.
mnRow = nNewRow;
mnCol = nNewCol;
sal_uInt16 nPages = mnRow * mnCol,
@@ -312,8 +269,8 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
mrView.ScrollDocSzChg();
// Sortierung muss eingehalten werden!!
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN,
FN_PREVIEW_ZOOM,
@@ -326,23 +283,20 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
rBindings.Invalidate( aInval );
rBindings.Update( FN_SHOW_TWO_PAGES );
rBindings.Update( FN_SHOW_MULTIPLE_PAGES );
- // OD 18.12.2002 #103492# - adjust scrollbars
+ // adjust scrollbars
mrView.ScrollViewSzChg();
}
+
/*--------------------------------------------------------------------
Beschreibung:, mnSttPage is Absolute
--------------------------------------------------------------------*/
-
-
int SwPagePreViewWin::MovePage( int eMoveMode )
{
// soviele Seiten hoch
sal_uInt16 nPages = mnRow * mnCol;
sal_uInt16 nNewSttPage = mnSttPage;
- // OD 04.12.2002 #103492#
sal_uInt16 nPageCount = mrView.GetPageCount();
sal_uInt16 nDefSttPg = GetDefSttPage();
- // OD 06.12.2002 #103492#
bool bPaintPageAtFirstCol = true;
switch( eMoveMode )
@@ -380,37 +334,36 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) );
break;
case MV_DOC_END:
- // OD 03.12.2002 #103492# - correct calculation of new start page.
+ // correct calculation of new start page.
nNewSttPage = nPageCount;
SetSelectedPage( nPageCount );
break;
- // OD 12.12.2002 #103492# - add new move mode
case MV_SELPAGE:
// <nNewSttPage> and <SelectedPage()> are already set.
- // OD 20.02.2003 #107369# - not start at first column, only if the
+ // not start at first column, only if the
// complete preview layout columns doesn't fit into window.
if ( !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
bPaintPageAtFirstCol = false;
break;
case MV_SCROLL:
- // OD 17.01.2003 #103492# - check, if paint page at first column
+ // check, if paint page at first column
// has to be avoided
if ( !mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() ||
!mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
bPaintPageAtFirstCol = false;
break;
case MV_NEWWINSIZE:
- // OD 18.12.2002 #103492# - nothing special to do.
+ // nothing special to do.
break;
case MV_CALC:
- // OD 18.12.2002 #103492# - re-init page preview layout.
+ // re-init page preview layout.
mpPgPrevwLayout->ReInit();
- // OD 03.12.2002 #103492# - correct calculation of new start page.
+ // correct calculation of new start page.
if( nNewSttPage > nPageCount )
nNewSttPage = nPageCount;
- // OD 18.12.2002 #103492# - correct selected page number
+ // correct selected page number
if( SelectedPage() > nPageCount )
SetSelectedPage( nNewSttPage ? nNewSttPage : 1 );
}
@@ -425,8 +378,8 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
SetPagePreview(mnRow, mnCol);
mnSttPage = nNewSttPage;
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
@@ -438,11 +391,6 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::SetWinSize( const Size& rNewSize )
{
// die Size wollen wir aber immer in Pixel-Einheiten haben
@@ -470,15 +418,9 @@ void SwPagePreViewWin::SetWinSize( const Size& rNewSize )
maScale = GetMapMode().GetScaleX();
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const
{
- // OD 24.03.2003 #108282# - show physical and virtual page number of
+ // show physical and virtual page number of
// selected page, if it's visible.
sal_uInt16 nPageNum;
if ( mpPgPrevwLayout->IsPageVisible( mpPgPrevwLayout->SelectedPage() ) )
@@ -500,11 +442,6 @@ void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const
rStr += String::CreateFromInt32( nPageCnt );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt )
{
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
@@ -530,10 +467,6 @@ void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt )
Window::KeyInput( rKEvt );
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
{
sal_Bool bCallBase = sal_True;
@@ -561,7 +494,6 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
}
break;
default:
- // OD 17.12.2002 #103492# - delete assertion
;
}
@@ -571,7 +503,7 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
{
- // OD 17.12.2002 #103492# - consider single-click to set selected page
+ // consider single-click to set selected page
if( MOUSE_LEFT == ( rMEvt.GetModifier() + rMEvt.GetButtons() ) )
{
Point aPrevwPos( PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -596,18 +528,17 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
SFX_CALLMODE_ASYNCHRON );
}
else if ( bIsDocPos || bPosInEmptyPage )
- // OD 2004-03-04 #i20684# - add missing parenthesis
{
// show clicked page as the selected one
mpPgPrevwLayout->MarkNewSelectedPage( nNewSelectedPage );
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
- // OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
+ // adjust position at vertical scrollbar.
if ( mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() )
{
mrView.SetVScrollbarThumbPos( nNewSelectedPage );
}
- // OD 24.03.2003 #108282# - invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_STAT_PAGE, 0
};
@@ -620,8 +551,6 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
/******************************************************************************
* Beschreibung: Userprefs bzw Viewoptions setzen
******************************************************************************/
-
-
void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol )
{
SwMasterUsrPref *pOpt = (SwMasterUsrPref *)SW_MOD()->GetUsrPref(sal_False);
@@ -639,8 +568,6 @@ void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol )
/** get selected page in document preview
- OD 13.12.2002 #103492#
-
@author OD
*/
sal_uInt16 SwPagePreViewWin::SelectedPage() const
@@ -650,8 +577,6 @@ sal_uInt16 SwPagePreViewWin::SelectedPage() const
/** set selected page number in document preview
- OD 13.12.2002 #103492#
-
@author OD
*/
void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
@@ -661,8 +586,6 @@ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
/** method to enable/disable book preview
- OD 2004-03-05 #i18143#
-
@author OD
*/
bool SwPagePreViewWin::SetBookPreviewMode( const bool _bBookPreview )
@@ -685,7 +608,7 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt )
// den Settings abgefragt werden.
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
mrView.InvalidateBorder(); //Scrollbarbreiten
- //#106746# zoom has to be disabled if Accessibility support is switched on
+ // zoom has to be disabled if Accessibility support is switched on
lcl_InvalidateZoomSlots(mrView.GetViewFrame()->GetBindings());
break;
@@ -702,8 +625,6 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt )
/** help method to execute SfxRequest FN_PAGEUP and FN_PAGEDOWN
- OD 04.03.2003 #107369#
-
@author OD
*/
void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
@@ -762,8 +683,8 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
aViewWin.SetSelectedPage( nNewSelectedPageNum );
}
ScrollViewSzChg();
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
@@ -778,9 +699,6 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
_pReq->Done();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
// dann mal alles fuer die SwPagePreView
void SwPagePreView::Execute( SfxRequest &rReq )
{
@@ -829,7 +747,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
// book preview mode changed. Thus, adjust scrollbars and
// invalidate corresponding states.
ScrollViewSzChg();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, FN_SHOW_BOOKVIEW, 0
@@ -870,7 +788,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
if(pFact)
{
pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
pDlg->SetLimits( MINZOOM, MAXZOOM );
@@ -941,7 +859,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) )
{
pPagePrevwLay->MarkNewSelectedPage( nNewSelectedPage );
- // OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
+ // adjust position at vertical scrollbar.
SetVScrollbarThumbPos( nNewSelectedPage );
bRefresh = false;
}
@@ -953,8 +871,8 @@ void SwPagePreView::Execute( SfxRequest &rReq )
bRefresh = 0 != nRet;
}
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
- // OD 24.03.2003 #108282# - invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_STAT_PAGE, 0
};
@@ -1040,7 +958,7 @@ MOVEPAGE:
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
@@ -1048,20 +966,14 @@ MOVEPAGE:
aViewWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::GetState( SfxItemSet& rSet )
{
SfxWhichIter aIter(rSet);
sal_uInt8 nRow = 1;
sal_uInt16 nWhich = aIter.FirstWhich();
- ASSERT(nWhich, leeres Set);
+ OSL_ENSURE(nWhich, "empty set");
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
- //#106746# zoom has to be disabled if Accessibility support is switched on
- // MT 2010/01, see #110498#
+ // zoom has to be disabled if Accessibility support is switched on
sal_Bool bZoomEnabled = sal_True; // !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport();
while(nWhich)
@@ -1207,11 +1119,6 @@ void SwPagePreView::GetState( SfxItemSet& rSet )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::StateUndo(SfxItemSet& rSet)
{
SfxWhichIter aIter(rSet);
@@ -1224,11 +1131,6 @@ void SwPagePreView::StateUndo(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::Init(const SwViewOption * pPrefs)
{
if ( GetViewShell()->HasDrawView() )
@@ -1275,7 +1177,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
GetViewShell()->ApplyViewOptions( aOpt );
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
- // OD 09.01.2003 #i6467# - adjust view shell option to the same as for print
+ // adjust view shell option to the same as for print
SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false);
GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
@@ -1290,12 +1192,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
pScrollFill->Show(pPrefs->IsViewVScrollBar() && pPrefs->IsViewHScrollBar());
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SfxViewShell( pViewFrame, SWVIEWFLAGS ),
aViewWin( &pViewFrame->GetWindow(), *this ),
@@ -1307,7 +1203,6 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(),
pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )),
mnPageCount( 0 ),
- // OD 09.01.2003 #106334#
mbResetFormDesignMode( false ),
mbFormDesignModeToReset( false )
{
@@ -1346,14 +1241,14 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
{
// setze die akt. Seite als die erste
sal_uInt16 nPhysPg, nVirtPg;
- ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, /*sal_False*/sal_True, sal_False );
+ ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, sal_True, sal_False );
if( 1 != aViewWin.GetCol() && 1 == nPhysPg )
--nPhysPg;
aViewWin.SetSttPage( nPhysPg );
}
}
- // OD 09.01.2003 #106334# - for form shell remember design mode of draw view
+ // for form shell remember design mode of draw view
// of previous view shell
if ( pVS && pVS->HasDrawView() )
{
@@ -1373,13 +1268,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
Init();
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
- SwPagePreView::~SwPagePreView()
+SwPagePreView::~SwPagePreView()
{
SetWindow( 0 );
@@ -1389,39 +1278,19 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
delete pPageUpBtn;
delete pPageDownBtn;
-/* SfxObjectShell* pDocSh = GetDocShell();
- for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh );
- pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) )
- if( pFrame != GetViewFrame() )
- {
- // es gibt noch eine weitere Sicht auf unser Dokument, also
- // aktiviere dieses
- pFrame->GetFrame().Appear();
- break;
- }
-*/}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
+}
SwDocShell* SwPagePreView::GetDocShell()
{
return PTR_CAST(SwDocShell, GetViewFrame()->GetObjectShell());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
int SwPagePreView::_CreateScrollbar( sal_Bool bHori )
{
Window *pMDI = &GetViewFrame()->GetWindow();
SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
- ASSERT( !*ppScrollbar, "vorher abpruefen!" )
+ OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" );
if( !bHori )
{
@@ -1451,33 +1320,18 @@ int SwPagePreView::_CreateScrollbar( sal_Bool bHori )
return 1;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
/*
* Button-Handler
*/
IMPL_LINK_INLINE_START( SwPagePreView, BtnPage, Button *, pButton )
{
- // OD 04.03.2003 #107369# - use new helper method to perform page up
+ // use new helper method to perform page up
// respectively page down.
_ExecPgUpAndPgDown( pButton == pPageUpBtn );
return 0;
}
IMPL_LINK_INLINE_END( SwPagePreView, BtnPage, Button *, pButton )
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
{
Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) );
@@ -1497,7 +1351,7 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
{
ScrollViewSzChg();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT,
FN_PAGEUP, FN_PAGEDOWN, 0
@@ -1509,21 +1363,11 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
return bChg;
}
-
-/* */
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
// ab hier alles aus der SwView uebernommen
-
-
void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
{
-// const long nAdd = bInner ? 0 : ScrollBar::GetWindowOverlapPixel();
const StyleSettings &rSet = aViewWin.GetSettings().GetStyleSettings();
- const long nTmp = rSet.GetScrollBarSize();// - nAdd;
+ const long nTmp = rSet.GetScrollBarSize();
if ( pVScrollbar->IsVisible( sal_False ))
rToFill.Right() = nTmp;
if ( pHScrollbar->IsVisible( sal_False ) )
@@ -1531,11 +1375,6 @@ void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*
SetBorderPixel( rToFill );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
{
SvBorder aBorder;
@@ -1552,11 +1391,6 @@ void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
//VisArea niemals einstellen!
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
SvBorder aBorder;
@@ -1580,11 +1414,6 @@ void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar )
{
const Point aTopLeft(AlignToPixel(rRect.TopLeft()));
@@ -1609,7 +1438,7 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba
if(aLR.Right() < 0) aLR.Right() = 0;
if(aLR.Bottom() < 0) aLR.Bottom() = 0;
if(aLR == aVisArea ||
- // JP 29.10.97: Bug 45173 - Leeres Rechteck nicht beachten
+ // Leeres Rechteck nicht beachten
( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) )
return;
@@ -1628,17 +1457,11 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba
// setze am View-Win die aktuelle Size
aVisArea = aLR;
aViewWin.SetWinSize( aLR.GetSize() );
- // OD 18.12.2002 #103492# - use new mode
ChgPage( SwPagePreViewWin::MV_NEWWINSIZE, bUpdateScrollbar );
aViewWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
{
if(!GetViewShell())
@@ -1657,7 +1480,6 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
Point aPos = pScrollbar->GetParent()->OutputToScreenPixel(
pScrollbar->GetPosPixel());
aPos.Y() = pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y();
- Size aSize = pScrollbar->GetSizePixel();
Rectangle aRect;
aRect.Left() = aPos.X() -8;
aRect.Right() = aRect.Left();
@@ -1673,17 +1495,12 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
{
if(!GetViewShell())
return 0;
- // OD 04.03.2003 #107369# - boolean to avoid unnecessary invalidation of the window.
+ // boolean to avoid unnecessary invalidation of the window.
bool bInvalidateWin = true;
if( !pScrollbar->IsHoriScroll() ) // scroll vertically
@@ -1694,33 +1511,33 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
{
// wieviele Seiten scrollen ??
sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos();
- // OD 05.12.2002 #103492# - adjust to new preview functionality
+ // adjust to new preview functionality
if( nThmbPos != aViewWin.SelectedPage() )
{
- // OD 17.01.2003 #103492# - consider case that page <nThmbPos>
+ // consider case that page <nThmbPos>
// is already visible
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
if ( pPagePrevwLay->IsPageVisible( nThmbPos ) )
{
pPagePrevwLay->MarkNewSelectedPage( nThmbPos );
- // OD 04.03.2003 #107369# - invalidation of window is unnecessary
+ // invalidation of window is unnecessary
bInvalidateWin = false;
}
else
{
- // OD 17.01.2003 #103492# - consider whether layout columns
+ // consider whether layout columns
// fit or not.
if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() )
{
aViewWin.SetSttPage( nThmbPos );
aViewWin.SetSelectedPage( nThmbPos );
ChgPage( SwPagePreViewWin::MV_SCROLL, sal_False );
- // OD 20.01.2003 #103492# - update scrollbars
+ // update scrollbars
ScrollViewSzChg();
}
else
{
- // OD 04.03.2003 #107369# - correct scroll amount
+ // correct scroll amount
const sal_Int16 nPageDiff = nThmbPos - aViewWin.SelectedPage();
const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
@@ -1733,12 +1550,12 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
}
}
- // OD 17.01.2003 #103492# - update accessibility
+ // update accessibility
GetViewShell()->ShowPreViewSelection( nThmbPos );
}
else
{
- // OD 04.03.2003 #107369# - invalidation of window is unnecessary
+ // invalidation of window is unnecessary
bInvalidateWin = false;
}
}
@@ -1753,36 +1570,27 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
long nThmbPos = pScrollbar->GetThumbPos();
aViewWin.Scroll(nThmbPos - aViewWin.GetPaintedPreviewDocRect().Left(), 0);
}
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
};
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( aInval );
- // OD 04.03.2003 #107369# - control invalidation of window
+ // control invalidation of window
if ( bInvalidateWin )
{
aViewWin.Invalidate();
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
Point SwPagePreView::AlignToPixel(const Point &rPt) const
{
return aViewWin.PixelToLogic( aViewWin.LogicToPixel( rPt ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::DocSzChgd( const Size &rSz )
{
if( aDocSz == rSz )
@@ -1790,7 +1598,7 @@ void SwPagePreView::DocSzChgd( const Size &rSz )
aDocSz = rSz;
- // --> OD 2009-08-20 #i96726#
+ // #i96726#
// Due to the multiple page layout it is needed to trigger recalculation
// of the page preview layout, even if the count of pages is not changing.
mnPageCount = GetViewShell()->GetNumPages();
@@ -1802,14 +1610,8 @@ void SwPagePreView::DocSzChgd( const Size &rSz )
aViewWin.Invalidate();
}
- // <--
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::ScrollViewSzChg()
{
if(!GetViewShell())
@@ -1819,10 +1621,10 @@ void SwPagePreView::ScrollViewSzChg()
if(GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
{
//vertical scrolling by row
- // OD 04.12.2002 #103492# - adjust to new preview functionality
+ // adjust to new preview functionality
sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
pVScrollbar->SetVisibleSize( nVisPages );
- // OD 19.02.2003 #107369# - set selected page as scroll bar position,
+ // set selected page as scroll bar position,
// if it is visible.
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) )
@@ -1839,7 +1641,7 @@ void SwPagePreView::ScrollViewSzChg()
Range aScrollbarRange( 1, mnPageCount );
// increase range by one, because left-top-corner is left blank.
++aScrollbarRange.Max();
- // OD 17.01.2003 #103492# - increase range in order to access all pages
+ // increase range in order to access all pages
aScrollbarRange.Max() += ( nVisPages - 1 );
pVScrollbar->SetRange( aScrollbarRange );
}
@@ -1879,35 +1681,17 @@ void SwPagePreView::ScrollViewSzChg()
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::ScrollDocSzChg()
{
ScrollViewSzChg();
}
-
-/* */
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
// alles zum Thema Drucken
-
SfxPrinter* SwPagePreView::GetPrinter( sal_Bool bCreate )
{
return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, bool )
{
ViewShell &rSh = *GetViewShell();
@@ -1942,16 +1726,16 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
rESh.SetModified();
rESh.EndAllAction();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
};
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
const sal_uInt16* pPtr = aInval + 1;
do {
- ASSERT( *(pPtr - 1) < *pPtr, "falsche Sortierung!" );
+ OSL_ENSURE( *(pPtr - 1) < *pPtr, "wrong sorting!" );
} while( *++pPtr );
}
#endif
@@ -1962,58 +1746,18 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions )
{
return ::CreatePrintOptionsPage( pParent, rOptions, !bNormalPrint );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-// OD 18.12.2002 #103492# - no longer needed ??
Size SwPagePreView::GetOptimalSizePixel() const
{
- ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
+ OSL_FAIL( "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" );
return Size( -1, -1 );
-/*
- //JP 09.06.99: was wird hier errechnet ?????
-// ALT:
-// SfxApplicationWindow* pWin = SFX_APPWINDOW ;
-// Rectangle aRect = pWin->GetClientAreaPixel();
-
- Window& rWin = GetViewFrame()->GetWindow();
- Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() );
- Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() );
- Size aInSize = rWin.GetOutputSizePixel();
- Size aOutSize = rWin.GetSizePixel();
- sal_uInt16 nXBorder = sal_uInt16(aOutSize.Width() - aInSize.Width());
- sal_uInt16 nYBorder = sal_uInt16(aOutSize.Height() - aInSize.Height());
- aMaxSize.Width() -= nXBorder;
- //'auf Verdacht' etwas vom Border abziehen (Menue)
- nYBorder -= (nYBorder - nXBorder) / 2;
- aMaxSize.Height() -= nYBorder;
- //mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen
- aViewWin.GetOptimalSize(aMaxSize);
- // Border wieder dazuzaehlen
- aMaxSize.Height() += nYBorder;
- aMaxSize.Width() += nXBorder;
- return aMaxSize;
-*/
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-// OD 12.12.2002 #103492#
void SwPagePreViewWin::SetViewShell( ViewShell* pShell )
{
mpViewShell = pShell;
@@ -2025,7 +1769,7 @@ void SwPagePreViewWin::SetViewShell( ViewShell* pShell )
void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect )
{
- // OD 2004-03-04 #i24183#
+ // #i24183#
if ( mpPgPrevwLayout->PreviewLayoutValid() )
{
mpPgPrevwLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) );
@@ -2034,13 +1778,12 @@ void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect )
/** method to adjust preview to a new zoom factor
- OD 02.12.2002 #103492#
- OD 24.09.2003 #i19975# - also consider zoom type - adding parameter <_eZoomType>
+ #i19975# also consider zoom type - adding parameter <_eZoomType>
*/
void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
const SvxZoomType _eZoomType )
{
- // OD 24.09.2003 #i19975# - consider zoom type
+ // #i19975# consider zoom type
if ( _eZoomType == SVX_ZOOM_WHOLEPAGE )
{
mnRow = 1;
@@ -2075,11 +1818,12 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
}
}
-/* -----------------04.12.2002 10:46-----------------
+
+/**
* pixel scrolling - horizontally always or vertically
* when less than the desired number of rows fits into
* the view
- * --------------------------------------------------*/
+ */
void SwPagePreViewWin::Scroll(long nXMove, long nYMove, sal_uInt16 /*nFlags*/)
{
maPaintedPreviewDocRect.Move(nXMove, nYMove);
@@ -2120,50 +1864,37 @@ sal_Bool SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt )
return bOk;
}
-
uno::Reference< ::com::sun::star::accessibility::XAccessible >
SwPagePreViewWin::CreateAccessible()
{
- vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
- // happend already!!!
+ SolarMutexGuard aGuard; // this should have happend already!!!
- DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
+ OSL_ENSURE( GetViewShell() != NULL, "We need a view shell" );
return GetViewShell()->CreateAccessiblePreview();
}
-/* -----------------------------06.05.2002 13:18------------------------------
-
- ---------------------------------------------------------------------------*/
void SwPagePreView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
{
GetViewShell()->ApplyAccessiblityOptions(rAccessibilityOptions);
}
-/* -----------------------------2002/06/26 14:30------------------------------
- ---------------------------------------------------------------------------*/
void SwPagePreView::ShowHScrollbar(sal_Bool bShow)
{
pHScrollbar->Show(bShow);
InvalidateBorder();
}
-/* -----------------------------2002/06/26 14:30------------------------------
-
- ---------------------------------------------------------------------------*/
void SwPagePreView::ShowVScrollbar(sal_Bool bShow)
{
pVScrollbar->Show(bShow);
InvalidateBorder();
}
-/* -----------------25.11.2002 16:36-----------------
- *
- * --------------------------------------------------*/
void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
{
ViewShell& rSh = *GetViewShell();
SwViewOption aOpt(*rSh.GetViewOptions());
- // OD 16.12.2002 #103492# - perform action only on changes of zoom or zoom type.
+ // perform action only on changes of zoom or zoom type.
if ( aOpt.GetZoom() != nFactor ||
aOpt.GetZoomType() != eType )
{
@@ -2171,8 +1902,7 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
aOpt.SetZoomType(eType);
rSh.ApplyViewOptions( aOpt );
lcl_InvalidateZoomSlots(GetViewFrame()->GetBindings());
- // OD 02.12.2002 #103492#
- // OD 24.09.2003 #i19975# - also consider zoom type
+ // #i19975# also consider zoom type
aViewWin.AdjustPreviewToNewZoom( nFactor, eType );
ScrollViewSzChg();
}
@@ -2180,8 +1910,6 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
/** adjust position of vertical scrollbar
- OD 19.02.2003 #107369
-
@author OD
*/
void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
@@ -2191,3 +1919,5 @@ void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
pVScrollbar->SetThumbPos( _nNewThumbPos );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src
index f2fd88d6d754..8f60e4d3a5be 100644
--- a/sw/source/ui/uiview/pview.src
+++ b/sw/source/ui/uiview/pview.src
@@ -29,7 +29,6 @@
#include "pview.hrc"
#include "helpid.h"
#include "cmdid.h"
-
ModalDialog DLG_PAGEPREVIEW_ZOOM
{
HelpID = HID_PPREV_ZOOM ;
diff --git a/sw/source/ui/uiview/scroll.cxx b/sw/source/ui/uiview/scroll.cxx
index 22109be8a039..23cdaad2979a 100644
--- a/sw/source/ui/uiview/scroll.cxx
+++ b/sw/source/ui/uiview/scroll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "swtypes.hxx"
#include "swrect.hxx"
#include "scroll.hxx"
@@ -65,7 +64,6 @@ void SwScrollbar::DocSzChgd( const Size &rSize )
SetRange( Range( 0, bHori ? rSize.Width() : rSize.Height()) );
const sal_uLong nVisSize = GetVisibleSize();
SetLineSize( SCROLL_LINE_SIZE );
-// SetLineSize( nVisSize * 10 / 100 );
SetPageSize( nVisSize * 77 / 100 );
}
@@ -97,9 +95,6 @@ void SwScrollbar::ViewPortChgd( const Rectangle &rRect )
AutoShow();
}
-/*-----------------10/21/97 02:48pm-----------------
-
---------------------------------------------------*/
void SwScrollbar::ExtendedShow( sal_Bool bSet )
{
bVisible = bSet;
@@ -107,9 +102,6 @@ void SwScrollbar::ExtendedShow( sal_Bool bSet )
ScrollBar::Show(bSet);
}
-/*-----------------10/21/97 03:23pm-----------------
-
---------------------------------------------------*/
void SwScrollbar::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{
ScrollBar::SetPosSizePixel(rNewPos, rNewSize);
@@ -119,10 +111,6 @@ void SwScrollbar::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
}
-
-/*-----------------14.04.98 11:38-------------------
-
---------------------------------------------------*/
void SwScrollbar::SetAuto(sal_Bool bSet)
{
if(bAuto != bSet)
@@ -136,14 +124,11 @@ void SwScrollbar::SetAuto(sal_Bool bSet)
AutoShow(); // oder automatisch verstecken
}
}
-/*-----------------14.04.98 11:43-------------------
---------------------------------------------------*/
void SwScrollbar::AutoShow()
{
long nVis = GetVisibleSize();
long nLen = GetRange().Len();
- {
if( nVis >= nLen - 1)
{
if(ScrollBar::IsVisible())
@@ -156,5 +141,6 @@ void SwScrollbar::AutoShow()
{
ScrollBar::Show(sal_True);
}
- }
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index f2628d48dde8..542c436e7202 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,11 +138,6 @@ SFX_IMPL_INTERFACE( SwSrcView, SfxViewShell, SW_RES(0) )
TYPEINIT1(SwSrcView, SfxViewShell)
-/*-----------------18.11.96 08.05-------------------
-
---------------------------------------------------*/
-
-
void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurPage, const String& rTitle )
{
short nLeftMargin = LMARGPRN;
@@ -195,24 +191,19 @@ void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurP
rOutDev.SetFont( aOldFont );
rOutDev.SetFillColor( aOldFillColor );
}
-/* -----------------13.11.2003 16:24-----------------
- --------------------------------------------------*/
rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding)
{
rtl_TextEncoding eRet = eLoadEncoding;
if(RTL_TEXTENCODING_DONTKNOW == eRet)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
eRet = rtl_getTextEncodingFromMimeCharset( pCharSet );
}
return eRet;
}
-/*-----------------18.11.96 08.21-------------------
-
---------------------------------------------------*/
void lcl_ConvertTabsToSpaces( String& rLine )
{
@@ -236,11 +227,6 @@ void lcl_ConvertTabsToSpaces( String& rLine )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
SfxViewShell( pViewFrame, SWSRCVIEWFLAGS ),
aEditWin( &pViewFrame->GetWindow(), this ),
@@ -251,15 +237,10 @@ SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
Init();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwSrcView::~SwSrcView()
{
SwDocShell* pDocShell = GetDocShell();
- DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+ OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
const TextSelection& rSel = aEditWin.GetTextView()->GetSelection();
((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< sal_uInt16 >( rSel.GetStart().GetPara() ) );
@@ -270,27 +251,18 @@ SwSrcView::~SwSrcView()
::rtl::OUString url = xDocProps->getAutoloadURL();
sal_Int32 delay = xDocProps->getAutoloadSecs();
pDocShell->SetAutoLoad(INetURLObject(url), delay,
- (delay != 0) || !url.equalsAscii(""));
-// EndListening(*GetViewFrame());
+ (delay != 0) || url.getLength());
EndListening(*pDocShell);
delete pSearchItem;
}
-/*-----------------24.04.97 10:37-------------------
-
---------------------------------------------------*/
void SwSrcView::SaveContentTo(SfxMedium& rMed)
{
SvStream* pOutStream = rMed.GetOutStream();
pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding));
- aEditWin.Write( *pOutStream );//, EE_FORMAT_TEXT);
+ aEditWin.Write( *pOutStream );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::Init()
{
SetHelpId(SW_SRC_VIEWSHELL);
@@ -310,35 +282,21 @@ void SwSrcView::Init()
StartListening(*pDocShell,sal_True);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwDocShell* SwSrcView::GetDocShell()
{
SfxObjectShell* pObjShell = GetViewFrame()->GetObjectShell();
return PTR_CAST(SwDocShell, pObjShell);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::SaveContent(const String& rTmpFile)
{
SfxMedium aMedium( rTmpFile, STREAM_WRITE, sal_True);
SvStream* pOutStream = aMedium.GetOutStream();
pOutStream->SetStreamCharSet( lcl_GetStreamCharSet(eLoadEncoding) );
- aEditWin.Write(*pOutStream);//, EE_FORMAT_TEXT);
+ aEditWin.Write(*pOutStream);
aMedium.Commit();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::Execute(SfxRequest& rReq)
{
sal_uInt16 nSlot = rReq.GetSlot();
@@ -353,7 +311,6 @@ void SwSrcView::Execute(SfxRequest& rReq)
TemplateDescription::FILESAVE_AUTOEXTENSION,
TemplateDescription::FILESAVE_SIMPLE );
uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
-// pFileDlg->SetHelpId(HID_FILEDLG_SRCVIEW);
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
// search for an html filter for export
@@ -421,7 +378,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
const SfxItemSet* pTmpArgs = rReq.GetArgs();
sal_uInt16 nWhich = pTmpArgs->GetWhichByPos( 0 );
- DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" );
+ OSL_ENSURE( nWhich, "Wich fuer SearchItem ?" );
const SfxPoolItem& rItem = pTmpArgs->Get( nWhich );
SetSearchItem( (const SvxSearchItem&)rItem);
StartSearchAndReplace( (const SvxSearchItem&)rItem, sal_False, rReq.IsAPI() );
@@ -474,11 +431,6 @@ void SwSrcView::Execute(SfxRequest& rReq)
aEditWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::GetState(SfxItemSet& rSet)
{
SfxWhichIter aIter(rSet);
@@ -608,11 +560,6 @@ void SwSrcView::GetState(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SvxSearchItem* SwSrcView::GetSearchItem()
{
if(!pSearchItem)
@@ -622,22 +569,12 @@ SvxSearchItem* SwSrcView::GetSearchItem()
return pSearchItem;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::SetSearchItem( const SvxSearchItem& rItem )
{
delete pSearchItem;
pSearchItem = (SvxSearchItem*)rItem.Clone();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
sal_Bool bFromStart,
sal_Bool bApi,
@@ -720,10 +657,6 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
return nFound;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
{
SwDocShell* pDocSh = GetDocShell();
@@ -745,18 +678,11 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SfxPrinter* SwSrcView::GetPrinter( sal_Bool bCreate )
{
return GetDocShell()->GetDoc()->getPrinter( bCreate );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
sal_Int32 SwSrcView::PrintSource(
OutputDevice *pOutDev,
sal_Int32 nPage,
@@ -827,16 +753,10 @@ sal_Int32 SwSrcView::PrintSource(
pOutDev->Pop();
- DBG_ASSERT( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" );
+ OSL_ENSURE( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" );
return nCurPage;
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if ( rHint.ISA(SfxSimpleHint) &&
@@ -857,14 +777,11 @@ void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SfxViewShell::Notify(rBC, rHint);
}
-/*-----------------19.04.97 10:19-------------------
-
---------------------------------------------------*/
void SwSrcView::Load(SwDocShell* pDocShell)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
aEditWin.SetReadonly(pDocShell->IsReadOnly());
@@ -898,7 +815,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
pStream->Seek(0);
TextEngine* pTextEngine = aEditWin.GetTextEngine();
pTextEngine->EnableUndo(sal_False);
- aEditWin.Read(*pStream);//, EE_FORMAT_TEXT);
+ aEditWin.Read(*pStream);
pTextEngine->EnableUndo(sal_True);
}
else
@@ -934,7 +851,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
pInStream->SetStreamCharSet( eDestEnc );
- aEditWin.Read(*pInStream);//, EE_FORMAT_TEXT);
+ aEditWin.Read(*pInStream);
}
}
aEditWin.ClearModifyFlag();
@@ -945,7 +862,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt
// AutoLoad abschalten
pDocShell->SetAutoLoad(INetURLObject(), 0, sal_False);
- DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+ OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
sal_uInt16 nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
aEditWin.SetStartLine(nLine);
aEditWin.GetTextEngine()->ResetUndo();
@@ -953,3 +870,4 @@ void SwSrcView::Load(SwDocShell* pDocShell)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx
index eca1b71052fc..7fc94e550c7d 100644
--- a/sw/source/ui/uiview/swcli.cxx
+++ b/sw/source/ui/uiview/swcli.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
-
#include <wrtsh.hxx>
#include <doc.hxx>
#include <swtypes.hxx>
@@ -137,13 +137,13 @@ void SwOleClient::ViewChanged()
catch( uno::Exception& )
{
// this is an error
- OSL_ENSURE( sal_False, "Something goes wrong on requesting object size!\n" );
+ OSL_FAIL( "Something goes wrong on requesting object size!\n" );
}
Size aVisSize( aSz.Width, aSz.Height );
- // Bug 24833: solange keine vernuenftige Size vom Object kommt,
- // kann nichts skaliert werden
+ // solange keine vernuenftige Size vom Object kommt,
+ // kann nichts skaliert werden
if( !aVisSize.Width() || !aVisSize.Height() )
return;
@@ -171,7 +171,6 @@ void SwOleClient::MakeVisible()
rSh.MakeObjVisible( GetObject() );
}
-// --> #i972#
void SwOleClient::FormatChanged()
{
const uno::Reference < embed::XEmbeddedObject >& xObj( GetObject() );
@@ -183,5 +182,5 @@ void SwOleClient::FormatChanged()
rWrtSh.AlignFormulaToBaseline( xObj );
}
}
-// <--
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/uivwimp.cxx b/sw/source/ui/uiview/uivwimp.cxx
index 7050b8284d18..aff53fe8f20a 100644
--- a/sw/source/ui/uiview/uivwimp.cxx
+++ b/sw/source/ui/uiview/uivwimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <cmdid.h>
#include "globals.hrc"
@@ -38,7 +38,7 @@
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
@@ -58,16 +58,12 @@
#include <view.hrc>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::scanner;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
-/* -----------------02.06.98 15:31-------------------
- *
- * --------------------------------------------------*/
SwView_Impl::SwView_Impl(SwView* pShell) :
pxXTextView(new uno::Reference<view::XSelectionSupplier>),
pView(pShell),
@@ -84,9 +80,6 @@ SwView_Impl::SwView_Impl(SwView* pShell) :
xDisProvInterceptor = new SwXDispatchProviderInterceptor(*pView);
}
-/*-----------------13.12.97 09:51-------------------
-
---------------------------------------------------*/
SwView_Impl::~SwView_Impl()
{
Reference<XUnoTunnel> xDispTunnel(xDisProvInterceptor, UNO_QUERY);
@@ -114,31 +107,22 @@ SwView_Impl::~SwView_Impl()
delete m_pRequest;
}
-/*-----------------13.12.97 09:54-------------------
-
---------------------------------------------------*/
void SwView_Impl::SetShellMode(ShellModes eSet)
{
eShellMode = eSet;
}
-/*-----------------13.12.97 09:59-------------------
---------------------------------------------------*/
view::XSelectionSupplier* SwView_Impl::GetUNOObject()
{
return pxXTextView->get();
}
-/* -----------------02.06.98 15:29-------------------
- *
- * --------------------------------------------------*/
+
SwXTextView* SwView_Impl::GetUNOObject_Impl()
{
view::XSelectionSupplier* pTextView = pxXTextView->get();
return ((SwXTextView*)pTextView);
}
-/* -----------------------------29.05.00 09:04--------------------------------
- ---------------------------------------------------------------------------*/
void SwView_Impl::ExecuteScan( SfxRequest& rReq )
{
sal_uInt16 nSlot = rReq.GetSlot();
@@ -172,8 +156,6 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq )
else
{
rReq.Ignore();
-// KA 04.07.2002
-// InfoBox( 0, SW_RES(MSG_SCAN_NOSOURCE) ).Execute();
}
}
break;
@@ -218,9 +200,6 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq )
}
}
-/* -----------------------------29.05.00 08:26--------------------------------
-
- ---------------------------------------------------------------------------*/
SwScannerEventListener& SwView_Impl::GetScannerEventListener()
{
if(!xScanEvtLstnr.is())
@@ -228,7 +207,6 @@ SwScannerEventListener& SwView_Impl::GetScannerEventListener()
return *pScanEvtLstnr;
}
-
void SwView_Impl::AddClipboardListener()
{
if(!xClipEvtLstnr.is())
@@ -237,9 +215,7 @@ void SwView_Impl::AddClipboardListener()
pClipEvtLstnr->AddRemoveListener( sal_True );
}
}
-/* -----------------3/31/2003 11:42AM----------------
- --------------------------------------------------*/
void SwView_Impl::Invalidate()
{
GetUNOObject_Impl()->Invalidate();
@@ -254,9 +230,7 @@ void SwView_Impl::Invalidate()
pTransferable->Invalidate();
}
}
-/* -----------------3/31/2003 12:40PM----------------
- --------------------------------------------------*/
void SwView_Impl::AddTransferable(SwTransferable& rTransferable)
{
//prevent removing of the non-referenced SwTransferable
@@ -285,23 +259,19 @@ void SwView_Impl::InitRequest( const SfxRequest& rRequest )
m_pRequest = new SfxRequest( rRequest );
}
-// ------------------------- SwScannerEventListener ---------------------
-
SwScannerEventListener::~SwScannerEventListener()
{
}
void SAL_CALL SwScannerEventListener::disposing( const EventObject& rEventObject) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
#if defined WNT || defined UNX
+ SolarMutexGuard aGuard;
if( pView )
pView->ScannerEventHdl( rEventObject );
#endif
}
-// ------------------------- SwClipboardChangeListener ---------------------
-
SwClipboardChangeListener::~SwClipboardChangeListener()
{
}
@@ -315,7 +285,7 @@ void SAL_CALL SwClipboardChangeListener::changedContents( const CLIP_NMSPC::Clip
throw ( RuntimeException )
{
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ const SolarMutexGuard aGuard;
if( pView )
{
{
@@ -343,3 +313,4 @@ void SwClipboardChangeListener::AddRemoveListener( sal_Bool bAdd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index de524dd2706a..14eaf04acaf3 100755
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <string>
#include <stdlib.h>
#include <hintids.hxx>
#include <rtl/logfile.hxx>
@@ -72,6 +72,7 @@
#include <drformsh.hxx>
#include <drwtxtsh.hxx>
#include <beziersh.hxx>
+#include <navsh.hxx>
#include <globdoc.hxx>
#include <scroll.hxx>
#include <navipi.hxx>
@@ -95,7 +96,6 @@
#include <prtopt.hxx>
#include <linguistic/lngprops.hxx>
#include <editeng/unolingu.hxx>
-//#include <sfx2/app.hxx>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/scanner/ScannerContext.hpp>
#include <com/sun/star/scanner/XScannerManager.hpp>
@@ -114,6 +114,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <svl/cjkoptions.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -122,7 +123,6 @@ using namespace ::com::sun::star::scanner;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-
extern sal_Bool bNoInterrupt; // in mainwn.cxx
#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT| \
@@ -144,26 +144,17 @@ sal_Bool SwView::bExtra = sal_False;
sal_Bool SwView::bFound = sal_False;
sal_Bool SwView::bJustOpened = sal_False;
-
SvxSearchDialog* SwView::pSrchDlg = 0;
SearchAttrItemList* SwView::pSrchList = 0;
SearchAttrItemList* SwView::pReplList = 0;
DBG_NAME(viewhdl)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
inline SfxDispatcher &SwView::GetDispatcher()
{
return *GetViewFrame()->GetDispatcher();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwView::ImpSetVerb( int nSelType )
{
sal_Bool bResetVerbs = bVerbsActive;
@@ -191,7 +182,6 @@ void SwView::ImpSetVerb( int nSelType )
Description:
called by the SwEditWin when it gets the focus
--------------------------------------------------------------------*/
-
void SwView::GotFocus() const
{
// if we got the focus, and the form shell *is* on the top of the dispatcher
@@ -229,7 +219,6 @@ void SwView::GotFocus() const
a request to put the form shell on the top of the dispatcher
stack
--------------------------------------------------------------------*/
-
IMPL_LINK( SwView, FormControlActivated, FmFormShell*, EMPTYARG )
{
// if a form control has been activated, and the form shell is not on the top
@@ -269,7 +258,7 @@ void SwView::SelectShell()
}
pLastTableFormat = pCurTableFmt;
- //SEL_TBL und SEL_TBL_CELLS koennen verodert sein!
+ //SEL_TBL and SEL_TBL_CELLS can be changed!
int nNewSelectionType = (pWrtShell->GetSelectionType()
& ~nsSelectionType::SEL_TBL_CELLS);
@@ -290,7 +279,6 @@ void SwView::SelectShell()
SfxDispatcher &rDispatcher = GetDispatcher();
SwToolbarConfigItem *pBarCfg = SW_MOD()->GetToolbarConfig();
- // DELETEZ(pxSelectionObj); //Selektionsobjekt loeschen
if ( pShell )
{
rDispatcher.Flush(); // alle gecachten Shells wirklich loeschen
@@ -338,6 +326,10 @@ void SwView::SelectShell()
if ( !( nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) )
rDispatcher.Push( *pFormShell );
+ eShellMode = SHELL_MODE_NAVIGATION;
+ pShell = new SwNavigationShell( *this );
+ rDispatcher.Push( *pShell );
+
if ( nSelectionType & nsSelectionType::SEL_OLE )
{
eShellMode = SHELL_MODE_OBJECT;
@@ -477,7 +469,7 @@ void SwView::SelectShell()
if ( GetDocShell()->GetDoc()->IsOLEPrtNotifyPending() )
GetDocShell()->GetDoc()->PrtOLENotify( sal_False );
- //jetzt das Tabellen-Update
+ // now the table-update
if(bUpdateTable)
pWrtShell->UpdateTable();
@@ -490,8 +482,6 @@ void SwView::SelectShell()
//Da wir aber keine Stati mehr liefern koennen und wollen locken wir
//stattdessen den Dispatcher.
-
-
extern "C"
{
int lcl_CmpIds( const void *pFirst, const void *pSecond)
@@ -500,8 +490,6 @@ extern "C"
}
}
-
-
IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG )
{
if ( GetEditWin().IsChainMode() )
@@ -513,7 +501,6 @@ IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG )
GetDocShell()->IsReadOnly() )
_CheckReadonlyState();
- // JP 19.01.99: Cursor in Readonly Bereichen
if( !pWrtShell->IsPaintLocked() && !bNoInterrupt )
_CheckReadonlySelection();
@@ -541,34 +528,17 @@ IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG )
}
- //#i6193#, change ui if cursor is at a SwPostItField
+ // change ui if cursor is at a SwPostItField
if (mpPostItMgr)
{
- // --> OD 2008-06-19 #i90516#
// only perform the code that is needed to determine, if at the
// actual cursor position is a post-it field
-// SwRect aFldRect;
-// SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD);
-// if( pWrtShell->GetContentAtPos( pWrtShell->GetCrsrDocPos(), aCntntAtPos, sal_False, &aFldRect ) )
-// {
-// const SwField* pFld = aCntntAtPos.aFnd.pFld;
-// if (pFld->Which()== RES_POSTITFLD)
-// {
-// mpPostItMgr->SetShadowState(reinterpret_cast<const SwPostItField*>(pFld));
-// }
-// else
-// mpPostItMgr->SetShadowState(0);
-// }
-// else
-// mpPostItMgr->SetShadowState(0);
mpPostItMgr->SetShadowState( pWrtShell->GetPostItFieldAtCursor() );
}
return 0;
}
-
-
IMPL_LINK( SwView, TimeoutHdl, Timer *, EMPTYARG )
{
DBG_PROFSTART(viewhdl);
@@ -606,8 +576,8 @@ void SwView::_CheckReadonlyState()
//Um erkennen zu koennen ob bereits disabled ist!
SfxItemState eStateRO, eStateProtAll;
const SfxPoolItem *pItem;
- // JP 29.04.97: von einem nur uns bekannten Slot den Status abfragen.
- // Ansonsten kennen andere den Slot; wie z.B. die BasidIde
+ // von einem nur uns bekannten Slot den Status abfragen.
+ // Ansonsten kennen andere den Slot; wie z.B. die BasidIde
eStateRO = rDis.QueryState( FN_INSERT_BOOKMARK, pItem );
eStateProtAll = rDis.QueryState( FN_EDIT_REGION, pItem );
sal_Bool bChgd = sal_False;
@@ -712,7 +682,7 @@ void SwView::_CheckReadonlySelection()
case SHELL_MODE_TABLE_TEXT:
case SHELL_MODE_TABLE_LIST_TEXT:
{
-//JP 22.01.99: temporaere Loesung!!! Sollte bei jeder Cursorbewegung
+// temporaere Loesung!!! Sollte bei jeder Cursorbewegung
// den Font von der akt. Einfuegeposition setzen, also ausserhalb
// dieses if's. Aber TH wertet den Font zur Zeit nicht aus und
// das besorgen erscheint mir hier zu teuer zu sein.
@@ -743,12 +713,11 @@ void SwView::_CheckReadonlySelection()
}
}
-
SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
: SfxViewShell( _pFrame, SWVIEWFLAGS ),
aPageStr( SW_RES( STR_PAGE )),
nNewPage(USHRT_MAX),
- pNumRuleNodeFromDoc(0), // #i23726#
+ pNumRuleNodeFromDoc(0),
pEditWin( new SwEditWin( &_pFrame->GetWindow(), *this ) ),
pWrtShell(0),
pShell(0),
@@ -790,7 +759,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
bOldShellWasPagePreView(sal_False),
bIsPreviewDoubleClick(sal_False)
{
- // OD 18.12.2002 #103492# - According to discussion with MBA and further
+ // According to discussion with MBA and further
// investigations, no old SfxViewShell will be set as parameter <pOldSh>,
// if function "New Window" is performed to open an additional view beside
// an already existing one.
@@ -819,7 +788,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
sal_Bool bOldModifyFlag = pDocSh->IsEnableSetModified();
if(bOldModifyFlag)
pDocSh->EnableSetModified( sal_False );
- ASSERT( pDocSh, "View ohne DocShell." );
+ OSL_ENSURE( pDocSh, "view without DocShell." );
SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh );
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell);
@@ -832,7 +801,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
sal_Bool bOldShellWasSrcView = sal_False;
- // OD 18.12.2002 #103492# - determine, if there is an existing view for
+ // determine if there is an existing view for
// document
SfxViewShell* pExistingSh = 0;
if ( pOldSh )
@@ -884,20 +853,20 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
aUsrPref.SetViewLayoutColumns( 1 );
}
pWrtShell = new SwWrtShell( rDoc, pEditWin, *this, &aUsrPref );
- //#97610# creating an SwView from a SwPagePreView needs to
+ // creating an SwView from a SwPagePreView needs to
// add the ViewShell to the ring of the other ViewShell(s)
if(bOldShellWasPagePreView)
{
ViewShell& rPreviewViewShell = *((SwPagePreView*)pExistingSh)->GetViewShell();
pWrtShell->MoveTo(&rPreviewViewShell);
- //#95521# to update the field command et.al. if necessary
+ // to update the field command et.al. if necessary
const SwViewOption* pPreViewOpt = rPreviewViewShell.GetViewOptions();
if( pPreViewOpt->IsFldName() != aUsrPref.IsFldName() ||
pPreViewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
pPreViewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
pPreViewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
rPreviewViewShell.ApplyViewOptions(aUsrPref);
- // OD 09.01.2003 #106334# - reset design mode at draw view for form
+ // reset design mode at draw view for form
// shell, if needed.
if ( ((SwPagePreView*)pExistingSh)->ResetFormDesignMode() &&
pWrtShell->HasDrawView() )
@@ -909,16 +878,15 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
}
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create WrtShell" );
- // --> OD 2005-02-11 #i38810# - assure that modified state of document
+ // assure that modified state of document
// isn't reset, if document is already modified.
const bool bIsDocModified = pWrtShell->GetDoc()->IsModified();
- // <--
- // JP 05.02.99: Bug 61495 - damit unter anderem das HLineal im
+ // damit unter anderem das HLineal im
// ReadonlyFall nicht angezeigt wird
aUsrPref.SetReadonly( pWrtShell->GetViewOptions()->IsReadonly() );
- //Kein Margin fuer OLE!
+ // no margin for OLE!
Size aBrwsBorder;
if( SFX_CREATE_MODE_EMBEDDED != pDocSh->GetCreateMode() )
aBrwsBorder = GetMargin();
@@ -944,16 +912,20 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
StartListening( *pViewFrame, sal_True );
StartListening( *pDocSh, sal_True );
- // Vom HLineal den ZOOM-Faktor einstellen
+ // Set Zoom-factor from HLineal
Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
pHRuler->SetZoom( aZoomFract );
pVRuler->SetZoom( aZoomFract );
pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
FieldUnit eMetric = pUsrPref->GetHScrollMetric();
pHRuler->SetUnit( eMetric );
+
eMetric = pUsrPref->GetVScrollMetric();
pVRuler->SetUnit( eMetric );
+ pHRuler->SetCharWidth( 371 ); // default character width
+ pVRuler->SetLineHeight( 551 ); // default line height
+
// DocShell setzen
pDocSh->SetView( this );
SW_MOD()->SetView( this );
@@ -1018,14 +990,13 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
SfxViewFrame* pFirst = SfxViewFrame::GetFirst(pDocSh);
// zur Zeit(360) wird die View erst nach dem Ctor eingetragen
// der folgende Ausdruck funktioniert auch, wenn sich das aendert
- //JP 27.07.98: wenn per Undo nicht mehr die Modifizierung aufhebar ist,
+ // wenn per Undo nicht mehr die Modifizierung aufhebar ist,
// so setze das Modified NICHT zurueck.
- // --> OD 2005-02-11 #i38810# - no reset of modified state, if document
+ // no reset of modified state, if document
// was already modified.
if (!pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
( !pFirst || pFirst == pVFrame ) &&
!bIsDocModified )
- // <--
{
pWrtShell->ResetModified();
}
@@ -1040,11 +1011,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
GetDispatcher().Execute(SID_NAVIGATOR, SFX_CALLMODE_ASYNCHRON, &aNavi, 0L);
}
-
- uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
+ uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
- OUString::createFromAscii("_beamer"), frame::FrameSearchFlag::CHILDREN);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")), frame::FrameSearchFlag::CHILDREN);
if(xBeamerFrame.is())
{
SwDBData aData = pWrtShell->GetDBData();
@@ -1064,14 +1034,20 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
if(bOldModifyFlag)
pDocSh->EnableSetModified( sal_True );
InvalidateBorder();
+
+ if( !pHScrollbar->IsVisible( sal_True ) )
+ ShowHScrollbar( sal_False );
+ if( !pVScrollbar->IsVisible( sal_True ) )
+ ShowVScrollbar( sal_False );
+
+ GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
}
SwView::~SwView()
{
+ GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
delete mpPostItMgr;
- // --> OD 2009-03-10 #i100035#
mpPostItMgr = 0;
- // <--
bInDtor = sal_True;
pEditWin->Hide(); // damit kein Paint Aerger machen kann!
@@ -1085,7 +1061,7 @@ SwView::~SwView()
if( aTimer.IsActive() && bAttrChgNotifiedWithRegistrations )
GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
- //JP 27.11.00: Bug 80631 - the last view must end the text edit
+ // the last view must end the text edit
SdrView *pSdrView = pWrtShell ? pWrtShell->GetDrawView() : 0;
if( pSdrView && pSdrView->IsTextEdit() )
pSdrView->SdrEndTextEdit( sal_True );
@@ -1122,8 +1098,6 @@ SwDocShell* SwView::GetDocShell()
/*--------------------------------------------------------------------
Beschreibung: CursorPos merken
--------------------------------------------------------------------*/
-
-
void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse )
{
//Das Browse-Flag wird vom Sfx durchgereicht, wenn Dokumente gebrowsed
@@ -1152,10 +1126,10 @@ void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse )
rUserData += ';';
rUserData += FRMTYPE_NONE == pWrtShell->GetSelFrmType() ? '0' : '1';
}
+
/*--------------------------------------------------------------------
Beschreibung: CursorPos setzen
--------------------------------------------------------------------*/
-//#i43146# go to the last editing position when opening own files
bool lcl_IsOwnDocument( SwView& rView )
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -1170,7 +1144,6 @@ bool lcl_IsOwnDocument( SwView& rView )
(!Changed.Len() && Created.Len() && Created == FullName );
}
-
void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
{
if ( rUserData.GetTokenCount() > 1 &&
@@ -1178,7 +1151,6 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
//Forward/Backward
(!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
{
- //#i43146# go to the last editing position when opening own files
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
SET_CURR_SHELL(pWrtShell);
@@ -1219,14 +1191,13 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
sal_Bool bSelectObj = (0 != rUserData.GetToken( nOff, ';', nPos ).ToInt32())
&& pWrtShell->IsObjSelectable( aCrsrPos );
- //#i33307# restore editing position
+ // restore editing position
pViewImpl->SetRestorePosition(aCrsrPos, bSelectObj);
- // OD 11.02.2003 #100556# - set flag value to avoid macro execution.
+ // set flag value to avoid macro execution.
bool bSavedFlagValue = pWrtShell->IsMacroExecAllowed();
pWrtShell->SetMacroExecAllowed( false );
-//!!! pb (11.08.2004): #i32536#
// os: changed: The user data has to be read if the view is switched back from page preview
-//#i43146# go to the last editing position when opening own files
+// go to the last editing position when opening own files
if(bOldShellWasPagePreView || bIsOwnDocument)
{
pWrtShell->SwCrsrShell::SetCrsr( aCrsrPos, !bSelectObj );
@@ -1237,15 +1208,14 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
}
}
- // OD 11.02.2003 #100556# - reset flag value
+ // reset flag value
pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
- // OD 08.04.2003 #108693# - set visible area before applying
+ // set visible area before applying
// information from print preview. Otherwise, the applied information
// is lost.
-//!!! pb (11.08.2004): #i32536#
// os: changed: The user data has to be read if the view is switched back from page preview
-//#i43146# go to the last editing position when opening own files
+// go to the last editing position when opening own files
if(bOldShellWasPagePreView || bIsOwnDocument )
{
if ( bBrowse )
@@ -1296,7 +1266,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
{
if(GetDocShell()->IsPreview()||bIsPreviewDoubleClick)
return;
- //#i43146# go to the last editing position when opening own files
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
sal_Int32 nLength = rSequence.getLength();
if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
@@ -1315,7 +1284,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
sal_Bool bSelectedFrame = ( pWrtShell->GetSelFrmType() != FRMTYPE_NONE ),
- bGotViewLeft = sal_False, bGotViewTop = sal_False, bGotVisibleLeft = sal_False,
+ bGotVisibleLeft = sal_False,
bGotVisibleTop = sal_False, bGotVisibleRight = sal_False,
bGotVisibleBottom = sal_False, bGotZoomType = sal_False,
bGotZoomFactor = sal_False, bGotIsSelectedFrame = sal_False,
@@ -1327,13 +1296,11 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
{
pValue->Value >>= nX;
nX = MM100_TO_TWIP( nX );
- bGotViewLeft = sal_True;
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ViewTop" ) ) )
{
pValue->Value >>= nY;
nY = MM100_TO_TWIP( nY );
- bGotViewTop = sal_True;
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VisibleLeft" ) ) )
{
@@ -1409,13 +1376,11 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
sal_Bool bSelectObj = (sal_False != bSelectedFrame )
&& pWrtShell->IsObjSelectable( aCrsrPos );
- // OD 11.02.2003 #100556# - set flag value to avoid macro execution.
+ // set flag value to avoid macro execution.
bool bSavedFlagValue = pWrtShell->IsMacroExecAllowed();
pWrtShell->SetMacroExecAllowed( false );
-//!!! pb (11.08.2004): #i32536#
// os: changed: The user data has to be read if the view is switched back from page preview
-//#i43146# go to the last editing position when opening own files
- //#i33307# restore editing position
+// go to the last editing position when opening own files
pViewImpl->SetRestorePosition(aCrsrPos, bSelectObj);
if(bOldShellWasPagePreView|| bIsOwnDocument)
{
@@ -1427,7 +1392,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
}
}
- // OD 11.02.2003 #100556# - reset flag value
+ // reset flag value
pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
}
SelectShell();
@@ -1448,7 +1413,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
bSetViewSettings &&
eZoom != SVX_ZOOM_PERCENT;
-
if ( !bZoomNeedsViewLayout )
pWrtShell->StartAction();
@@ -1461,15 +1425,14 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
if ( bSetViewSettings )
SetZoom( eZoom, nZoomFactor, sal_True );
-//!!! pb (11.08.2004): #i32536#
// os: changed: The user data has to be read if the view is switched back from page preview
-//#i43146# go to the last editing position when opening own files
+// go to the last editing position when opening own files
if(bOldShellWasPagePreView||bIsOwnDocument)
{
if ( bBrowse && bGotVisibleLeft && bGotVisibleTop )
{
Point aTopLeft(aVis.TopLeft());
- //#i76699# make sure the document is still centered
+ // make sure the document is still centered
const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
SwTwips nEditWidth = GetEditWin().GetOutputSize().Width();
if(nEditWidth > (aDocSz.Width() + lBorder ))
@@ -1495,6 +1458,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
}
}
}
+
#define NUM_VIEW_SETTINGS 12
void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence, sal_Bool bBrowse )
{
@@ -1566,11 +1530,9 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe
}
#undef NUM_VIEW_SETTINGS
-
-
-void SwView::ShowCursor( FASTBOOL bOn )
+void SwView::ShowCursor( bool bOn )
{
- //JP 10.10.2001: Bug 90461 - don't scroll the cursor into the visible area
+ //don't scroll the cursor into the visible area
sal_Bool bUnlockView = !pWrtShell->IsViewLocked();
pWrtShell->LockView( sal_True ); //lock visible section
@@ -1583,8 +1545,6 @@ void SwView::ShowCursor( FASTBOOL bOn )
pWrtShell->LockView( sal_False );
}
-
-
ErrCode SwView::DoVerb( long nVerb )
{
if ( !GetViewFrame()->GetFrame().IsInPlace() )
@@ -1597,27 +1557,19 @@ ErrCode SwView::DoVerb( long nVerb )
return ERRCODE_NONE;
}
-/*-----------------17.02.98 13:33-------------------
- nur sal_True fuer eine Textselektion zurueck geben
---------------------------------------------------*/
+/* only return sal_True for a text selection
+*/
sal_Bool SwView::HasSelection( sal_Bool bText ) const
{
return bText ? GetWrtShell().SwCrsrShell::HasSelection()
: GetWrtShell().HasSelection();
}
-/*-----------------09/16/97 09:50am-----------------
-
---------------------------------------------------*/
-
String SwView::GetSelectionText( sal_Bool bCompleteWrds )
{
return GetSelectionTextParam( bCompleteWrds, sal_True );
}
-/*-----------------09/16/97 09:50am-----------------
-
---------------------------------------------------*/
String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds,
sal_Bool bEraseTrail )
{
@@ -1631,12 +1583,6 @@ String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds,
return sReturn;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwGlossaryHdl* SwView::GetGlosHdl()
{
if(!pGlosHdl)
@@ -1644,12 +1590,6 @@ SwGlossaryHdl* SwView::GetGlosHdl()
return pGlosHdl;
}
-/*-----------------05.09.96 15.50-------------------
-
---------------------------------------------------*/
-
-
-
void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
sal_Bool bCallBase = sal_True;
@@ -1658,7 +1598,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId();
switch ( nId )
{
- // --> OD 2005-03-03 #i43775# - sub shells will be destroyed by the
+ // sub shells will be destroyed by the
// dispatcher, if the view frame is dying. Thus, reset member <pShell>.
case SFX_HINT_DYING:
{
@@ -1668,7 +1608,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
break;
- // <--
case SFX_HINT_MODECHANGED:
{
// Modalmodus-Umschaltung?
@@ -1677,7 +1616,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
pVRuler->SetActive( !bModal );
}
- /* kein break hier */
+ /* no break here */
case SFX_HINT_TITLECHANGED:
if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
@@ -1694,7 +1633,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
else
KillTab();
bool bReadonly = GetDocShell()->IsReadOnly();
- //#i76332# if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode
+ // if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode
if( !bReadonly )
{
SwDrawDocument * pDrawDoc = 0;
@@ -1741,9 +1680,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SfxViewShell::Notify(rBC, rHint);
}
-/*-----------------02.12.96 12:36-------------------
-
---------------------------------------------------*/
#if defined WNT || defined UNX
void SwView::ScannerEventHdl( const EventObject& /*rEventObject*/ )
@@ -1776,11 +1712,6 @@ void SwView::ScannerEventHdl( const EventObject& /*rEventObject*/ )
}
#endif
-/*-----------------04.03.97 15:07-------------------
-
---------------------------------------------------*/
-
-
void SwView::StopShellTimer()
{
if(aTimer.IsActive())
@@ -1796,9 +1727,6 @@ void SwView::StopShellTimer()
}
}
-/*-----------------09/03/97 04:12pm-----------------
-
---------------------------------------------------*/
sal_uInt16 SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
SfxViewFrame* pVFrame = GetViewFrame();
@@ -1816,10 +1744,8 @@ sal_uInt16 SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
return SfxViewShell::PrepareClose( bUI, bForBrowsing );
}
-
-
- // status methods for clipboard.
- // Status changes now notified from the clipboard.
+// status methods for clipboard.
+// Status changes now notified from the clipboard.
sal_Bool SwView::IsPasteAllowed()
{
sal_uInt16 nPasteDestination = SwTransferable::GetSotDestination( *pWrtShell );
@@ -1869,9 +1795,7 @@ sal_Bool SwView::IsPasteSpecialAllowed()
}
return bPasteSpecialState;
}
-/* -----------------------------12.07.01 13:25--------------------------------
- ---------------------------------------------------------------------------*/
void SwView::NotifyDBChanged()
{
GetViewImpl()->GetUNOObject_Impl()->NotifyDBChanged();
@@ -1880,17 +1804,11 @@ void SwView::NotifyDBChanged()
/*--------------------------------------------------------------------
Beschreibung: Drucken
--------------------------------------------------------------------*/
-
-/* -----------------------------28.10.02 13:25--------------------------------
-
- ---------------------------------------------------------------------------*/
SfxObjectShellLock & SwView::GetTmpSelectionDoc()
{
return GetViewImpl()->GetTmpSelectionDoc();
}
-/* -----------------------------31.10.02 13:25--------------------------------
- ---------------------------------------------------------------------------*/
SfxObjectShellLock & SwView::GetOrCreateTmpSelectionDoc()
{
SfxObjectShellLock &rxTmpDoc = GetViewImpl()->GetTmpSelectionDoc();
@@ -1901,16 +1819,12 @@ SfxObjectShellLock & SwView::GetOrCreateTmpSelectionDoc()
}
return rxTmpDoc;
}
-/* -----------------3/31/2003 12:39PM----------------
- --------------------------------------------------*/
void SwView::AddTransferable(SwTransferable& rTransferable)
{
GetViewImpl()->AddTransferable(rTransferable);
}
-/* --------------------------------------------------*/
-
namespace sw {
void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
@@ -1920,3 +1834,4 @@ void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
} // namespace sw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index 11543c0ac8f3..2f65a91d9115 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -142,7 +142,6 @@ String STR_NUM_OUTLINE
{
Text [ en-US ] = "Outline ";
};//<-end,zhaojianwei
-// <--
String STR_ERROR_NOLANG
{
Text [ en-US ] = "No language is selected in the proofed section." ;
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 503371fd3837..9b55a8247ebd 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "hintids.hxx"
#include <vcl/graph.hxx>
#include <svx/galbrws.hxx>
@@ -90,7 +89,6 @@
#include "swslots.hxx"
#include <PostItMgr.hxx>
-
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -123,7 +121,6 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) )
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_FIELD_DATA_ONLY);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_SYNC_LABELS, CHILDWIN_LABEL );
SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_MAILMERGE_CHILDWINDOW, CHILDWIN_MAILMERGE);
-// SFX_CHILDWINDOW_REGISTRATION(FN_MAILMERGE_SENDMAIL_CHILDWINDOW);
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS|
SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
SW_RES(RID_TOOLS_TOOLBOX) );
@@ -131,24 +128,16 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) )
TYPEINIT1(SwView,SfxViewShell)
-/*-----------------13.12.97 11:06-------------------
-
---------------------------------------------------*/
ShellModes SwView::GetShellMode()
{
return pViewImpl->GetShellMode();
}
-/*-----------------13.12.97 11:28-------------------
-
---------------------------------------------------*/
view::XSelectionSupplier* SwView::GetUNOObject()
{
return pViewImpl->GetUNOObject();
}
-/* -----------------------------06.05.2002 13:18------------------------------
- ---------------------------------------------------------------------------*/
void SwView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
{
pWrtShell->ApplyAccessiblityOptions(rAccessibilityOptions);
@@ -157,39 +146,29 @@ void SwView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOpt
pWrtShell->ShowCrsr();
}
-/*-- 26.05.2004 09:14:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwView::SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem,
sal_uInt16 nRestart, sal_Bool bIsSource)
{
pViewImpl->SetMailMergeConfigItem(pConfigItem, nRestart, bIsSource);
UIFeatureChanged();
}
-/*-- 26.05.2004 09:14:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwMailMergeConfigItem* SwView::GetMailMergeConfigItem()
{
return pViewImpl->GetMailMergeConfigItem();
}
-/*-- 26.05.2004 09:14:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_uInt16 SwView::GetMailMergeRestartPage() const
{
return pViewImpl->GetMailMergeRestartPage();
}
-/*-- 03.09.2004 11:56:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwView::IsMailMergeSourceView() const
{
return pViewImpl->IsMailMergeSourceView();
}
-/*-- 12.04.2006 11:51:40---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool lcl_IsViewMarks( const SwViewOption& rVOpt )
{
return rVOpt.IsHardBlank() &&
@@ -224,7 +203,7 @@ void lcl_SetViewMetaChars( SwViewOption& rVOpt, sal_Bool bOn)
void SwView::RecheckBrowseMode()
{
// OS: numerische Reihenfolge beachten!
- static sal_uInt16 __READONLY_DATA aInva[] =
+ static sal_uInt16 const aInva[] =
{
//SID_NEWWINDOW,/*5620*/
SID_BROWSER_MODE, /*6313*/
@@ -570,7 +549,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
break;
default:
- ASSERT(sal_False, Falsche Request-Methode);
+ OSL_FAIL("wrong request method");
return;
}
@@ -600,7 +579,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pModule->ApplyUsrPref( *pOpt, this, bWebView ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT );
- //mod #i6193# let postits know about new spellcheck setting
+ // #i6193# let postits know about new spellcheck setting
if ( nSlot == SID_AUTOSPELL_CHECK )
GetPostItMgr()->SetSpellChecking();
@@ -624,3 +603,5 @@ IMPL_LINK( SwView, HtmlOptionsHdl, void*, EMPTYARG )
GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/view1.cxx b/sw/source/ui/uiview/view1.cxx
index 2f9bdcbe9a83..09de8dc9a0c8 100644
--- a/sw/source/ui/uiview/view1.cxx
+++ b/sw/source/ui/uiview/view1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,34 +29,23 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svx/svdpagv.hxx>
#include <svx/svdview.hxx>
#include <svx/ruler.hxx>
#include <idxmrk.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <swmodule.hxx>
#include <viewopt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _GLOBDOC_HXX
#include <globdoc.hxx>
-#endif
#include <navipi.hxx>
#include <fldwrap.hxx>
-#ifndef _REDLNDLG_HXX
#include <redlndlg.hxx>
-#endif
#include <dpage.hxx>
#include <edtwin.hxx>
#include "formatclipboard.hxx"
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
// header for class SfxRequest
#include <sfx2/request.hxx>
@@ -63,12 +53,6 @@
extern int bDocSzUpdated;
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwView::Activate(sal_Bool bMDIActivate)
{
// aktuelle View anmelden an der DocShell
@@ -85,7 +69,7 @@ void SwView::Activate(sal_Bool bMDIActivate)
if(!bDocSzUpdated)
DocSzChgd(aDocSz);
- // #b6330459# make selection visible
+ // make selection visible
if(bMakeSelectionVisible)
{
pWrtShell->MakeSelVisible();
@@ -139,11 +123,6 @@ void SwView::Activate(sal_Bool bMDIActivate)
SfxViewShell::Activate(bMDIActivate);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwView::Deactivate(sal_Bool bMDIActivate)
{
extern sal_Bool bFlushCharBuffer ;
@@ -161,18 +140,11 @@ void SwView::Deactivate(sal_Bool bMDIActivate)
SfxViewShell::Deactivate(bMDIActivate);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwView::MarginChanged()
{
GetWrtShell().SetBrowseBorder( GetMargin() );
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
-
void SwView::ExecFormatPaintbrush(SfxRequest& rReq)
{
if(!pFormatClipboard)
@@ -217,3 +189,5 @@ void SwView::StateFormatPaintbrush(SfxItemSet &rSet)
rSet.DisableItem( SID_FORMATPAINTBRUSH );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 8234a7a3583a..b7cec7a5325a 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,7 @@
#include <caption.hxx>
#include <svl/PasswordHelper.hxx>
#include <svl/urihelper.hxx>
+#include <svtools/miscopt.hxx>
#include <sfx2/passwd.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/filedlghelper.hxx>
@@ -57,6 +59,7 @@
#include <svx/viewlayoutitem.hxx>
#include <svx/zoomslideritem.hxx>
#include <svtools/xwindowitem.hxx>
+#include <svx/linkwarn.hxx>
#include <svx/htmlmode.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -142,8 +145,8 @@
#include <svx/ofaitem.hxx>
#include <unomid.h>
-const char __FAR_DATA sStatusDelim[] = " : ";
-const char __FAR_DATA sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei
+const char sStatusDelim[] = " : ";
+const char sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei
using ::rtl::OUString;
using namespace sfx2;
@@ -158,7 +161,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::ui::dialogs;
-
static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhichId )
{
if (nWhichId == RES_CHRATR_LANGUAGE ||
@@ -174,9 +176,9 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
rWrtSh.ExtendedSelectAll();
// set language attribute to default for all text
- SvUShortsSort aAttribs;
- aAttribs.Insert( nWhichId );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( nWhichId );
+ rWrtSh.ResetAttr( aAttribs );
rWrtSh.Pop( sal_False );
rWrtSh.LockView( sal_False );
@@ -187,7 +189,6 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
/*---------------------------------------------------------------------------
Beschreibung: String fuer die Seitenanzeige in der Statusbar basteln.
----------------------------------------------------------------------------*/
-
String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg,
const String& rDisplay )
{
@@ -208,7 +209,6 @@ String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg,
return aStr;
}
-
int SwView::InsertGraphic( const String &rPath, const String &rFilter,
sal_Bool bLink, GraphicFilter *pFlt,
Graphic* pPreviewGrf, sal_Bool bRule )
@@ -222,8 +222,8 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter,
else
{
if( !pFlt )
- pFlt = GraphicFilter::GetGraphicFilter();
- nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt /*, nFilter*/ );
+ pFlt = &GraphicFilter::GetGraphicFilter();
+ nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt );
}
if( GRFILTER_OK == nRes )
@@ -254,7 +254,6 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter,
return nRes;
}
-
sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
{
#ifndef ENABLE_PROP_WITHOUTLINK
@@ -324,7 +323,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
}
catch(Exception& )
{
- DBG_ERROR("control acces failed");
+ OSL_FAIL("control acces failed");
}
SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC , sal_False );
@@ -355,7 +354,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
try
{
Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
- DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
+ OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True;
Any aTemplateValue = xCtrlAcc->getValue(
ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
@@ -366,7 +365,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
}
catch(Exception& )
{
- DBG_ERROR("control acces failed");
+ OSL_FAIL("control access failed");
}
}
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
@@ -390,7 +389,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
else
{
Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
- DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
+ OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True;
Any aTemplateValue = xCtrlAcc->getValue(
ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
@@ -402,23 +401,30 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
rReq.AppendItem( SfxStringItem( FN_PARAM_2, sGraphicFormat ) );
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
}
+
+ // really store as link only?
+ if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
+ {
+ SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath());
+ if( aWarnDlg.Execute() != RET_OK )
+ bAsLink=sal_False; // don't store as link
+ }
}
SwWrtShell& rSh = GetWrtShell();
rSh.LockPaint();
rSh.StartAction();
- /// #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_GRAPHIC_DEFNAME)));
rSh.StartUndo(UNDO_INSERT, &aRewriter);
- int nError = InsertGraphic( aFileName, aFilterName, bAsLink, GraphicFilter::GetGraphicFilter() );
+ int nError = InsertGraphic( aFileName, aFilterName, bAsLink, &GraphicFilter::GetGraphicFilter() );
// Format ist ungleich Current Filter, jetzt mit auto. detection
if( nError == GRFILTER_FORMATERROR )
- nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, GraphicFilter::GetGraphicFilter() );
+ nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, &GraphicFilter::GetGraphicFilter() );
if ( rSh.IsFrmSelected() )
{
SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat );
@@ -479,8 +485,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
return bReturn;
}
-
-void __EXPORT SwView::Execute(SfxRequest &rReq)
+void SwView::Execute(SfxRequest &rReq)
{
sal_uInt16 nSlot = rReq.GetSlot();
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -489,17 +494,15 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
switch( nSlot )
{
case SID_CREATE_SW_DRAWVIEW:
- // --> OD 2005-08-08 #i52858# - method name changed
pWrtShell->getIDocumentDrawModelAccess()->GetOrCreateDrawModel();
- // <--
break;
case FN_LINE_NUMBERING_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pDlg = pFact->CreateVclSwViewDialog( DLG_LINE_NUMBERING, *this);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -537,7 +540,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword();
if( aPasswd.getLength() )
{
- DBG_ASSERT( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
+ OSL_ENSURE( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
// xmlsec05: new password dialog
Window* pParent;
const SfxPoolItem* pParentItem;
@@ -855,8 +858,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
pWrtShell->ApplyAutoMark();
bAutoMarkApplied = sal_True;
}
- // JP 15.07.96: das pBase wird nur fuer die Schnittstelle
- // benoetigt. Muss mal umgetstellt werden!!!
+ // das pBase wird nur fuer die Schnittstelle
+ // benoetigt. Muss mal umgetstellt werden!!!
pWrtShell->UpdateTableOf( *pBase );
if( pWrtShell->GotoNextTOXBase() )
@@ -969,10 +972,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
JumpToSwMark( (( const SfxStringItem*)pItem)->GetValue() );
break;
case SID_GALLERY :
- GetViewFrame()->ChildWindowExecute(rReq);//ToggleChildWindow(SID_GALLERY);
+ GetViewFrame()->ChildWindowExecute(rReq);
break;
case SID_AVMEDIA_PLAYER :
- GetViewFrame()->ChildWindowExecute(rReq);//ToggleChildWindow(SID_AVMEDIA_PLAYER);
+ GetViewFrame()->ChildWindowExecute(rReq);
break;
case SID_VIEW_DATA_SOURCE_BROWSER:
{
@@ -991,7 +994,6 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
if( pArgs &&
SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem ))
bShow = ((const SfxBoolItem*)pItem)->GetValue();
- //GetViewFrame()->ShowChildWindow(nSlot, bShow && bInMailMerge);
if((bShow && bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
GetViewFrame()->ToggleChildWindow(nSlot);
//if fields have been succesfully inserted call the "real"
@@ -1033,10 +1035,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
SfxViewFrame* pTmpFrame = GetViewFrame();
SfxHelp::OpenHelpAgent( &pTmpFrame->GetFrame(), HID_MAIL_MERGE_SELECT );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg( DLG_MERGE_CREATE,
&pTmpFrame->GetWindow());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
bUseCurrentDocument = pDlg->IsThisDocument();
else
@@ -1151,7 +1153,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
if(!bIgnore)
@@ -1161,7 +1163,6 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
/*--------------------------------------------------------------------
Beschreibung: SeitenNr-Feld invalidieren
--------------------------------------------------------------------*/
-
void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr)
{
String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
@@ -1174,33 +1175,19 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const Strin
/*--------------------------------------------------------------------
Beschreibung: Status der Stauszeile
--------------------------------------------------------------------*/
-
-
void SwView::StateStatusLine(SfxItemSet &rSet)
{
SwWrtShell& rShell = GetWrtShell();
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
- ASSERT( nWhich, "leeres Set");
+ OSL_ENSURE( nWhich, "empty set");
while( nWhich )
{
switch( nWhich )
{
- case FN_STAT_PAGE:
-/*
-//JP 07.01.00: is a nice feature - show the selektion of DrawObjects
- if( rShell.IsObjSelected()
-//??? || rShell.IsFrmSelected()
- )
- {
- String sDisplay( rShell.GetDrawView()->GetMarkedObjectList().
- GetDescriptionOfMarkedObjects() );
- rSet.Put( SfxStringItem( FN_STAT_PAGE, sDisplay ));
- }
- else
-*/ {
+ case FN_STAT_PAGE: {
// Anzahl der Seiten, log. SeitenNr. SeitenNr ermitteln
sal_uInt16 nPage, nLogPage;
String sDisplay;
@@ -1372,7 +1359,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
sStr = pTOX->GetTOXName();
else
{
- ASSERT( !this,
+ OSL_ENSURE( !this,
"was ist das fuer ein Verzeichnis?" );
sStr = pCurrSect->GetSectionName();
}
@@ -1384,75 +1371,26 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
}
}
}
-
- //#outline level, removed by zhaojianwei
- //const SwNumRule* pNumRule = rShell.GetCurNumRule();
- //if (pNumRule) // Cursor in Numerierung
- //{
- // sal_uInt8 nNumLevel = rShell.GetNumLevel();
- // if( IsShowNum(nNumLevel) && MAXLEVEL >
- // ( nNumLevel = GetRealLevel( nNumLevel )) )
- // {
- // if( sStr.Len() )
- // sStr.AppendAscii(sStatusDelim);
- // sStr += SW_RESSTR(STR_NUM_LEVEL);
- // sStr += String::CreateFromInt32( nNumLevel + 1 );
- // if(!pNumRule->IsAutoRule())
- // {
- // SfxItemSet aSet(GetPool(),
- // RES_PARATR_NUMRULE, RES_PARATR_NUMRULE);
- // rShell.GetCurAttr(aSet);
- // /* const SfxPoolItem* pItem; */
- // if(SFX_ITEM_AVAILABLE <=
- // aSet.GetItemState(RES_PARATR_NUMRULE, sal_True
- // /*, &pItem */ ))
- // {
- // const String& rNumStyle =
- // ((const SfxStringItem &)
- // aSet.Get(RES_PARATR_NUMRULE)).GetValue();
- // /* #i5116# GetItemState does not necessarily
- // change pItem */
- // // ((const SfxStringItem*)pItem)->GetValue();
- // if(rNumStyle.Len())
- // {
- // sStr.AppendAscii(sStatusDelim);
- // sStr += rNumStyle;
- // }
- // }
- // }
- // }
- //}//<-removed end ,zhaojianwei
-
//-->#outline level,added by zhaojianwei
const SwNumRule* pNumRule = rShell.GetCurNumRule();
const bool bOutlineNum = pNumRule ? pNumRule->IsOutlineRule() : 0;
- //((SwTxtFmtColl*)rShell.GetCrsr()->GetNode()->GetTxtNode()->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle();
if (pNumRule && !bOutlineNum ) // Cursor in Numerierung
{
sal_uInt8 nNumLevel = rShell.GetNumLevel();
- // --> OD 2008-04-02 #refactorlists#
-// if( IsShowNum(nNumLevel) && MAXLEVEL >
-// ( nNumLevel = GetRealLevel( nNumLevel )) )
if ( nNumLevel < MAXLEVEL )
- // <--
{
if(!pNumRule->IsAutoRule())
{
SfxItemSet aSet(GetPool(),
RES_PARATR_NUMRULE, RES_PARATR_NUMRULE);
rShell.GetCurAttr(aSet);
- /* const SfxPoolItem* pItem; */
if(SFX_ITEM_AVAILABLE <=
- aSet.GetItemState(RES_PARATR_NUMRULE, sal_True
- /*, &pItem */ ))
+ aSet.GetItemState(RES_PARATR_NUMRULE, sal_True))
{
const String& rNumStyle =
((const SfxStringItem &)
aSet.Get(RES_PARATR_NUMRULE)).GetValue();
- /* #i5116# GetItemState does not necessarily
- change pItem */
- // ((const SfxStringItem*)pItem)->GetValue();
if(rNumStyle.Len())
{
if( sStr.Len() )
@@ -1523,8 +1461,6 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
/*--------------------------------------------------------------------
Beschreibung: Execute fuer die Stauszeile
--------------------------------------------------------------------*/
-
-
void SwView::ExecuteStatusLine(SfxRequest &rReq)
{
SwWrtShell &rSh = GetWrtShell();
@@ -1555,8 +1491,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
rSh.GotoMark( ppBookmark->get() );
}
else
- OSL_ENSURE(false,
- "SwView::ExecuteStatusLine(..)"
+ OSL_FAIL("SwView::ExecuteStatusLine(..)"
" - Ignoring out of range bookmark index");
}
}
@@ -1605,7 +1540,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
if(pFact)
{
pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
pDlg->SetLimits( MINZOOM, MAXZOOM );
@@ -1810,7 +1745,6 @@ void SwView::InsFrmMode(sal_uInt16 nCols)
/*--------------------------------------------------------------------
Beschreibung: Links bearbeiten
--------------------------------------------------------------------*/
-
void SwView::EditLinkDlg()
{
sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
@@ -1821,13 +1755,6 @@ void SwView::EditLinkDlg()
pDlg->Execute();
delete pDlg;
}
-/*
- SwLinkDlg* pDlg = new SwLinkDlg(GetFrameWindow());
- pDlg->SetShell(&GetWrtShell());
- pDlg->Execute();
-
- DELETEZ(pDlg);
-*/
}
sal_Bool SwView::JumpToSwMark( const String& rMark )
@@ -1840,7 +1767,6 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
sal_Bool bSaveCT = IsCrsrAtTop();
SetCrsrAtTop( sal_True );
- //JP 27.04.98: Bug 49786
// Damit in FrameSet auch gescrollt werden kann, muss die
// entsprechende Shell auch das Focus-Flag gesetzt haben!
sal_Bool bHasShFocus = pWrtShell->HasShFcs();
@@ -1910,8 +1836,10 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
}
else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) )
pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True;
- else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) ))
+ else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) {
+ pWrtShell->addCurrentPosition();
bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() );
+ }
// fuer alle Arten von Flys
if( FLYCNTTYPE_ALL != eFlyType && pWrtShell->GotoFly( sName, eFlyType ))
@@ -1935,7 +1863,7 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) ))
bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() );
- // #b6330459# make selection visible later
+ // make selection visible later
if ( aVisArea.IsEmpty() )
bMakeSelectionVisible = sal_True;
@@ -1948,11 +1876,10 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
return bRet;
}
-// #i67305, #1367991: Undo after insert from file:
+// #i67305# Undo after insert from file:
// Undo "Insert form file" crashes with documents imported from binary filter (.sdw) => disabled
// Undo "Insert form file" crashes with (.odt) documents crashes if these documents contains
// page styles with active header/footer => disabled for those documents
-
sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc )
{
sal_uInt16 nRet = 0;
@@ -1974,7 +1901,6 @@ sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc )
/*--------------------------------------------------------------------
Beschreibung: Links bearbeiten
--------------------------------------------------------------------*/
-
void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
{
pViewImpl->InitRequest( rRequest );
@@ -2042,18 +1968,18 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const String& rFileName, const Strin
long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion )
{
- sal_Bool bInsert = sal_False, bCompare = sal_False, bMerge = sal_False;
+ sal_Bool bInsert = sal_False, bCompare = sal_False;
long nFound = 0;
SwDocShell* pDocSh = GetDocShell();
switch( nSlotId )
{
- case SID_DOCUMENT_MERGE: bMerge = sal_True; break;
+ case SID_DOCUMENT_MERGE: break;
case SID_DOCUMENT_COMPARE: bCompare = sal_True; break;
case SID_INSERTDOC: bInsert = sal_True; break;
default:
- ASSERT( !this, "Unbekannte SlotId!" );
+ OSL_ENSURE( !this, "unknown SlotId!" );
bInsert = sal_True;
nSlotId = SID_INSERTDOC;
break;
@@ -2109,7 +2035,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
else
{
::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
- nErrno = pDocSh->InsertFrom( *pMedium ) ? 0 : ERR_SWG_READ_ERROR;
+ nErrno = pDocSh->ImportFrom( *pMedium, true ) ? 0 : ERR_SWG_READ_ERROR;
}
}
@@ -2123,8 +2049,8 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
}
if( pDoc )
- { // Disable Undo for .sdw (136991) or
- // if the number of page styles with header/footer has changed (#i67305)
+ { // Disable Undo for .sdw or
+ // if the number of page styles with header/footer has changed
if( !pRead || nUndoCheck != lcl_PageDescWithHeader( *pDoc ) )
{
pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
@@ -2182,9 +2108,7 @@ extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLoc
delete pMedium;
return nFound;
}
-/* -----------------05.02.2003 12:06-----------------
- *
- * --------------------------------------------------*/
+
void SwView::EnableMailMerge(sal_Bool bEnable )
{
bInMailMerge = bEnable;
@@ -2192,8 +2116,7 @@ void SwView::EnableMailMerge(sal_Bool bEnable )
rBind.Invalidate(FN_INSERT_FIELD_DATA_ONLY);
rBind.Update(FN_INSERT_FIELD_DATA_ONLY);
}
-/*
-*/
+
namespace
{
sal_Bool lcl_NeedAdditionalDataSource( const uno::Reference< XNameAccess >& _rDatasourceContext )
@@ -2208,10 +2131,6 @@ namespace
}
}
-/* -----------------27.11.2002 12:12-----------------
- *
- * --------------------------------------------------*/
-
class SwMergeSourceWarningBox_Impl : public ModalDialog
{
FixedInfo aMessageFI;
@@ -2258,9 +2177,6 @@ class SwMergeSourceWarningBox_Impl : public ModalDialog
void SetMessText( const String& rText ) { aMessageFI.SetText( rText ); }
};
-
-
-
void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
{
if(bUseCurrentDocument)
@@ -2273,7 +2189,7 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
if( xMgr.is() )
{
uno::Reference<XInterface> xInstance = xMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.sdb.DatabaseContext" ));
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseContext")));
xDBContext = uno::Reference<XNameAccess>(xInstance, UNO_QUERY) ;
}
if(!xDBContext.is())
@@ -2294,11 +2210,11 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
{
//take an existing data source or create a new one?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg(
DLG_MERGE_FIELD_CONNECTIONS,
&GetViewFrame()->GetWindow());
- DBG_ASSERT(pConnectionsDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!");
if(RET_OK == pConnectionsDlg->Execute())
bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
else
@@ -2355,7 +2271,17 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
SwDBData aData;
SwWrtShell &rSh = GetWrtShell();
- aData = rSh.GetDBData();
+
+ SvStringsDtor aDBNameList(5, 1);
+ SvStringsDtor aAllDBNames(5, 5);
+ rSh.GetAllUsedDB( aDBNameList, &aAllDBNames );
+ if ( aDBNameList.Count( ) )
+ {
+ String sDBName = *aDBNameList[0];
+ aData.sDataSource = sDBName.GetToken(0, DB_DELIM);
+ aData.sCommand = sDBName.GetToken(1, DB_DELIM);
+ aData.nCommandType = sDBName.GetToken(2, DB_DELIM ).ToInt32();
+ }
rSh.EnterStdMode(); // Wechsel in Textshell erzwingen; ist fuer
// das Mischen von DB-Feldern notwendig.
AttrChangedNotify( &rSh );
@@ -2399,8 +2325,6 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
// after the destruction of the dialogue its parent comes to top,
// but we want that the new document is on top
pTopWin->ToTop();
-
-// return;
}
}
@@ -2454,3 +2378,4 @@ void SwView::ExecuteScan( SfxRequest& rReq )
pViewImpl->ExecuteScan(rReq) ;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewcoll.cxx b/sw/source/ui/uiview/viewcoll.cxx
index 853c5639348d..c619c9b8007b 100644
--- a/sw/source/ui/uiview/viewcoll.cxx
+++ b/sw/source/ui/uiview/viewcoll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,24 +29,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "cmdid.h"
#include "uiitems.hxx"
-#include <tools/list.hxx>
#include <vcl/window.hxx>
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/stritem.hxx>
#include <rsc/rscsfx.hxx>
-
-#include "errhdl.hxx"
#include "view.hxx"
#include "wrtsh.hxx"
#include "basesh.hxx"
-
void SwView::ExecColl(SfxRequest &rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -55,7 +50,7 @@ void SwView::ExecColl(SfxRequest &rReq)
{
case FN_SET_PAGE:
{
- DBG_ASSERT(!this, "Not implemented");
+ OSL_ENSURE(!this, "Not implemented");
}
break;
case FN_SET_PAGE_STYLE:
@@ -89,10 +84,11 @@ void SwView::ExecColl(SfxRequest &rReq)
}
break;
default:
- ASSERT(sal_False, falscher CommandProcessor fuer Dispatch);
+ OSL_FAIL("wrong CommandProcessor for Dispatch");
return;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewdlg.cxx b/sw/source/ui/uiview/viewdlg.cxx
index fa045a740b40..73bcb5078cad 100644
--- a/sw/source/ui/uiview/viewdlg.cxx
+++ b/sw/source/ui/uiview/viewdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "hintids.hxx"
#include <sfx2/viewfrm.hxx>
#include <editeng/tstpitem.hxx>
#include <svl/stritem.hxx>
#include <sfx2/request.hxx>
-
#include "view.hxx"
#include "wrtsh.hxx"
#include "basesh.hxx"
@@ -83,7 +81,7 @@ void SwView::ExecDlg(SfxRequest &rReq)
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
@@ -96,3 +94,4 @@ void SwView::ExecDlg(SfxRequest &rReq)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx
index 6a867b7e28a7..14a5d64b03d7 100644
--- a/sw/source/ui/uiview/viewdlg2.cxx
+++ b/sw/source/ui/uiview/viewdlg2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objface.hxx>
-
#include <fldmgr.hxx>
#include <expfld.hxx>
#include <modcfg.hxx>
@@ -60,10 +59,6 @@ extern String* pOldTabCat;
extern String* pOldFrmCat;
extern String* pOldDrwCat;
-/* -----------------06.11.98 13:45-------------------
- *
- * --------------------------------------------------*/
-
void SwView::ExecDlgExt(SfxRequest &rReq)
{
Window *pMDI = &GetViewFrame()->GetWindow();
@@ -73,10 +68,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq)
case FN_INSERT_CAPTION:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDialog = pFact->CreateSwCaptionDialog( pMDI, *this, DLG_CAPTION );
- DBG_ASSERT(pDialog, "Dialogdiet fail!");
+ OSL_ENSURE(pDialog, "Dialogdiet fail!");
if ( pDialog )
{
pDialog->Execute();
@@ -87,10 +82,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq)
case FN_EDIT_FOOTNOTE:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE,
pMDI, *pWrtShell, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->SetHelpId(GetStaticInterface()->GetSlot(FN_EDIT_FOOTNOTE)->GetCommand());
pDlg->SetText( SW_RESSTR(STR_EDIT_FOOTNOTE) );
@@ -101,10 +96,6 @@ void SwView::ExecDlgExt(SfxRequest &rReq)
}
}
-/* -----------------06.11.98 14:53-------------------
- *
- * --------------------------------------------------*/
-
void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId)
{
SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
@@ -118,10 +109,6 @@ void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId)
}
}
-/* -----------------06.11.98 12:58-------------------
- *
- * --------------------------------------------------*/
-
void SwView::InsertCaption(const InsCaptionOpt *pOpt)
{
if (!pOpt)
@@ -239,3 +226,4 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx
index 4250b8a4f0e8..87309088ffcf 100644
--- a/sw/source/ui/uiview/viewdraw.cxx
+++ b/sw/source/ui/uiview/viewdraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "hintids.hxx"
#include <svl/aeitem.hxx>
#include <svl/itempool.hxx>
@@ -73,19 +73,17 @@
#include "dselect.hxx"
#include "edtwin.hxx"
-// #108784#
#include <dcontact.hxx>
-// #108784#
#include <svx/svdpagv.hxx>
#include <svx/extrusionbar.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
+
/*--------------------------------------------------------------------
Beschreibung: Drawing-Ids ausfuehren
--------------------------------------------------------------------*/
-
void SwView::ExecDraw(SfxRequest& rReq)
{
const SfxItemSet *pArgs = rReq.GetArgs();
@@ -145,7 +143,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
if ( pFormView )
{
SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
- DBG_ASSERT( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
+ OSL_ENSURE( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
if( pDescriptorItem )
{
::svx::ODataAccessDescriptor aDescriptor( pDescriptorItem->GetValue() );
@@ -346,7 +344,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
break;
}
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 const aInval[] =
{
// Slot-Ids muessen beim Aufruf von Invalidate sortiert sein!
SID_ATTRIBUTES_AREA,
@@ -410,16 +408,13 @@ void SwView::ExecDraw(SfxRequest& rReq)
/*--------------------------------------------------------------------
Beschreibung: Drawing beenden
--------------------------------------------------------------------*/
-
-
-
void SwView::ExitDraw()
{
NoRotate();
if(pShell)
{
- //#126062 # the shell may be invalid at close/reload/SwitchToViewShell
+ // the shell may be invalid at close/reload/SwitchToViewShell
SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher();
sal_uInt16 nIdx = 0;
SfxShell* pTest = 0;
@@ -464,9 +459,6 @@ void SwView::ExitDraw()
/*--------------------------------------------------------------------
Beschreibung: Rotate-Mode abschalten
--------------------------------------------------------------------*/
-
-
-
void SwView::NoRotate()
{
if (IsDrawRotate())
@@ -482,14 +474,13 @@ void SwView::NoRotate()
/******************************************************************************
* Beschreibung: DrawTextEditMode einschalten
******************************************************************************/
-
sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
{
SdrObject* pObj;
SdrPageView* pPV;
SwWrtShell *pSh = &GetWrtShell();
SdrView *pSdrView = pSh->GetDrawView();
- ASSERT( pSdrView, "EnterDrawTextMode without DrawView?" );
+ OSL_ENSURE( pSdrView, "EnterDrawTextMode without DrawView?" );
sal_Bool bReturn = sal_False;
@@ -500,9 +491,7 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
!pSdrView->PickHandle( aDocPos ) && IsTextTool() &&
pSdrView->PickObj( aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKTEXTEDIT ) &&
- // #108784#
// To allow SwDrawVirtObj text objects to be activated, allow their type, too.
- //pObj->ISA( SdrTextObj ) &&
( pObj->ISA( SdrTextObj ) ||
( pObj->ISA(SwDrawVirtObj) &&
((SwDrawVirtObj*)pObj)->GetReferencedObj().ISA(SdrTextObj) ) ) &&
@@ -558,24 +547,18 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
if( bIsNewObj )
pOutliner->SetVertical( SID_DRAW_TEXT_VERTICAL == nDrawSfxId ||
SID_DRAW_CAPTION_VERTICAL == nDrawSfxId );
- // #i7672#
- // No longer necessary, see text below
- // Color aBackground(pSh->GetShapeBackgrd());
- // pOutliner->SetBackgroundColor(aBackground);
- // OD 09.12.2002 #103045# - set default horizontal text direction at outliner
+ // set default horizontal text direction at outliner
EEHorizontalTextDirection aDefHoriTextDir =
pSh->IsShapeDefaultHoriTextDirR2L() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R;
pOutliner->SetDefaultHorizontalTextDirection( aDefHoriTextDir );
}
- // #108784#
// To allow editing the referenced object from a SwDrawVirtObj here
// the original needs to be fetched evenually. This ATM activates the
// text edit mode for the original object.
SdrObject* pToBeActivated = pObj;
- // #108784#
// Always the original object is edited. To allow the TextEdit to happen
// where the VirtObj is positioned, on demand a occurring offset is set at
// the TextEdit object. That offset is used for creating and managing the
@@ -621,15 +604,12 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
/******************************************************************************
* Beschreibung: Ist ein DrawTextObjekt selektiert?
******************************************************************************/
-
-
-
sal_Bool SwView::IsTextTool() const
{
sal_uInt16 nId;
sal_uInt32 nInvent;
SdrView *pSdrView = GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "IsTextTool without DrawView?" );
+ OSL_ENSURE( pSdrView, "IsTextTool without DrawView?" );
if (pSdrView->IsCreateMode())
pSdrView->SetCreateMode(sal_False);
@@ -638,32 +618,16 @@ sal_Bool SwView::IsTextTool() const
return (nInvent==SdrInventor);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SdrView* SwView::GetDrawView() const
{
return GetWrtShell().GetDrawView();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
sal_Bool SwView::IsBezierEditMode()
{
return (!IsDrawSelMode() && GetWrtShell().GetDrawView()->HasMarkablePoints());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwView::IsFormMode() const
{
if (GetDrawFuncPtr() && GetDrawFuncPtr()->IsCreateObj())
@@ -674,12 +638,6 @@ sal_Bool SwView::IsFormMode() const
return AreOnlyFormsSelected();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr)
{
if (pDrawActual)
@@ -687,20 +645,12 @@ void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr)
pDrawActual = pFuncPtr;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwView::SetSelDrawSlot()
{
nDrawSfxId = SID_OBJECT_SELECT;
sDrawCustom.Erase();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwView::AreOnlyFormsSelected() const
{
if ( GetWrtShell().IsFrmSelected() )
@@ -733,10 +683,6 @@ sal_Bool SwView::AreOnlyFormsSelected() const
return bForm;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwView::HasDrwObj(SdrObject *pSdrObj) const
{
sal_Bool bRet = sal_False;
@@ -756,10 +702,6 @@ sal_Bool SwView::HasDrwObj(SdrObject *pSdrObj) const
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const
{
sal_Bool bRet = sal_False;
@@ -779,7 +721,6 @@ sal_Bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const
return bRet;
}
-
//#i87414# mod
IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
{
@@ -788,9 +729,6 @@ IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
sal_Bool SwView::ExecDrwTxtSpellPopup(const Point& rPt)
{
sal_Bool bRet = sal_False;
@@ -807,12 +745,6 @@ sal_Bool SwView::ExecDrwTxtSpellPopup(const Point& rPt)
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
sal_Bool SwView::IsDrawTextHyphenate()
{
SdrView *pSdrView = pWrtShell->GetDrawView();
@@ -828,12 +760,6 @@ sal_Bool SwView::IsDrawTextHyphenate()
return bHyphenate;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
void SwView::HyphenateDrawText()
{
SdrView *pSdrView = pWrtShell->GetDrawView();
@@ -845,5 +771,4 @@ void SwView::HyphenateDrawText()
GetViewFrame()->GetBindings().Invalidate(FN_HYPHENATE_OPT_DLG);
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewfunc.hxx b/sw/source/ui/uiview/viewfunc.hxx
index 2ac704db114f..61ffcd735375 100644
--- a/sw/source/ui/uiview/viewfunc.hxx
+++ b/sw/source/ui/uiview/viewfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ void ViewResizePixel( const Window &rRef,
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index 4414a96cdf72..ae86b4de27e1 100755..100644
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,8 +115,6 @@ using namespace ::com::sun::star::smarttags;
/*--------------------------------------------------------------------
Beschreibung: Lingu-Dispatcher
--------------------------------------------------------------------*/
-
-
void SwView::ExecLingu(SfxRequest &rReq)
{
switch(rReq.GetSlot())
@@ -140,7 +139,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
{
Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog")
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog"))
, xContext), UNO_QUERY);
Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
if( xInit.is() )
@@ -150,7 +149,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
Sequence<Any> aSeq(1);
Any* pArray = aSeq.getArray();
PropertyValue aParam;
- aParam.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam.Value <<= makeAny(xDialogParentWindow);
pArray[0] <<= makeAny(aParam);
xInit->initialize( aSeq );
@@ -210,7 +209,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
{
SwTxtNode *pTxtNode = aPointNodeIndex.GetNode().GetTxtNode();
// check for unexpected error case
- DBG_ASSERT( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex,
+ OSL_ENSURE( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex,
"text missing: corrupted node?" );
if (!pTxtNode || pTxtNode->GetTxt().Len() < nPointIndex)
nPointIndex = 0;
@@ -233,7 +232,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
HyphenateDocument();
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong Dispatcher");
return;
}
}
@@ -241,7 +240,6 @@ void SwView::ExecLingu(SfxRequest &rReq)
/*--------------------------------------------------------------------
Description: start language specific text conversion
--------------------------------------------------------------------*/
-
void SwView::StartTextConversion(
LanguageType nSourceLang,
LanguageType nTargetLang,
@@ -287,7 +285,6 @@ void SwView::StartTextConversion(
/*--------------------------------------------------------------------
spellcheck and text conversion related stuff
--------------------------------------------------------------------*/
-
void SwView::SpellStart( SvxSpellArea eWhich,
sal_Bool bStartDone, sal_Bool bEndDone,
SwConversionArgs *pConvArgs )
@@ -342,7 +339,7 @@ void SwView::SpellStart( SvxSpellArea eWhich,
}
break;
default:
- ASSERT( !this, "SpellStart with unknown Area" );
+ OSL_ENSURE( !this, "SpellStart with unknown Area" );
}
pWrtShell->SpellStart( eStart, eEnde, eCurr, pConvArgs );
}
@@ -350,8 +347,6 @@ void SwView::SpellStart( SvxSpellArea eWhich,
/*--------------------------------------------------------------------
Beschreibung: Fehlermeldung beim Spelling
--------------------------------------------------------------------*/
-
-
// Der uebergebene Pointer nLang ist selbst der Wert
IMPL_LINK( SwView, SpellError, LanguageType *, pLang )
{
@@ -415,8 +410,6 @@ IMPL_LINK( SwView, SpellError, LanguageType *, pLang )
/*--------------------------------------------------------------------
Beschreibung: Spelling beenden und Cursor wiederherstellen
--------------------------------------------------------------------*/
-
-
void SwView::SpellEnd( SwConversionArgs *pConvArgs )
{
pWrtShell->SpellEnd( pConvArgs );
@@ -424,7 +417,6 @@ void SwView::SpellEnd( SwConversionArgs *pConvArgs )
pWrtShell->SetMark();
}
-
void SwView::HyphStart( SvxSpellArea eWhich )
{
switch ( eWhich )
@@ -442,15 +434,13 @@ void SwView::HyphStart( SvxSpellArea eWhich )
pWrtShell->HyphStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND );
break;
default:
- ASSERT( !this, "HyphStart with unknown Area" );
+ OSL_ENSURE( !this, "HyphStart with unknown Area" );
}
}
/*--------------------------------------------------------------------
Beschreibung: Interaktive Trennung
--------------------------------------------------------------------*/
-
-
void SwView::HyphenateDocument()
{
// do not hyphenate if interactive hyphenationg is active elsewhere
@@ -523,9 +513,6 @@ void SwView::HyphenateDocument()
}
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
-
bool SwView::IsValidSelectionForThesaurus() const
{
// must not be a multi-selection, and if it is a selection it needs
@@ -536,13 +523,11 @@ bool SwView::IsValidSelectionForThesaurus() const
return !bMultiSel && (!bSelection || pWrtShell->IsSelOnePara() );
}
-
String SwView::GetThesaurusLookUpText( bool bSelection ) const
{
return bSelection ? pWrtShell->GetSelTxt() : pWrtShell->GetCurWord();
}
-
void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bSelection )
{
sal_Bool bOldIns = pWrtShell->IsInsMode();
@@ -574,8 +559,8 @@ void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rL
// adjust existing selection
SwPaM *pCrsr = pWrtShell->GetCrsr();
- pCrsr->GetPoint()->nContent/*.nIndex*/ -= nRight;
- pCrsr->GetMark()->nContent/*.nIndex*/ += nLeft;
+ pCrsr->GetPoint()->nContent -= nRight;
+ pCrsr->GetMark()->nContent += nLeft;
}
pWrtShell->Insert( rSynonmText );
@@ -586,12 +571,9 @@ void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rL
pWrtShell->SetInsMode( bOldIns );
}
-
/*--------------------------------------------------------------------
Beschreibung: Thesaurus starten
--------------------------------------------------------------------*/
-
-
void SwView::StartThesaurus()
{
if (!IsValidSelectionForThesaurus())
@@ -648,7 +630,6 @@ void SwView::StartThesaurus()
/*--------------------------------------------------------------------
Beschreibung: Online-Vorschlaege anbieten
*--------------------------------------------------------------------*/
-
//!! Start of extra code for context menu modifying extensions
struct ExecuteInfo
{
@@ -704,13 +685,13 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
// default context menu.
bool bUseGrammarContext = false;
Reference< XSpellAlternatives > xAlt( pWrtShell->GetCorrection(&rPt, aToFill) );
- /*linguistic2::*/ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorPosInText = -1;
+ ProofreadingResult aGrammarCheckRes;
sal_Int32 nErrorInResult = -1;
uno::Sequence< rtl::OUString > aSuggestions;
bool bCorrectionRes = false;
if (!xAlt.is() || xAlt->getAlternatives().getLength() == 0)
{
+ sal_Int32 nErrorPosInText = -1;
bCorrectionRes = pWrtShell->GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, &rPt, aToFill );
::rtl::OUString aMessageText;
if (nErrorInResult >= 0)
@@ -734,7 +715,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
aParaText = pNode->GetTxt(); // this may include hidden text but that should be Ok
else
{
- DBG_ERROR( "text node expected but not found" );
+ OSL_FAIL("text node expected but not found" );
}
bRet = sal_True;
@@ -756,8 +737,8 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
aEvent.ExecutePosition.Y = aPixPos.Y();
Menu* pMenu = 0;
- ::rtl::OUString sMenuName = ::rtl::OUString::createFromAscii(
- bUseGrammarContext ? "private:resource/GrammarContextMenu" : "private:resource/SpellContextMenu");
+ ::rtl::OUString sMenuName = bUseGrammarContext ?
+ OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/GrammarContextMenu")) : OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/SpellContextMenu"));
if(TryContextMenuInterception( *pPopup, sMenuName, pMenu, aEvent ))
{
@@ -833,7 +814,6 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
This function shows the popup menu for smarttag
actions.
*/
-
sal_Bool SwView::ExecSmartTagPopup( const Point& rPt )
{
sal_Bool bRet = sal_False;
@@ -864,58 +844,32 @@ sal_Bool SwView::ExecSmartTagPopup( const Point& rPt )
return bRet;
}
-
-
-class SwFieldPopup : public PopupMenu
-{
-public:
- SwFieldPopup() {
- InsertItem(1, ::rtl::OUString::createFromAscii("Hello"));
- }
-};
-
-class SwFieldListBox : public ListBox
-{
-public:
- SwFieldListBox(Window* pParent) : ListBox(pParent /*, WB_DROPDOWN*/) {
- }
-
- void *GetImplWin() {
- return NULL; //FIXME!!!
-// return mpImplWin;
- }
-
-protected:
- virtual void LoseFocus() {
-// printf("ListBox: lose focus!!\n");
- ListBox::LoseFocus();
- }
-
- virtual void Select() {
-// printf("SELECT!!! IsTravelSelect=%i\n", IsTravelSelect());
- ListBox::Select();
- }
-};
-
-class SwFieldDialog : public Dialog
+class SwFieldDialog : public FloatingWindow
{
private:
- SwFieldListBox aListBox;
- Edit aText;
- int selection;
+ ListBox aListBox;
+ IFieldmark *pFieldmark;
DECL_LINK( MyListBoxHandler, ListBox * );
public:
- SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) {
+ SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM );
+};
- assert(fieldBM!=NULL);
- if (fieldBM!=NULL) {
+SwFieldDialog::SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ) :
+ FloatingWindow( parent, WB_BORDER | WB_SYSTEMWINDOW ),
+ aListBox(this),
+ pFieldmark( fieldBM )
+{
+ if ( fieldBM != NULL )
+ {
const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters();
- IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY));
+
+ rtl::OUString sListKey = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_LISTENTRY ) );
+ IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find( sListKey );
if(pListEntries != pParameters->end())
{
- Sequence< ::rtl::OUString> vListEntries;
+ Sequence< ::rtl::OUString > vListEntries;
pListEntries->second >>= vListEntries;
for( ::rtl::OUString* pCurrent = vListEntries.getArray();
pCurrent != vListEntries.getArray() + vListEntries.getLength();
@@ -924,82 +878,68 @@ public:
aListBox.InsertEntry(*pCurrent);
}
}
+
+ // Select the current one
+ rtl::OUString sResultKey = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_RESULT ) );
+ IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find( sResultKey );
+ if ( pResult != pParameters->end() )
+ {
+ sal_Int32 nSelection = -1;
+ pResult->second >>= nSelection;
+ aListBox.SelectEntryPos( nSelection );
+ }
}
+
Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED);
lbSize.Width()+=50;
lbSize.Height()+=20;
aListBox.SetSizePixel(lbSize);
aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) );
aListBox.Show();
- aText.SetText(rtl::OUString::createFromAscii("Cancel"));
- Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED);
- aText.SetSizePixel(Size(lbSize.Width(), tSize.Height()));
- aText.SetPosPixel(Point(0, lbSize.Height()));
- aText.Show();
- SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height()));
-// SetSizePixel(Size(200, 200));
- }
- int getSelection() {
- return selection;
- }
-protected:
- /*
- virtual void LoseFocus() {
- printf("lose focus!!\n");
- Dialog::LoseFocus();
- printf("close:\n");
- EndDialog(8);
- }
- */
-
- virtual long PreNotify( NotifyEvent& rNEvt ) {
- if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) {
- EndDialog(8);
- return 1;
- }
- if (rNEvt.GetType() == EVENT_KEYINPUT) {
-// printf("PreNotify::KEYINPUT\n");
- }
- return Dialog::PreNotify(rNEvt);
- }
-};
+ SetSizePixel( lbSize );
+}
IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox )
{
-// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect());
- if (pBox->IsTravelSelect()) {
- return 0;
- } else {
- this->selection=pBox->GetSelectEntryPos();
- EndDialog(9); //@TODO have meaningfull returns...
- return 1;
+ short res = 0;
+ if ( !pBox->IsTravelSelect() )
+ {
+ sal_Int32 selection = pBox->GetSelectEntryPos();
+ if ( selection >= 0 )
+ {
+ rtl::OUString sKey = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_RESULT ) );
+ (*pFieldmark->GetParameters())[ sKey ] = makeAny(selection);
+ pFieldmark->Invalidate();
+ SwView& rView = ( ( SwEditWin* )GetParent() )->GetView();
+ rView.GetDocShell()->SetModified( sal_True );
+ }
+
+ EndPopupMode();
+ res = 1;
}
+ return res;
}
-
-sal_Bool SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
+IMPL_LINK( SwView, FieldPopupModeEndHdl, FloatingWindow*, EMPTYARG )
{
- sal_Bool bRet = sal_False;
- const sal_Bool bOldViewLock = pWrtShell->IsViewLocked();
- pWrtShell->LockView( sal_True );
- pWrtShell->Push();
+ if ( mpFieldPopup )
+ {
+ delete mpFieldPopup;
+ mpFieldPopup = NULL;
+ }
+ return 0;
+}
- bRet=sal_True;
+void SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
+{
const Point aPixPos = GetEditWin().LogicToPixel( rPt );
- SwFieldDialog aFldDlg(pEditWin, fieldBM);
- aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos));
-
- /*short ret=*/aFldDlg.Execute();
- sal_Int32 selection=aFldDlg.getSelection();
- if (selection>=0) {
- (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection);
- }
+ mpFieldPopup = new SwFieldDialog( pEditWin, fieldBM );
+ mpFieldPopup->SetPopupModeEndHdl( LINK( this, SwView, FieldPopupModeEndHdl ) );
- pWrtShell->Pop( sal_False );
- pWrtShell->LockView( bOldViewLock );
-
- return bRet;
+ Rectangle aRect( pEditWin->OutputToScreenPixel( aPixPos ), Size( 0, 0 ) );
+ mpFieldPopup->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx
index 84bce4002f11..fbf5c6d3249a 100644
--- a/sw/source/ui/uiview/viewmdi.cxx
+++ b/sw/source/ui/uiview/viewmdi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <string>
#include "hintids.hxx"
#include <vcl/svapp.hxx>
@@ -40,18 +39,12 @@
#include <svl/srchitem.hxx>
#include <sfx2/request.hxx>
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <viewopt.hxx>
#include <frmatr.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
#include <uitool.hxx>
#include <edtwin.hxx>
#include <pagedesc.hxx>
@@ -60,25 +53,13 @@
#include <workctrl.hxx>
#include <usrpref.hxx>
#include <scroll.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _VIEW_HRC
#include <view.hrc>
-#endif
-#ifndef _RIBBAR_HRC
#include <ribbar.hrc>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <IDocumentSettingAccess.hxx>
#include <PostItMgr.hxx>
@@ -142,15 +123,9 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
if( SVX_ZOOM_OPTIMAL == eZoomType )
{
- if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
- {
- lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
- }
- else
- {
+ if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes())
aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 );
- lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
- }
+ lLeftMargin = long(rLRSpace.GetLeft()) + DOCUMENTBORDER + nLeftOfst;
nFac = aWindowSize.Width() * 100 / aPageSize.Width();
}
else if(SVX_ZOOM_WHOLEPAGE == eZoomType || SVX_ZOOM_PAGEWIDTH == eZoomType )
@@ -167,7 +142,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
nFac = Min( nFac, nVisPercent );
}
}
- else /*if( SVX_ZOOM_PAGEWIDTH_NOBORDER == eZoomType )*/
+ else
{
const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
nFac = aWindowSize.Width() * 100 / nTmpWidth;
@@ -239,15 +214,6 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
pWrtShell->UnlockPaint();
if( bUnLockView )
pWrtShell->LockView( sal_False );
-
-// if ( mpPostItMgr )
-// {
-// mpPostItMgr->Rescale();
-// mpPostItMgr->CalcRects();
-// mpPostItMgr->LayoutPostIts();
-// }
-
-// eZoom = eZoomType;
}
void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly )
@@ -307,13 +273,41 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewO
/*
* Scrollbar - Handler
*/
+IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent )
+{
+ OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+ if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ {
+ VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
+ OSL_ENSURE( pVclEvent->GetWindow(), "Window???" );
+ Window* pChildWin = static_cast< Window* >( pVclEvent->GetData() );
+
+ switch ( pVclEvent->GetId() )
+ {
+ case VCLEVENT_WINDOW_HIDE:
+ if( pChildWin == pHScrollbar )
+ ShowHScrollbar( sal_False );
+ else if( pChildWin == pVScrollbar )
+ ShowVScrollbar( sal_False );
+ break;
+ case VCLEVENT_WINDOW_SHOW:
+ if( pChildWin == pHScrollbar )
+ ShowHScrollbar( sal_True );
+ else if( pChildWin == pVScrollbar )
+ ShowVScrollbar( sal_True );
+ break;
+ }
+ }
+
+ return 0;
+}
int SwView::_CreateScrollbar( sal_Bool bHori )
{
Window *pMDI = &GetViewFrame()->GetWindow();
SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
- ASSERT( !*ppScrollbar, "vorher abpruefen!" )
+ OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" );
if( !bHori )
CreatePageButtons( !bShowAtResize );
@@ -328,6 +322,8 @@ int SwView::_CreateScrollbar( sal_Bool bHori )
(*ppScrollbar)->EnableDrag( sal_True );
+ (*ppScrollbar)->SetAuto( sal_True );
+
if(GetWindow())
InvalidateBorder();
@@ -376,9 +372,7 @@ IMPL_LINK( SwView, BtnPage, Button *, pButton )
Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext );
return 0;
}
-/*-----------------20.06.97 10:46-------------------
---------------------------------------------------*/
IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
{
if ( !pbNext )
@@ -528,16 +522,6 @@ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
return 0;
}
-/*************************************************************************
-|*
-|* SwView::CreateTab()
-|*
-|* Beschreibung
-|* Ersterstellung VB 29.05.91
-|* Letzte Aenderung OS 09.05.96
-|*
-*************************************************************************/
-
int SwView::CreateTab()
{
pHRuler->SetActive(GetFrame() && IsActive());
@@ -547,16 +531,6 @@ int SwView::CreateTab()
return 1;
}
-/*************************************************************************
-|*
-|* SwView::KillTab()
-|*
-|* Beschreibung
-|* Ersterstellung VB 29.05.91
-|* Letzte Aenderung OS 09.05.96
-|*
-*************************************************************************/
-
int SwView::KillTab()
{
pHRuler->Hide();
@@ -581,28 +555,16 @@ void SwView::ChangeVLinealMetric( FieldUnit eUnit )
pVRuler->Invalidate();
}
}
-/* -----------------------------07.04.01 17:09--------------------------------
- ---------------------------------------------------------------------------*/
void SwView::GetVLinealMetric(FieldUnit& eToFill) const
{
eToFill = pVRuler->GetUnit();
}
-/* -----------------------------07.04.01 17:09--------------------------------
- ---------------------------------------------------------------------------*/
void SwView::GetHLinealMetric(FieldUnit& eToFill) const
{
eToFill = pHRuler->GetUnit();
}
-/*************************************************************************
-|*
-|* SwView::CreateVLineal()
-|*
-|* Beschreibung
-|* Ersterstellung VB 29.05.91
-|*
-*************************************************************************/
int SwView::CreateVLineal()
{
@@ -614,15 +576,6 @@ int SwView::CreateVLineal()
return 1;
}
-/*************************************************************************
-|*
-|* SwView::KillVLineal()
-|*
-|* Beschreibung
-|* Ersterstellung VB 29.05.91
-|*
-*************************************************************************/
-
int SwView::KillVLineal()
{
pVRuler->Hide();
@@ -630,15 +583,6 @@ int SwView::KillVLineal()
InvalidateBorder();
return 1;
}
-/*************************************************************************
-|*
-|* SwView::ExecRulerClick()
-|*
-|* Beschreibung
-|* Ersterstellung OS 15.06.95
-|* Letzte Aenderung
-|*
-*************************************************************************/
IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler )
{
@@ -664,18 +608,10 @@ IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler )
return 0;
}
-
-/*-----------------20.02.97 09:11-------------------
-
---------------------------------------------------*/
-
sal_uInt16 SwView::GetMoveType()
{
return nMoveType;
}
-/*-----------------20.02.97 09:11-------------------
-
---------------------------------------------------*/
void SwView::SetMoveType(sal_uInt16 nSet)
{
@@ -695,18 +631,11 @@ void SwView::SetMoveType(sal_uInt16 nSet)
}
}
-/*-----------------20.06.97 11:18-------------------
-
---------------------------------------------------*/
void SwView::SetActMark(sal_Int32 nSet)
{
nActMark = nSet;
}
-/*-----------------15.03.97 10:53-------------------
-
---------------------------------------------------*/
-
void SwView::SetImageButtonColor(Color& rColor)
{
if(pPageUpBtn)
@@ -715,40 +644,33 @@ void SwView::SetImageButtonColor(Color& rColor)
pPageDownBtn->SetControlForeground(rColor);
}
}
-/* -----------------------------2002/06/26 13:57------------------------------
- ---------------------------------------------------------------------------*/
void SwView::ShowHScrollbar(sal_Bool bShow)
{
- DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
+ OSL_ENSURE(pHScrollbar, "Scrollbar invalid");
pHScrollbar->ExtendedShow(bShow);
}
-/* -----------------------------2002/06/26 13:57------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwView::IsHScrollbarVisible()const
{
- DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
+ OSL_ENSURE(pHScrollbar, "Scrollbar invalid");
return pHScrollbar->IsVisible( sal_False ) || pHScrollbar->IsAuto();
}
-/* -----------------------------2002/06/26 13:57------------------------------
- ---------------------------------------------------------------------------*/
void SwView::ShowVScrollbar(sal_Bool bShow)
{
- DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
+ OSL_ENSURE(pVScrollbar, "Scrollbar invalid");
pVScrollbar->ExtendedShow(bShow);
pPageUpBtn->Show(bShow);
pPageDownBtn->Show(bShow);
pNaviBtn->Show(bShow);
}
-/* -----------------------------2002/06/26 13:57------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwView::IsVScrollbarVisible()const
{
- DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
+ OSL_ENSURE(pVScrollbar, "Scrollbar invalid");
return pVScrollbar->IsVisible( sal_False );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index ab8853ab5637..656fe9121487 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,31 +29,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "hintids.hxx"
#include <vcl/help.hxx>
#include <svx/ruler.hxx>
#include <editeng/paperinf.hxx>
#include <editeng/lrspitem.hxx>
#include <sfx2/bindings.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <swmodule.hxx>
#include <viewopt.hxx>
#include <frmatr.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <edtwin.hxx>
#include <scroll.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
#include <usrpref.hxx>
#include <pagedesc.hxx>
#include <workctrl.hxx>
@@ -88,8 +80,6 @@ inline long GetLeftMargin( SwView &rView )
lRet + DOCUMENTBORDER + nLeftOfst;
}
-//-------------------------------------------------------------------------
-
void lcl_GetPos(SwView* pView,
Point& rPos,
SwScrollbar* pScrollbar,
@@ -107,8 +97,8 @@ void lcl_GetPos(SwView* pView,
long lDelta = lPos - rSh.VisArea().Pos().*pPt;
const long lSize = aDocSz.*pSz + lBorder;
- // Bug 11693: sollte rechts oder unten zuviel Wiese sein, dann muss
- // diese von der VisArea herausgerechnet werden!
+ // sollte rechts oder unten zuviel Wiese sein, dann muss
+ // diese von der VisArea herausgerechnet werden!
long nTmp = pView->GetVisArea().Right()+lDelta;
if ( bHori && nTmp > lSize )
lDelta -= nTmp - lSize;
@@ -124,10 +114,9 @@ void lcl_GetPos(SwView* pView,
/*--------------------------------------------------------------------
Beschreibung: Nullpunkt Lineal setzen
--------------------------------------------------------------------*/
-
void SwView::InvalidateRulerPos()
{
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_PARA_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS,
SID_RULER_LR_MIN_MAX, SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
@@ -140,7 +129,7 @@ void SwView::InvalidateRulerPos()
GetViewFrame()->GetBindings().Invalidate(aInval);
- DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+ OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?");
pHRuler->ForceUpdate();
pVRuler->ForceUpdate();
}
@@ -150,7 +139,6 @@ void SwView::InvalidateRulerPos()
viertel Bildschirm bis vor das Ende des Dokumentes
gescrollt werden kann.
--------------------------------------------------------------------*/
-
long SwView::SetHScrollMax( long lMax )
{
const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
@@ -161,7 +149,6 @@ long SwView::SetHScrollMax( long lMax )
return Max( Min( lMax, lSize ), 0L );
}
-
long SwView::SetVScrollMax( long lMax )
{
const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
@@ -169,7 +156,6 @@ long SwView::SetVScrollMax( long lMax )
return Max( Min( lMax, lSize), 0L ); // siehe horz.
}
-
Point SwView::AlignToPixel(const Point &rPt) const
{
return GetEditWin().PixelToLogic( GetEditWin().LogicToPixel( rPt ) );
@@ -178,7 +164,6 @@ Point SwView::AlignToPixel(const Point &rPt) const
/*--------------------------------------------------------------------
Beschreibung: Dokumentgroesse hat sich geaendert
--------------------------------------------------------------------*/
-
void SwView::DocSzChgd(const Size &rSz)
{
@@ -229,7 +214,6 @@ aDocSz = rSz;
/*--------------------------------------------------------------------
Beschreibung: Visarea neu setzen
--------------------------------------------------------------------*/
-
void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar )
{
const Size aOldSz( aVisArea.GetSize() );
@@ -323,7 +307,6 @@ void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar )
/*--------------------------------------------------------------------
Beschreibung: Pos VisArea setzen
--------------------------------------------------------------------*/
-
void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar )
{
//einmal alignen, damit Brushes korrekt angesetzt werden.
@@ -351,7 +334,6 @@ void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar )
bUpdateScrollbar);
}
-
void SwView::CheckVisArea()
{
pHScrollbar->SetAuto( pWrtShell->GetViewOptions()->getBrowseMode() &&
@@ -379,7 +361,6 @@ void SwView::CheckVisArea()
sal_uInt16 nRange optional exakte Angabe des Bereiches,
um den ggfs. gescrollt werden soll
--------------------------------------------------------------------*/
-
void SwView::CalcPt( Point *pPt, const Rectangle &rRect,
sal_uInt16 nRangeX, sal_uInt16 nRangeY)
{
@@ -427,13 +408,11 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect,
/*--------------------------------------------------------------------
Beschreibung: Scrolling
--------------------------------------------------------------------*/
-
sal_Bool SwView::IsScroll( const Rectangle &rRect ) const
{
return bCenterCrsr || bTopCrsr || !aVisArea.IsInside(rRect);
}
-
void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY )
{
if ( aVisArea.IsEmpty() )
@@ -560,7 +539,6 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan
Beschreibung: Seitenweises Scrollen
Liefern den Wert, um den bei PageUp / -Down gescrollt werden soll
--------------------------------------------------------------------*/
-
sal_Bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const
{
if ( !aVisArea.Top() || !aVisArea.GetHeight() )
@@ -575,7 +553,6 @@ sal_Bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const
return sal_True;
}
-
sal_Bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const
{
if ( !aVisArea.GetHeight() ||
@@ -593,7 +570,6 @@ sal_Bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const
}
// Seitenweises Blaettern
-
long SwView::PageUp()
{
if (!aVisArea.GetHeight())
@@ -606,7 +582,6 @@ long SwView::PageUp()
return 1;
}
-
long SwView::PageDown()
{
if ( !aVisArea.GetHeight() )
@@ -618,7 +593,6 @@ long SwView::PageDown()
return 1;
}
-
long SwView::PhyPageUp()
{
//aktuell sichtbare Seite erfragen, nicht formatieren
@@ -639,7 +613,6 @@ long SwView::PhyPageUp()
return 1;
}
-
long SwView::PhyPageDown()
{
//aktuell sichtbare Seite erfragen, nicht formatieren
@@ -659,7 +632,6 @@ long SwView::PhyPageDown()
return 1;
}
-
long SwView::PageUpCrsr( sal_Bool bSelect )
{
if ( !bSelect )
@@ -686,7 +658,6 @@ long SwView::PageUpCrsr( sal_Bool bSelect )
return sal_False;
}
-
long SwView::PageDownCrsr(sal_Bool bSelect)
{
SwTwips lOff = 0;
@@ -704,7 +675,6 @@ long SwView::PageDownCrsr(sal_Bool bSelect)
/*------------------------------------------------------------------------
Beschreibung: Handler der Scrollbars
------------------------------------------------------------------------*/
-
IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
{
if ( GetWrtShell().ActionPend() )
@@ -717,8 +687,8 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
pScrollbar->GetType() == SCROLL_DRAG)
{
//Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist.
- // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
- // so we dont must do it agin.
+ // the end scrollhandler invalidate the FN_STAT_PAGE,
+ // so we dont must do it agin.
EndScrollHdl(pScrollbar);
Point aPos( aVisArea.TopLeft() );
@@ -730,10 +700,6 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
String sDisplay;
if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
{
- // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
- // so we dont must do it agin.
-// if(!GetViewFrame()->GetFrame().IsInPlace())
-// S F X_BINDINGS().Update(FN_STAT_PAGE);
//QuickHelp:
if( pWrtShell->GetPageCnt() > 1 && Help::IsQuickHelpEnabled() )
@@ -775,10 +741,10 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
return 0;
}
+
/*------------------------------------------------------------------------
Beschreibung: Handler der Scrollbars
------------------------------------------------------------------------*/
-
IMPL_LINK( SwView, EndScrollHdl, SwScrollbar *, pScrollbar )
{
if ( !GetWrtShell().ActionPend() )
@@ -803,12 +769,9 @@ IMPL_LINK( SwView, EndScrollHdl, SwScrollbar *, pScrollbar )
/*--------------------------------------------------------------------
Beschreibung:
-
berechnet die Groesse von aVisArea abhaengig von der Groesse
des EditWin auf dem Schirm.
-
--------------------------------------------------------------------*/
-
void SwView::CalcVisArea( const Size &rOutPixel )
{
Point aTopLeft;
@@ -852,8 +815,6 @@ void SwView::CalcVisArea( const Size &rOutPixel )
/*--------------------------------------------------------------------
Beschreibung: Bedienelemente neu anordnen
--------------------------------------------------------------------*/
-
-
void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
{
sal_Bool bRightVRuler = pWrtShell->GetViewOptions()->IsVRulerRight();
@@ -866,7 +827,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
rToFill.Left() = nWidth;
}
- DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+ OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?");
if ( pHRuler->IsVisible() )
rToFill.Top() = pHRuler->GetSizePixel().Height();
@@ -887,7 +848,6 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
SetBorderPixel( rToFill );
}
-
void ViewResizePixel( const Window &rRef,
const Point &rOfst,
const Size &rSize,
@@ -946,7 +906,7 @@ void ViewResizePixel( const Window &rRef,
if(!aSize.Height())
aSize.Height() = pHLineal->GetSizePixel().Height();
pHLineal->SetPosSizePixel( rOfst, aSize );
-// #46802 VCL ruft an unsichtbaren Fenstern kein Resize
+// VCL ruft an unsichtbaren Fenstern kein Resize
// fuer das Lineal ist das aber keine gute Idee
if(!pHLineal->IsVisible())
pHLineal->Resize();
@@ -984,7 +944,7 @@ void ViewResizePixel( const Window &rRef,
Size aImgSz( nVBSzWidth, nVBSzWidth );
- //#55949# wenn der Platz fuer Scrollbar und Page-Buttons zu klein wird, dann
+ // wenn der Platz fuer Scrollbar und Page-Buttons zu klein wird, dann
// werden die Buttons versteckt
sal_uInt16 nCnt = pNaviBtn ? 3 : 2;
long nSubSize = (aImgSz.Width() * nCnt );
@@ -1021,7 +981,6 @@ void ViewResizePixel( const Window &rRef,
}
}
-
void SwView::ShowAtResize()
{
bShowAtResize = sal_False;
@@ -1029,7 +988,6 @@ void SwView::ShowAtResize()
pHRuler->Show();
}
-
void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize )
{
Size aObjSize = GetObjectShell()->GetVisArea().GetSize();
@@ -1112,10 +1070,9 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize )
bInInnerResizePixel = sal_False;
}
-
void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
- // FME 22.08.2003 #i16909# - return, if no size (caused by minimize window).
+ // #i16909# return, if no size (caused by minimize window).
if ( bInOuterResizePixel || ( !rSize.Width() && !rSize.Height() ) )
return;
bInOuterResizePixel = sal_True;
@@ -1135,6 +1092,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
bShowH = pVOpt->IsViewHScrollBar();
bShowV = pVOpt->IsViewVScrollBar();
+ bAuto = bHAuto = sal_True;
break;
}
}
@@ -1156,10 +1114,10 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
bShowH = bShowV = bHAuto = bAuto = sal_False;
}
- if(pHScrollbar->IsVisible(sal_False) != bShowH)
+ if(pHScrollbar->IsVisible(sal_False) != bShowH && !bHAuto)
ShowHScrollbar(bShowH);
pHScrollbar->SetAuto( bHAuto );
- if(pVScrollbar->IsVisible(sal_False) != bShowV)
+ if(pVScrollbar->IsVisible(sal_False) != bShowV && !bAuto)
ShowVScrollbar(bShowV);
pVScrollbar->SetAuto(bAuto);
@@ -1194,7 +1152,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
//nicht mehr zum aktuell sichtbaren Bereich passen
pWrtShell->ResetCursorStack();
- ASSERT( !GetEditWin().IsVisible() ||
+ OSL_ENSURE( !GetEditWin().IsVisible() ||
(( aEditSz.Width() > 0 && aEditSz.Height() > 0 )
|| !aVisArea.IsEmpty()), "Small world, isn't it?" );
@@ -1259,7 +1217,6 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
}
}
-
void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
{
const Fraction &rFrac = rX < rY ? rX : rY;
@@ -1270,7 +1227,6 @@ void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
SfxViewShell::SetZoomFactor( rX, rY );
}
-
Size SwView::GetOptimalSizePixel() const
{
Size aPgSize;
@@ -1292,7 +1248,6 @@ Size SwView::GetOptimalSizePixel() const
return GetEditWin().LogicToPixel( aPgSize );
}
-
sal_Bool SwView::UpdateScrollbars()
{
sal_Bool bRet = sal_False;
@@ -1341,11 +1296,10 @@ sal_Bool SwView::UpdateScrollbars()
return bRet;
}
-
void SwView::Move()
{
if ( GetWrtShell().IsInSelect() )
- GetWrtShell().EndSelect(); //#32427#
+ GetWrtShell().EndSelect();
SfxViewShell::Move();
}
@@ -1381,4 +1335,4 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
return bOk;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 4ba284987091..0459611cb39a 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,13 +31,9 @@
#include <com/sun/star/text/NotePrintMode.hpp>
-#if STLPORT_VERSION>=321
#include <cstdarg>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
@@ -46,7 +43,6 @@
#include <sfx2/progress.hxx>
#include <sfx2/app.hxx>
-#include <svl/flagitem.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/oldprintadaptor.hxx>
#include <sfx2/printer.hxx>
@@ -82,7 +78,6 @@
#include <globals.hrc>
#include <view.hrc>
#include <app.hrc>
-#include <svl/eitem.hxx>
#include <swwrtshitem.hxx>
#include "swabstdlg.hxx"
#include <svl/slstitm.hxx>
@@ -91,13 +86,10 @@
using namespace ::com::sun::star;
-
/*--------------------------------------------------------------------
Beschreibung: Drucker an Sfx uebergeben
--------------------------------------------------------------------*/
-
-
-SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate )
+SfxPrinter* SwView::GetPrinter( sal_Bool bCreate )
{
const IDocumentDeviceAccess* pIDDA = GetWrtShell().getIDocumentDeviceAccess();
SfxPrinter *pOld = pIDDA->getPrinter( false );
@@ -113,7 +105,6 @@ SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate )
/*--------------------------------------------------------------------
Beschreibung: Druckerwechsel weitermelden
--------------------------------------------------------------------*/
-
void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, sal_Bool bWeb )
{
SwPrintOptions* pOpt = SW_MOD()->GetPrtOptions(bWeb);
@@ -134,8 +125,7 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, sal_Bool bWeb )
}
}
-
-sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
{
SwWrtShell &rSh = GetWrtShell();
SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
@@ -174,8 +164,7 @@ sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags,
/*--------------------------------------------------------------------
Beschreibung: TabPage fuer applikationsspezifische Druckoptionen
--------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent,
+SfxTabPage* SwView::CreatePrintOptionsPage(Window* pParent,
const SfxItemSet& rSet)
{
return ::CreatePrintOptionsPage( pParent, rSet, sal_False );
@@ -184,8 +173,7 @@ SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent,
/*--------------------------------------------------------------------
Beschreibung: Print-Dispatcher
--------------------------------------------------------------------*/
-
-void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
+void SwView::ExecutePrint(SfxRequest& rReq)
{
sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
::SetAppPrintOptions( &GetWrtShell(), bWeb );
@@ -246,8 +234,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
}
else if( rReq.GetSlot() == SID_PRINTDOCDIRECT && ! bSilent )
{
- if( /*!bIsAPI && */
- ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) )
+ if( ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) )
{
short nBtn = SvxPrtQryBox(&GetEditWin()).Execute();
if( RET_CANCEL == nBtn )
@@ -270,7 +257,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
return;
}
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
}
@@ -279,26 +266,31 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
Beschreibung: Page Drucker/Zusaetze erzeugen fuer SwView und
SwPagePreview
--------------------------------------------------------------------*/
-
SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions, sal_Bool bPreview )
{
- SfxTabPage* pPage = NULL;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( TP_OPTPRINT_PAGE );
- if ( fnCreatePage )
- pPage = (*fnCreatePage)( pParent, rOptions );
- }
+ OSL_ENSURE(pFact, "No Print Dialog");
+ if (!pFact)
+ return NULL;
+
+ ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc(TP_OPTPRINT_PAGE);
+ OSL_ENSURE(pFact, "No Page Creator");
+ if (!fnCreatePage)
+ return NULL;
+
+ SfxTabPage* pPage = (*fnCreatePage)(pParent, rOptions);
+ OSL_ENSURE(pPage, "No page");
+ if (!pPage)
+ return NULL;
+
SfxAllItemSet aSet(*(rOptions.GetPool()));
- aSet.Put (SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview));
- aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True));
+ aSet.Put(SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview));
+ aSet.Put(SfxBoolItem(SID_FAX_LIST, sal_True));
pPage->PageCreated(aSet);
return pPage;
}
-
void SetAppPrintOptions( ViewShell* pSh, sal_Bool bWeb )
{
const IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess();
@@ -331,3 +323,5 @@ void SetAppPrintOptions( ViewShell* pSh, sal_Bool bWeb )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 1c702dddab3d..6be88b8855a1 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <string>
#include <hintids.hxx>
#include <com/sun/star/util/SearchOptions.hpp>
#include <svl/cjkoptions.hxx>
@@ -42,6 +42,7 @@
#include <svl/itempool.hxx>
#include <svl/eitem.hxx>
#include <svl/srchitem.hxx>
+#include <sal/macros.h>
#include <sfx2/request.hxx>
#include <svx/srchdlg.hxx>
#include <vcl/msgbox.hxx>
@@ -96,12 +97,6 @@ inline Window* GetParentWindow( SvxSearchDialog* pSrchDlg )
return pWin;
}
-
-/*-----------------12.04.97 13:04-------------------
-
---------------------------------------------------*/
-
-
void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -195,14 +190,14 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
if (nSlot == FN_REPEAT_SEARCH)
{
- ASSERT(pSrchItem, "Search-Item fehlt");
+ OSL_ENSURE(pSrchItem, "SearchItem missing");
if( !pSrchItem )
pSrchItem = new SvxSearchItem(SID_SEARCH_ITEM);
}
else
{
// SearchItem aus Request besorgen
- ASSERT(pArgs, "Args fehlen");
+ OSL_ENSURE(pArgs, "Args missing");
if ( pArgs )
{
delete pSrchItem;
@@ -288,7 +283,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
case SVX_SEARCHCMD_REPLACE_ALL:
{
SwSearchOptions aOpts( pWrtShell, pSrchItem->GetBackward() );
-
+ SwCrsrSaveState aSaveCursor( *pWrtShell->GetSwCrsr());
if( !pSrchItem->GetSelection() )
{
@@ -308,8 +303,11 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
SwWait aWait( *GetDocShell(), sal_True );
pWrtShell->StartAllAction();
nFound = FUNC_Search( aOpts );
+ // #i8288# Now that everything has been replaced, restore the original cursor position.
+ pWrtShell->GetSwCrsr()->RestoreSavePos(); // (position saved by SwCrsrSaveState above)
pWrtShell->EndAllAction();
}
+
rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0 && ULONG_MAX != nFound));
if( !nFound )
{
@@ -378,16 +376,16 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
SvUShorts aArr( 0, 16 );
aArr.Insert( aNormalAttr,
- sizeof( aNormalAttr ) / sizeof( aNormalAttr[0] ),
+ SAL_N_ELEMENTS( aNormalAttr ),
0 );
if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
aArr.Insert( aCTLAttr,
- sizeof( aCTLAttr ) / sizeof( aCTLAttr[0] ),
+ SAL_N_ELEMENTS( aCTLAttr ),
14 );
SvtCJKOptions aCJKOpt;
if( aCJKOpt.IsAnyEnabled() )
aArr.Insert( aCJKAttr,
- sizeof( aCJKAttr ) / sizeof( aCJKAttr[0] ),
+ SAL_N_ELEMENTS( aCJKAttr ),
14 );
SfxItemSet aSet( pWrtShell->GetAttrPool(), aArr.GetData() );
@@ -412,13 +410,13 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
}
break;
default:
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if(nSlot)
{
ByteString sStr( "nSlot: " );
sStr += ByteString::CreateFromInt32( nSlot );
- sStr += " falscher Dispatcher (viewsrch.cxx)";
- DBG_ERROR( sStr.GetBuffer() );
+ sStr += " wrong Dispatcher (viewsrch.cxx)";
+ OSL_FAIL(sStr.GetBuffer() );
}
#endif
return;
@@ -579,13 +577,13 @@ void SwView::Replace()
aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
aRewriter.AddRule(UNDO_ARG3, pSrchItem->GetReplaceString());
- pWrtShell->StartUndo(UNDO_UI_REPLACE_STYLE, &aRewriter); // #111827#
+ pWrtShell->StartUndo(UNDO_UI_REPLACE_STYLE, &aRewriter);
pWrtShell->SetTxtFmtColl( pWrtShell->GetParaStyle(
pSrchItem->GetReplaceString(),
SwWrtShell::GETSTYLE_CREATESOME ));
- pWrtShell->EndUndo(); // #111827#
+ pWrtShell->EndUndo();
}
else
{
@@ -639,7 +637,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
pWrtShell->SttSelect();
- static sal_uInt16 __READONLY_DATA aSearchAttrRange[] = {
+ static sal_uInt16 aSearchAttrRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -767,38 +765,6 @@ void SwView::StateSearch(SfxItemSet &rSet)
rSet.Put( *pSrchItem );
}
break;
-
-/* case SID_SEARCH_REPLACESET:
- case SID_SEARCH_SEARCHSET:
- {
- static sal_uInt16 __READONLY_DATA aSearchAttrRange[] =
- {
- RES_CHRATR_CASEMAP, RES_CHRATR_POSTURE,
- RES_CHRATR_SHADOWED, RES_CHRATR_WORDLINEMODE,
- RES_PARATR_LINESPACING, RES_PARATR_HYPHENZONE,
- RES_LR_SPACE, RES_UL_SPACE,
- SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
- 0
- };
-
- SfxItemSet aSet(pWrtShell->GetAttrPool(), aSearchAttrRange );
- if( SID_SEARCH_REPLACESET==nWhich )
- {
- if( pReplList )
- {
- pReplList->Get( aSet );
- DELETEZ( pReplList );
- }
- }
- else if( pSrchList )
- {
- pSrchList->Get( aSet );
- DELETEZ( pSrchList );
- }
- rSet.Put( SvxSetItem( nWhich, aSet ));
- }
- break;
-*/
}
nWhich = aIter.NextWhich();
}
@@ -806,3 +772,4 @@ void SwView::StateSearch(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index fed08c5e90c9..a7d1dae9ae11 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,10 +70,6 @@
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwView::GetState(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
@@ -161,8 +158,8 @@ void SwView::GetState(SfxItemSet &rSet)
break;
case SID_UNDO:
{
- //JP 21.07.98: Bug 53429 - die muss noch nicht vorhanden sein
- // also lasse sie mal anlegen:
+ // die muss noch nicht vorhanden sein
+ // also lasse sie mal anlegen:
if( !pShell )
SelectShell();
@@ -335,7 +332,6 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_DOCUMENT_COMPARE:
case SID_DOCUMENT_MERGE:
if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) ||
-// pWrtShell->IsAnySectionInDoc( sal_True, sal_True, sal_True )||
(SID_DOCUMENT_MERGE == nWhich && pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength()))
rSet.DisableItem(nWhich);
break;
@@ -436,11 +432,6 @@ void SwView::GetState(SfxItemSet &rSet)
}
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwView::GetDrawState(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
@@ -468,7 +459,6 @@ void SwView::GetDrawState(SfxItemSet &rSet)
case SID_SHOW_HIDDEN:
case SID_SHOW_FORMS:
rSet.DisableItem( nWhich );
- // rSet.Put( SfxBoolItem(nWhich,sal_True ));
break;
case SID_DRAW_TEXT_MARQUEE:
@@ -506,10 +496,6 @@ void SwView::GetDrawState(SfxItemSet &rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature )
{
sal_Bool bRet = sal_False;
@@ -521,3 +507,4 @@ sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature )
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 278a52c5dfe4..0909b3c5224f 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <tools/list.hxx>
-
#include <hintids.hxx>
#include "uitool.hxx"
#include <sfx2/app.hxx>
@@ -65,10 +63,8 @@
#include "fmtcol.hxx"
#include "section.hxx"
-// -> #i23726#
#include "ndtxt.hxx"
#include "pam.hxx"
-// <- #i23726#
#include <IDocumentSettingAccess.hxx>
@@ -79,12 +75,9 @@ using namespace ::com::sun::star;
Beschreibung: Debug-Methode
--------------------------------------------------------------------*/
-
/*--------------------------------------------------------------------
Beschreibung: Columns eintueten
--------------------------------------------------------------------*/
-
-
void lcl_FillSvxColumn(const SwFmtCol& rCol,
sal_uInt16 nTotalWidth,
SvxColumnItem& rColItem,
@@ -126,14 +119,12 @@ void lcl_FillSvxColumn(const SwFmtCol& rCol,
/*--------------------------------------------------------------------
Beschreibung: ColumnItem in ColumnInfo ueberfuehren
--------------------------------------------------------------------*/
-
-
void lcl_ConvertToCols(const SvxColumnItem& rColItem,
sal_uInt16 nTotalWidth,
SwFmtCol& rCols)
{
- ASSERT( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
- // #126939# ruler executes that change the columns shortly after the selection has changed
+ OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
+ // ruler executes that change the columns shortly after the selection has changed
// can result in a crash
if(rCols.GetNumCols() != rColItem.Count())
return;
@@ -146,7 +137,7 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem,
// Tabcols der Reihe nach
for( sal_uInt16 i=0; i < rColItem.Count()-1; ++i )
{
- DBG_ASSERT(rColItem[i+1].nStart >= rColItem[i].nEnd,"\201berlappende Spalten" );
+ OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" );
sal_uInt16 nStart = static_cast< sal_uInt16 >(rColItem[i+1].nStart);
sal_uInt16 nEnd = static_cast< sal_uInt16 >(rColItem[i].nEnd);
if(nStart < nEnd)
@@ -178,8 +169,6 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem,
/*--------------------------------------------------------------------
Beschreibung: Tabs loeschen
--------------------------------------------------------------------*/
-
-
void lcl_EraseDefTabs(SvxTabStopItem& rTabStops)
{
// Def Tabs loeschen
@@ -199,8 +188,6 @@ void lcl_EraseDefTabs(SvxTabStopItem& rTabStops)
/*--------------------------------------------------------------------
Beschreibung: Seitenrand umdrehen
--------------------------------------------------------------------*/
-
-
void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
{
sal_uInt16 nPhyPage, nVirPage;
@@ -218,8 +205,6 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
Beschreibung: Wenn der Rahmenrand verschoben wird, sollen die
Spaltentrenner an der gleichen absoluten Position bleiben
--------------------------------------------------------------------*/
-
-
void lcl_Scale(long& nVal, long nScale)
{
nVal *= nScale;
@@ -264,12 +249,11 @@ void ResizeFrameCols(SwFmtCol& rCol,
//reset auto width
rCol.SetOrtho(sal_False, 0, 0 );
}
+
/*--------------------------------------------------------------------
Beschreibung: Hier werden alle Aenderungen der Tableiste
wieder in das Modell geschossen
--------------------------------------------------------------------*/
-
-
void SwView::ExecTabWin( SfxRequest& rReq )
{
SwWrtShell &rSh = GetWrtShell();
@@ -603,21 +587,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
{
SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)rReq.
GetArgs()->Get(nSlot));
- if(nFrmType & FRMTYPE_FLY_ANY)
- {
- sal_Bool bFirstColumn = sal_True;
- sal_Bool bLastColumn = sal_True;
- if(nFrmType & FRMTYPE_COLUMN)
- {
- sal_uInt16 nCurFrameCol = rSh.GetCurColNum() - 1;
- bFirstColumn = !nCurFrameCol;
- const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt();
- const SwFmtCol* pCols = &pFmt->GetCol();
- const SwColumns& rCols = pCols->GetColumns();
- sal_uInt16 nColumnCount = rCols.Count();
- bLastColumn = nColumnCount == nCurFrameCol + 1;
- }
- }
+
aParaMargin.SetRight( aParaMargin.GetRight() - nRightBorderDistance );
aParaMargin.SetTxtLeft(aParaMargin.GetTxtLeft() - nLeftBorderDistance );
@@ -627,23 +597,19 @@ void SwView::ExecTabWin( SfxRequest& rReq )
// #i23726#
if (pNumRuleNodeFromDoc)
{
- // --> FME 2005-02-22 #i42922# Mouse move of numbering label
+ // --> #i42922# Mouse move of numbering label
// has to consider the left indent of the paragraph
SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE );
rSh.GetCurAttr( aSet );
const SvxLRSpaceItem& rLR =
static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE));
- // <--
SwPosition aPos(*pNumRuleNodeFromDoc);
- // --> OD 2008-06-09 #i90078#
+ // #i90078#
rSh.SetIndent( static_cast< short >(aParaMargin.GetTxtLeft() - rLR.GetTxtLeft()), aPos);
- // <--
- // --> OD 2005-02-18 #i42921# - invalidate state of indent in order
- // to get a ruler update.
+ // #i42921# invalidate state of indent in order to get a ruler update.
aParaMargin.SetWhich( nSlot );
GetViewFrame()->GetBindings().SetState( aParaMargin );
- // <--
}
else if( pColl && pColl->IsAutoUpdateFmt() )
{
@@ -704,7 +670,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
- ASSERT(aColItem.Count(), "ColDesc ist leer!!");
+ OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
const sal_Bool bSingleLine = ((const SfxBoolItem&)rReq.
GetArgs()->Get(SID_RULER_ACT_LINE_ONLY)).GetValue();
@@ -721,13 +687,6 @@ void SwView::ExecTabWin( SfxRequest& rReq )
nBorder = (bVerticalWriting ? nPageHeight : nPageWidth) - aTabCols.GetLeftMin() - aColItem.GetRight();
-#ifdef DEBUG
- long nTmp1 = nPageWidth;
- long nTmp2 = aTabCols.GetLeftMin() + nBorder;
- (void)nTmp1;
- (void)nTmp2;
-#endif
-
if ( aColItem.GetRight() > 0 )
aTabCols.SetRight( nBorder );
@@ -741,7 +700,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if(bIsTableRTL)
{
sal_uInt16 nColCount = aColItem.Count() - 1;
- for ( sal_uInt16 i = 0; i < nColCount; ++i )
+ for ( sal_uInt16 i = 0; i < nColCount && i < aTabCols.Count(); ++i )
{
const SvxColumnDescription& rCol = aColItem[nColCount - i];
aTabCols[i] = aTabCols.GetRight() - rCol.nStart;
@@ -750,7 +709,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
}
else
{
- for ( sal_uInt16 i = 0; i < aColItem.Count()-1; ++i )
+ for ( sal_uInt16 i = 0; i < aColItem.Count()-1 && i < aTabCols.Count(); ++i )
{
const SvxColumnDescription& rCol = aColItem[i];
aTabCols[i] = rCol.nEnd + aTabCols.GetLeft();
@@ -781,7 +740,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if(bSect)
{
const SwSection *pSect = rSh.GetAnySection();
- ASSERT( pSect, "Welcher Bereich?");
+ OSL_ENSURE( pSect, "Which section?");
pSectFmt = pSect->GetFmt();
}
else
@@ -836,7 +795,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
- ASSERT(aColItem.Count(), "ColDesc ist leer!!");
+ OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
SwTabCols aTabCols;
if ( bSetTabRowFromDoc )
@@ -894,7 +853,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
break;
default:
- ASSERT( !this, "Falsche SlotId");
+ OSL_ENSURE( !this, "wrong SlotId");
}
rSh.EndAllAction();
@@ -910,8 +869,6 @@ void SwView::ExecTabWin( SfxRequest& rReq )
sprich alle relevanten Attribute an der CursorPos
werden der Tableiste uebermittelt
--------------------------------------------------------------------*/
-
-
void SwView::StateTabWin(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetWrtShell();
@@ -952,10 +909,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SfxItemSet aCoreSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP,
RES_LR_SPACE, RES_UL_SPACE, 0 );
- // --> OD 2008-01-17 #newlistlevelattrs#
// get also the list level indent values merged as LR-SPACE item, if needed.
rSh.GetCurAttr( aCoreSet, true );
- // <--
SelectionType nSelType = rSh.GetSelectionType();
SfxWhichIter aIter( rSet );
@@ -966,8 +921,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
switch ( nWhich )
{
-// case RES_LR_SPACE:
-// case SID_ATTR_LRSPACE:
case SID_ATTR_LONG_LRSPACE:
{
SvxLongLRSpaceItem aLongLR( (long)aPageLRSpace.GetLeft(),
@@ -1030,8 +983,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
break;
}
case SID_ATTR_LONG_ULSPACE:
-// case SID_ATTR_ULSPACE:
-// case RES_UL_SPACE:
{
// Rand Seite Oben Unten
SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
@@ -1081,13 +1032,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if ( ISA( SwWebView ) ||
IsTabColFromDoc() ||
IsTabRowFromDoc() ||
- ( nSelType & nsSelectionType::SEL_GRF) ||
- (nSelType & nsSelectionType::SEL_FRM) ||
- (nSelType & nsSelectionType::SEL_OLE) ||
- SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE)||
- (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich))||
- (bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
- )
+ ( nSelType & nsSelectionType::SEL_GRF ) ||
+ ( nSelType & nsSelectionType::SEL_FRM ) ||
+ ( nSelType & nsSelectionType::SEL_OLE ) ||
+ ( SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE) ) ||
+ (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich) ) ||
+ ( bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
+ )
rSet.DisableItem( nWhich );
else
{
@@ -1097,7 +1048,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
rSh.GetDefault(RES_PARATR_TABSTOP);
- DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+ OSL_ENSURE(pHRuler, "why is there no ruler?");
long nDefTabDist = ::GetTabDist(rDefTabs);
pHRuler->SetDefTabDist( nDefTabDist );
pVRuler->SetDefTabDist( nDefTabDist );
@@ -1110,12 +1061,12 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_ATTR_PARA_LRSPACE:
{
if ( nSelType & nsSelectionType::SEL_GRF ||
- nSelType & nsSelectionType::SEL_FRM ||
- nSelType & nsSelectionType::SEL_OLE ||
- nFrmType == FRMTYPE_DRAWOBJ ||
- (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich))||
- (bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
- )
+ nSelType & nsSelectionType::SEL_FRM ||
+ nSelType & nsSelectionType::SEL_OLE ||
+ nFrmType == FRMTYPE_DRAWOBJ ||
+ (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)) ||
+ ( bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
+ )
{
rSet.DisableItem(nWhich);
}
@@ -1130,10 +1081,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if (pNumRuleNodeFromDoc)
{
short nOffset = static_cast< short >(aLR.GetTxtLeft() +
- // --> FME 2005-02-22 #i42922# Mouse move of numbering label
+ // #i42922# Mouse move of numbering label
// has to consider the left indent of the paragraph
pNumRuleNodeFromDoc->GetLeftMarginWithNum( sal_True ) );
- // <--
short nFLOffset;
pNumRuleNodeFromDoc->GetFirstLineOfsWithNum( nFLOffset );
@@ -1294,12 +1244,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
sal_Bool bTableVertical = bHasTable && rSh.IsTableVertical();
- if( ( (SID_RULER_BORDERS_VERTICAL == nWhich) &&
- ((bHasTable && !bTableVertical)||
- (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
- ((SID_RULER_BORDERS == nWhich) &&
- ((bHasTable && bTableVertical)||
- (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns)))
+ if(((SID_RULER_BORDERS_VERTICAL == nWhich) &&
+ ((bHasTable && !bTableVertical) ||
+ (!bVerticalWriting && !bFrmSelection && !bHasTable ) ||
+ ( bFrmSelection && !bFrameHasVerticalColumns))) ||
+ ((SID_RULER_BORDERS == nWhich) &&
+ ((bHasTable && bTableVertical) ||
+ (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns)))
rSet.DisableItem(nWhich);
else if ( bHasTable )
{
@@ -1318,7 +1269,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
nNum = aTabCols.Count() - nNum;
}
- ASSERT(nNum <= aTabCols.Count(), "TabCol not found");
+ OSL_ENSURE(nNum <= aTabCols.Count(), "TabCol not found");
const int nLft = aTabCols.GetLeftMin() + aTabCols.GetLeft();
const int nRgt = (sal_uInt16)(bTableVertical ? nPageHeight : nPageWidth) -
(aTabCols.GetLeftMin() +
@@ -1393,7 +1344,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
nFrmType & FRMTYPE_COLSECT )
{
const SwSection *pSect = rSh.GetAnySection(sal_False, pPt);
- ASSERT( pSect, "Welcher Bereich?");
+ OSL_ENSURE( pSect, "Which section?");
if( pSect )
{
SwSectionFmt *pFmt = pSect->GetFmt();
@@ -1518,10 +1469,10 @@ void SwView::StateTabWin(SfxItemSet& rSet)
bFrmSelection;
}
- if( ( (SID_RULER_ROWS == nWhich) &&
- ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
- ((SID_RULER_ROWS_VERTICAL == nWhich) &&
- ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns)))
+ if(((SID_RULER_ROWS == nWhich) &&
+ ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns))) ||
+ ((SID_RULER_ROWS_VERTICAL == nWhich) &&
+ ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns)))
rSet.DisableItem(nWhich);
else if ( IsTabRowFromDoc() ||
( rSh.GetTableFmt() && !bFrmSelection &&
@@ -1539,7 +1490,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
rSh.GetTabRows( aTabCols );
}
-// ASSERT(nNum <= aTabCols.Count(), "TabCol not found");
const int nLft = aTabCols.GetLeftMin();
const int nRgt = (sal_uInt16)(bVerticalWriting ? nPageWidth : nPageHeight) -
(aTabCols.GetLeftMin() +
@@ -1749,7 +1699,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
eRecType = bSectOutTbl ? RECT_OUTTABSECTION
: RECT_SECTION;
const SwSection *pSect = rSh.GetAnySection( bSectOutTbl, pPt );
- ASSERT( pSect, "Welcher Bereich?");
+ OSL_ENSURE( pSect, "Which section?");
pFmt = pSect->GetFmt();
}
else if( bFrame )
@@ -1781,7 +1731,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if( nNum > rCols.Count() )
{
- ASSERT( !this, "es wird auf dem falschen FmtCol gearbeitet!" );
+ OSL_ENSURE( !this, "wrong FmtCol is being edited!" );
nNum = rCols.Count();
}
@@ -1862,4 +1812,4 @@ void SwView::StateTabWin(SfxItemSet& rSet)
}
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/RefreshListenerContainer.cxx b/sw/source/ui/uno/RefreshListenerContainer.cxx
index 39d28a6347c1..ddfcec93a54d 100644
--- a/sw/source/ui/uno/RefreshListenerContainer.cxx
+++ b/sw/source/ui/uno/RefreshListenerContainer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,5 @@ void SwRefreshListenerContainer::Refreshed ()
xRefreshListener->refreshed(aObj);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index fba5ac67a8d4..b3dbea127dfe 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <sfx2/sfxbasecontroller.hxx>
#include <SwXDocumentSettings.hxx>
#include <comphelper/MasterPropertySetInfo.hxx>
@@ -48,11 +49,7 @@
#include <svx/zoomitem.hxx>
#include <unomod.hxx>
#include <vcl/svapp.hxx>
-
-#include "swmodule.hxx"
-#include "cfgitems.hxx"
-#include "prtopt.hxx"
-
+#include <comphelper/servicehelper.hxx>
#include "swmodule.hxx"
#include "cfgitems.hxx"
@@ -120,11 +117,13 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_USE_OLD_PRINTER_METRICS,
HANDLE_PROTECT_FORM,
HANDLE_TABS_RELATIVE_TO_INDENT,
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
- // <--
HANDLE_MODIFYPASSWORDINFO,
- HANDLE_MATH_BASELINE_ALIGNMENT
+ HANDLE_MATH_BASELINE_ALIGNMENT,
+ HANDLE_INVERT_BORDER_SPACING,
+ HANDLE_COLLAPSE_EMPTY_CELL_PARA,
+ HANDLE_SMALL_CAPS_PERCENTAGE_66
};
MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -176,11 +175,13 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("TabsRelativeToIndent"), HANDLE_TABS_RELATIVE_TO_INDENT, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0},
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0},
-
+ { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -257,7 +258,7 @@ void SwXDocumentSettings::release ()
uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( )
throw (RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Type > aBaseTypes( 5 );
uno::Type* pBaseTypes = aBaseTypes.getArray();
@@ -273,18 +274,15 @@ uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( )
return aBaseTypes;
}
+namespace
+{
+ class theSwXDocumentSettingsImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentSettingsImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId( )
throw (RuntimeException)
{
- 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 = sal_True;
- }
- return aId;
+ return theSwXDocumentSettingsImplementationId::get().getSeq();
}
void SwXDocumentSettings::_preSetValues ()
@@ -302,7 +300,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
{
if (rInfo.mnAttributes & PropertyAttribute::READONLY)
- throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + C2U(rInfo.mpName), static_cast < cppu::OWeakObject * > ( 0 ) );
+ throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rtl::OUString::createFromAscii(rInfo.mpName), static_cast < cppu::OWeakObject * > ( 0 ) );
switch( rInfo.mnHandle )
{
@@ -406,7 +404,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
SvMemoryStream aStream (aSequence.getArray(), nSize,
STREAM_READ );
aStream.Seek ( STREAM_SEEK_TO_BEGIN );
- static sal_uInt16 __READONLY_DATA nRange[] =
+ static sal_uInt16 const nRange[] =
{
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_HTML_MODE, SID_HTML_MODE,
@@ -665,14 +663,13 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::PROTECT_FORM, bTmp);
}
break;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
{
sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
mpDoc->set(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, bTmp);
}
break;
- // <--
case HANDLE_MODIFYPASSWORDINFO:
{
uno::Sequence< beans::PropertyValue > aInfo;
@@ -694,6 +691,24 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, bTmp );
}
break;
+ case HANDLE_INVERT_BORDER_SPACING:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp);
+ }
+ break;
+ case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp);
+ }
+ break;
+ case HANDLE_SMALL_CAPS_PERCENTAGE_66:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66, bTmp);
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -807,7 +822,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_IS_KERN_ASIAN_PUNCTUATION:
{
- //sal_Bool bParaSpace = mpDoc->IsKernAsianPunctuation();
sal_Bool bParaSpace = mpDoc->get(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION);
rValue.setValue(&bParaSpace, ::getBooleanCppuType());
}
@@ -1009,14 +1023,13 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
{
sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
- // <--
case HANDLE_MODIFYPASSWORDINFO:
{
rValue <<= mpDocSh->GetModifyPasswordInfo();
@@ -1028,7 +1041,24 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
-
+ case HANDLE_INVERT_BORDER_SPACING:
+ {
+ sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::INVERT_BORDER_SPACING);
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
+ case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
+ {
+ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA );
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
+ case HANDLE_SMALL_CAPS_PERCENTAGE_66:
+ {
+ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 );
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1074,3 +1104,4 @@ Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames( )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/SwXDocumentSettings.hxx b/sw/source/ui/uno/SwXDocumentSettings.hxx
index 6ea168716e40..e79aa94db2c0 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.hxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,12 +33,8 @@
#include "ui_pch.hxx"
#endif
-#ifndef _COMPHELPER_MASTERPROPERTYSET_HXX_
#include <comphelper/MasterPropertySet.hxx>
-#endif
-#ifndef _COM_SUN_STAR_TEXT_XTEXTDOCUMENT_HPP
#include <com/sun/star/text/XTextDocument.hpp>
-#endif
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <cppuhelper/weak.hxx>
@@ -107,3 +104,5 @@ public:
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 015a75de2ab0..3af6e74bb922 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <shellio.hxx>
#include <swdll.hxx>
#include <unoprnms.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -50,37 +51,27 @@ using namespace ::com::sun::star::lang;
#define SWFILTEROPTIONSOBJ_SERVICE RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilterOptionsDialog")
#define SWFILTEROPTIONSOBJ_IMPLNAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.FilterOptionsDialog")
#define FILTER_OPTIONS_NAME RTL_CONSTASCII_USTRINGPARAM("FilterOptions")
-/*-- 2002/06/21 11:01:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFilterOptions::SwXFilterOptions() :
bExport( sal_False )
{
}
-/*-- 2002/06/21 11:01:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFilterOptions::~SwXFilterOptions()
{
}
-/*-- 2002/06/21 11:01:24---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwXFilterOptions::getImplementationName_Static()
{
return ::rtl::OUString(SWFILTEROPTIONSOBJ_IMPLNAME);
}
-/*-- 2002/06/21 11:01:24---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString> SwXFilterOptions::getSupportedServiceNames_Static()
{
::rtl::OUString sService(SWFILTEROPTIONSOBJ_SERVICE);
return uno::Sequence< ::rtl::OUString> (&sService, 1);
}
-/*-- 2002/06/21 11:01:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() throw (uno::RuntimeException)
{
uno::Sequence<beans::PropertyValue> aRet(1);
@@ -91,9 +82,7 @@ uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() thro
return aRet;
}
-/*-- 2002/06/21 11:01:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyValue >& aProps )
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
IllegalArgumentException, WrappedTargetException, uno::RuntimeException)
@@ -109,20 +98,16 @@ void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyV
rProp.Value >>= sFilterName;
else if ( aPropName == ::rtl::OUString(FILTER_OPTIONS_NAME) )
rProp.Value >>= sFilterOptions;
- else if ( aPropName.equalsAscii( "InputStream" ) )
+ else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InputStream" ) ) )
rProp.Value >>= xInputStream;
}
}
-/*-- 2002/06/21 11:01:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFilterOptions::setTitle( const ::rtl::OUString& /*rTitle*/ )
throw (uno::RuntimeException)
{
}
-/*-- 2002.06.21 11:01:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
{
sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL;
@@ -143,10 +128,10 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAsciiFilterDlg* pAsciiDlg = pFact->CreateSwAsciiFilterDlg( NULL, *pDocShell,pInStream, DLG_ASCII_FILTER );
- DBG_ASSERT(pAsciiDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pAsciiDlg, "Dialogdiet fail!");
if(RET_OK == pAsciiDlg->Execute())
{
SwAsciiOptions aOptions;
@@ -164,54 +149,44 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
return nRet;
}
-/*-- 2002/06/21 11:01:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFilterOptions::setTargetDocument( const uno::Reference< XComponent >& xDoc )
throw (IllegalArgumentException, uno::RuntimeException)
{
bExport = sal_False;
xModel = xDoc;
}
-/*-- 2002/06/21 11:01:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFilterOptions::setSourceDocument( const uno::Reference<XComponent >& xDoc )
throw (IllegalArgumentException,uno::RuntimeException)
{
bExport = sal_True;
xModel = xDoc;
}
-/*-- 2002/06/21 11:01:26---------------------------------------------------
- -----------------------------------------------------------------------*/
::rtl::OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException)
{
return ::rtl::OUString(SWFILTEROPTIONSOBJ_IMPLNAME);
}
-/*-- 2002/06/21 11:01:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFilterOptions::supportsService( const ::rtl::OUString& rServiceName )
throw(uno::RuntimeException)
{
return rServiceName == ::rtl::OUString(SWFILTEROPTIONSOBJ_SERVICE);
}
-/*-- 2002/06/21 11:01:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< ::rtl::OUString > SwXFilterOptions::getSupportedServiceNames()
throw(uno::RuntimeException)
{
return SwXFilterOptions::getSupportedServiceNames_Static();
}
-
uno::Reference<uno::XInterface> SAL_CALL SwXFilterOptions_createInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
return (::cppu::OWeakObject*) new SwXFilterOptions;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/detreg.cxx b/sw/source/ui/uno/detreg.cxx
index 65f4e6379a17..69cf4888eb74 100644
--- a/sw/source/ui/uno/detreg.cxx
+++ b/sw/source/ui/uno/detreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx
index c163feda46b5..374abaa693fa 100644
--- a/sw/source/ui/uno/dlelstnr.cxx
+++ b/sw/source/ui/uno/dlelstnr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp>
#include <com/sun/star/linguistic2/XDictionaryList.hpp>
#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
@@ -42,7 +40,7 @@
#include <com/sun/star/uno/Reference.h>
#include <comphelper/processfactory.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <tools/shl.hxx>
#include "dlelstnr.hxx"
@@ -50,7 +48,6 @@
#include <wrtsh.hxx>
#include <view.hxx>
-
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -59,11 +56,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::linguistic2;
using namespace ::com::sun::star::linguistic2::LinguServiceEventFlags;
-#define A2OU(x) OUString::createFromAscii(x)
-
-/* -----------------------------17.03.00 09:07--------------------------------
-
- ---------------------------------------------------------------------------*/
SwLinguServiceEventListener::SwLinguServiceEventListener()
{
Reference< XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() );
@@ -71,20 +63,20 @@ SwLinguServiceEventListener::SwLinguServiceEventListener()
{
try
{
- OUString aSvcName( A2OU( "com.sun.star.frame.Desktop" ) );
+ OUString aSvcName( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) );
xDesktop = Reference< frame::XDesktop >(
xMgr->createInstance( aSvcName ), UNO_QUERY );
if (xDesktop.is())
xDesktop->addTerminateListener( this );
- aSvcName = A2OU( "com.sun.star.linguistic2.LinguServiceManager" );
+ aSvcName = OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.linguistic2.LinguServiceManager" ));
xLngSvcMgr = Reference< XLinguServiceManager >( xMgr->createInstance( aSvcName ), UNO_QUERY );
if (xLngSvcMgr.is())
xLngSvcMgr->addLinguServiceManagerListener( (XLinguServiceEventListener *) this );
if (SvtLinguConfig().HasGrammarChecker())
{
- aSvcName = A2OU( "com.sun.star.linguistic2.ProofreadingIterator" );
+ aSvcName = OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.linguistic2.ProofreadingIterator" ));
xGCIterator = Reference< XProofreadingIterator >( xMgr->createInstance( aSvcName ), UNO_QUERY );
Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY );
if (xBC.is())
@@ -93,26 +85,20 @@ SwLinguServiceEventListener::SwLinguServiceEventListener()
}
catch (uno::Exception &)
{
- DBG_ASSERT(0, "exception caught in SwLinguServiceEventListener c-tor" );
+ OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" );
}
}
}
-/* -----------------------------17.03.00 09:07--------------------------------
- ---------------------------------------------------------------------------*/
SwLinguServiceEventListener::~SwLinguServiceEventListener()
{
}
-/* -----------------------------17.03.00 09:06--------------------------------
-
- ---------------------------------------------------------------------------*/
-
void SwLinguServiceEventListener::processDictionaryListEvent(
const DictionaryListEvent& rDicListEvent)
throw( RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nEvt = rDicListEvent.nCondensedEvent;
@@ -133,12 +119,11 @@ void SwLinguServiceEventListener::processDictionaryListEvent(
SW_MOD()->CheckSpellChanges( sal_False, bIsSpellWrong, bIsSpellAll, sal_False );
}
-
void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent(
const LinguServiceEvent& rLngSvcEvent )
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bIsSpellWrong = 0 != (rLngSvcEvent.nEvent & SPELL_WRONG_WORDS_AGAIN);
sal_Bool bIsSpellAll = 0 != (rLngSvcEvent.nEvent & SPELL_CORRECT_WORDS_AGAIN);
@@ -164,33 +149,29 @@ void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent(
}
}
-
void SAL_CALL SwLinguServiceEventListener::disposing(
const EventObject& rEventObj )
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
+ if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
xLngSvcMgr = 0;
- if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
+ if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
xGCIterator = 0;
}
-
void SAL_CALL SwLinguServiceEventListener::queryTermination(
const EventObject& /*rEventObj*/ )
throw(TerminationVetoException, RuntimeException)
{
- //vos::OGuard aGuard(Application::GetSolarMutex());
}
-
void SAL_CALL SwLinguServiceEventListener::notifyTermination(
const EventObject& rEventObj )
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (xDesktop.is() && rEventObj.Source == xDesktop)
{
@@ -202,3 +183,4 @@ void SAL_CALL SwLinguServiceEventListener::notifyTermination(
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx
index 2adba8f5c841..f38cf9a810e7 100644
--- a/sw/source/ui/uno/swdet2.cxx
+++ b/sw/source/ui/uno/swdet2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,36 +76,7 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp
const SfxFilter* pTmp = SwIoSystem::GetFileFilter( rMedium.GetPhysicalName(), aPrefFlt, &rMedium );
if( !pTmp )
return ERRCODE_ABORT;
- /*
- else if( *ppFilter && (*ppFilter)->GetUserData().EqualsAscii( "W4W", 0, 3 )
- && pTmp->GetUserData().EqualsAscii( FILTER_TEXT, 0, 4 ) )
- {
- // Bug 95262 - if the user (or short detect) select a
- // Word 4 Word filter, but the autodect of mastersoft
- // can't detect it, we normally return the ascii filter
- // But the user may have a change to use the W4W filter,
- // so the SFX must show now a dialog with the 2 filters
- nRet = ERRCODE_SFX_CONSULTUSER;
- *ppFilter = pTmp;
- } */
- // sollte der voreingestellte Filter ASCII sein und wir haben
- // ASCII erkannt, dann ist das ein gultiger Filter, ansonsten ist das
- // ein Fehler und wir wollen die Filterbox sehen
- /*
- else if( pTmp->GetUserData().EqualsAscii( FILTER_TEXT ) )
- {
- // Bug 28974: "Text" erkannt, aber "Text Dos" "Text ..." eingestellt
- // -> keine FilterBox, sondern den eingestellten Filter benutzen
- if( *ppFilter && (*ppFilter)->GetUserData().EqualsAscii( FILTER_TEXT, 0, 4 ) )
- ;
- else
-// if( !*ppFilter || COMPARE_EQUAL != pTmp->GetUserData().Compare((*ppFilter)->GetUserData(), 4 ))
- {
-// nRet = ERRCODE_ABORT;
- *ppFilter = pTmp;
- }
- } */
else
{
//Bug 41417: JP 09.07.97: HTML documents should be loaded by WebWriter
@@ -120,3 +92,4 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp
return nRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 133935a5330c..c95900fb928b 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
@@ -44,9 +43,7 @@
#include <com/sun/star/ucb/InteractiveAppException.hpp>
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
-#ifndef _TOOLKIT_UNOHLP_HXX
#include <toolkit/helper/vclunohelper.hxx>
-#endif
#include <ucbhelper/simpleinteractionrequest.hxx>
#include <rtl/ustring.h>
#include <rtl/logfile.hxx>
@@ -55,7 +52,7 @@
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <tools/urlobj.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <sot/storinfo.hxx>
@@ -116,7 +113,6 @@ SwFilterDetect::~SwFilterDetect()
// now some parameters that can already be in the array, but may be overwritten or new inserted here
// remember their indices in the case new values must be added to the array
sal_Int32 nPropertyCount = lDescriptor.getLength();
- sal_Int32 nIndexOfFilterName = -1;
sal_Int32 nIndexOfInputStream = -1;
sal_Int32 nIndexOfContent = -1;
sal_Int32 nIndexOfReadOnlyFlag = -1;
@@ -146,10 +142,6 @@ SwFilterDetect::~SwFilterDetect()
{
lDescriptor[nProperty].Value >>= sTemp;
aPreselectedFilterName = sTemp;
-
- // if the preselected filter name is not correct, it must be erased after detection
- // remember index of property to get access to it later
- nIndexOfFilterName = nProperty;
}
else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")) )
nIndexOfInputStream = nProperty;
@@ -173,9 +165,7 @@ SwFilterDetect::~SwFilterDetect()
nIndexOfDocumentTitle = nProperty;
}
- // can't check the type for external filters, so set the "dont" flag accordingly
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- //SfxFilterFlags nMust = SFX_FILTER_IMPORT, nDont = SFX_FILTER_NOTINSTALLED;
+ SolarMutexGuard aGuard;
SfxApplication* pApp = SFX_APP();
SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() );
@@ -193,7 +183,6 @@ SwFilterDetect::~SwFilterDetect()
String aPattern( aPrefix );
aPattern += String::CreateFromAscii("swriter");
if ( aURL.Match( aPattern ) >= aPattern.Len() )
- //pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL );
return aTypeName;
}
}
@@ -240,7 +229,7 @@ SwFilterDetect::~SwFilterDetect()
}
else
{
- DBG_ASSERT( xStorage.is(), "At this point storage must exist!" );
+ OSL_ENSURE( xStorage.is(), "At this point storage must exist!" );
try
{
@@ -366,7 +355,7 @@ SwFilterDetect::~SwFilterDetect()
{
// if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("InputStream");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream"));
lDescriptor[nPropertyCount].Value <<= xStream;
nPropertyCount++;
}
@@ -375,7 +364,7 @@ SwFilterDetect::~SwFilterDetect()
{
// if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("UCBContent");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent"));
lDescriptor[nPropertyCount].Value <<= xContent;
nPropertyCount++;
}
@@ -385,7 +374,7 @@ SwFilterDetect::~SwFilterDetect()
if ( nIndexOfReadOnlyFlag == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("ReadOnly");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
lDescriptor[nPropertyCount].Value <<= bReadOnly;
nPropertyCount++;
}
@@ -396,7 +385,7 @@ SwFilterDetect::~SwFilterDetect()
if ( !bRepairPackage && bRepairAllowed )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("RepairPackage");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage"));
lDescriptor[nPropertyCount].Value <<= bRepairAllowed;
nPropertyCount++;
bOpenAsTemplate = sal_True;
@@ -408,7 +397,7 @@ SwFilterDetect::~SwFilterDetect()
if ( nIndexOfTemplateFlag == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
lDescriptor[nPropertyCount].Value <<= bOpenAsTemplate;
nPropertyCount++;
}
@@ -422,7 +411,7 @@ SwFilterDetect::~SwFilterDetect()
if ( nIndexOfDocumentTitle == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("DocumentTitle");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
lDescriptor[nPropertyCount].Value <<= aDocumentTitle;
nPropertyCount++;
}
@@ -466,18 +455,17 @@ UNOSEQUENCE< UNOOUSTRING > SAL_CALL SwFilterDetect::getSupportedServiceNames() t
/* Helper for XServiceInfo */
UNOSEQUENCE< UNOOUSTRING > SwFilterDetect::impl_getStaticSupportedServiceNames()
{
- UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() );
UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 3 );
- seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( "com.sun.star.frame.ExtendedTypeDetection" );
- seqServiceNames.getArray() [1] = UNOOUSTRING::createFromAscii( "com.sun.star.text.FormatDetector" );
- seqServiceNames.getArray() [2] = UNOOUSTRING::createFromAscii( "com.sun.star.text.W4WFormatDetector" );
+ seqServiceNames.getArray() [0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ExtendedTypeDetection" ));
+ seqServiceNames.getArray() [1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.FormatDetector" ));
+ seqServiceNames.getArray() [2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.W4WFormatDetector" ));
return seqServiceNames ;
}
/* Helper for XServiceInfo */
UNOOUSTRING SwFilterDetect::impl_getStaticImplementationName()
{
- return UNOOUSTRING::createFromAscii( "com.sun.star.comp.writer.FormatDetector" );
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.writer.FormatDetector" ));
}
/* Helper for registry */
@@ -486,3 +474,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL SwFilterDetect::impl_createInstance( cons
return UNOREFERENCE< UNOXINTERFACE >( *new SwFilterDetect( xServiceManager ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/swdetect.hxx b/sw/source/ui/uno/swdetect.hxx
index 507d6eb0c386..124a443025cf 100644
--- a/sw/source/ui/uno/swdetect.hxx
+++ b/sw/source/ui/uno/swdetect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#define _SW_TYPEDETECT_HXX
#include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -93,3 +94,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index f763792a3ef9..b6d75ec18d08 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,8 +33,8 @@
#define _SVSTDARR_STRINGS
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <vos/mutex.hxx>
-#include <tools/debug.hxx>
+#include <osl/mutex.hxx>
+#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
#include <svl/svstdarr.hxx>
#include <svtools/unoevent.hxx>
@@ -60,9 +61,8 @@
#include <swmodule.hxx>
#include <svl/smplhint.hxx>
#include <svl/macitem.hxx>
-
#include <editeng/acorrcfg.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -70,67 +70,48 @@ SV_IMPL_REF ( SwDocShell )
using namespace ::com::sun::star;
using ::rtl::OUString;
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------30.03.99 14:31-------------------
- *
- * --------------------------------------------------*/
uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & ) throw( uno::Exception )
{
//the module may not be loaded
- ::vos::OGuard aGuard(Application::GetSolarMutex());
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
static uno::Reference< uno::XInterface > xAText = (cppu::OWeakObject*)new SwXAutoTextContainer();;
return xAText;
}
-/* -----------------------------17.04.01 13:17--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw()
{
OUString sService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.AutoTextContainer"));
const uno::Sequence< OUString > aSeq( &sService, 1 );
return aSeq;
}
-/* -----------------------------17.04.01 13:18--------------------------------
- ---------------------------------------------------------------------------*/
OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM("SwXAutoTextContainer" ) );
}
-/*-- 21.12.98 12:42:16---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoTextContainer::SwXAutoTextContainer()
{
pGlossaries = ::GetGlossaries();
}
-/*-- 21.12.98 12:42:17---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoTextContainer::~SwXAutoTextContainer()
{
}
-/*-- 21.12.98 12:42:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXAutoTextContainer::getCount(void) throw( uno::RuntimeException )
{
return pGlossaries->GetGroupCnt();
}
-/*-- 21.12.98 12:42:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
sal_uInt16 nCount = pGlossaries->GetGroupCnt();
if ( 0 <= nIndex && nIndex < nCount )
@@ -139,29 +120,23 @@ uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex)
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 21.12.98 12:42:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXAutoTextContainer::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<text::XAutoTextGroup>*)0);
}
-/*-- 21.12.98 12:42:18---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoTextContainer::hasElements(void) throw( uno::RuntimeException )
{
//zumindest Standard sollte es immer geben!
return sal_True;
}
-/*-- 21.12.98 12:42:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoTextContainer::getByName(const OUString& GroupName)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XAutoTextGroup > xGroup;
if ( pGlossaries && hasByName( GroupName ) ) // group name already known?
@@ -173,12 +148,10 @@ uno::Any SwXAutoTextContainer::getByName(const OUString& GroupName)
return makeAny( xGroup );
}
-/*-- 21.12.98 12:42:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextContainer::getElementNames(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = pGlossaries->GetGroupCnt();
uno::Sequence< OUString > aGroupNames(nCount);
@@ -192,26 +165,24 @@ uno::Sequence< OUString > SwXAutoTextContainer::getElementNames(void) throw( uno
}
return aGroupNames;
}
-/*-- 21.12.98 12:42:19---------------------------------------------------
+/*-----------------------------------------------------------------------
findet Gruppennamen mit und ohne Pfadindex
-----------------------------------------------------------------------*/
sal_Bool SwXAutoTextContainer::hasByName(const OUString& Name)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String sGroupName( pGlossaries->GetCompleteGroupName( Name ) );
if(sGroupName.Len())
return sal_True;
return sal_False;
}
-/*-- 21.12.98 12:42:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XAutoTextGroup > SwXAutoTextContainer::insertNewByName(
const OUString& aGroupName)
throw( lang::IllegalArgumentException, container::ElementExistException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(hasByName(aGroupName))
throw container::ElementExistException();
//check for non-ASCII characters
@@ -246,34 +217,28 @@ uno::Reference< text::XAutoTextGroup > SwXAutoTextContainer::insertNewByName(
pGlossaries->NewGroupDoc(sGroup, sGroup.GetToken(0, GLOS_DELIM));
uno::Reference< text::XAutoTextGroup > xGroup = pGlossaries->GetAutoTextGroup( sGroup, true );
- DBG_ASSERT( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How this?" );
+ OSL_ENSURE( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How this?" );
// we just inserted the group into the glossaries, so why doesn't it exist?
return xGroup;
}
-/*-- 21.12.98 12:42:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextContainer::removeByName(const OUString& aGroupName)
throw( container::NoSuchElementException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
//zunaechst den Namen mit Pfad-Extension finden
String sGroupName = pGlossaries->GetCompleteGroupName( aGroupName );
if(!sGroupName.Len())
throw container::NoSuchElementException();
pGlossaries->DelGroupDoc(sGroupName);
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeException )
{
return SwXAutoTextContainer_getImplementationName();
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
const uno::Sequence< OUString > aNames = SwXAutoTextContainer_getSupportedServiceNames();
@@ -284,27 +249,22 @@ sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) thr
}
return sal_False;
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
return SwXAutoTextContainer_getSupportedServiceNames();
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXAutoTextGroupUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextGroupUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextGroup::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextGroupUnoTunnelId::get().getSeq();
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -317,9 +277,6 @@ sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8
return 0;
}
-/*-- 21.12.98 12:42:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName,
SwGlossaries* pGlos) :
pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_AUTO_TEXT_GROUP)),
@@ -327,25 +284,17 @@ SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName,
sName(rName),
m_sGroupName(rName)
{
- DBG_ASSERT( -1 != rName.indexOf( GLOS_DELIM ),
+ OSL_ENSURE( -1 != rName.indexOf( GLOS_DELIM ),
"SwXAutoTextGroup::SwXAutoTextGroup: to be constructed with a complete name only!" );
}
-/*-- 21.12.98 12:42:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoTextGroup::~SwXAutoTextGroup()
{
}
-/*-- 21.12.98 12:42:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextGroup::getTitles(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = 0;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
if(pGlosGroup && !pGlosGroup->GetError())
@@ -361,15 +310,13 @@ uno::Sequence< OUString > SwXAutoTextGroup::getTitles(void) throw( uno::RuntimeE
delete pGlosGroup;
return aEntryTitles;
}
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::renameByName(const OUString& aElementName,
const OUString& aNewElementName, const OUString& aNewElementTitle)
throw( lang::IllegalArgumentException, container::ElementExistException, io::IOException,
uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// throw exception only if the programmatic name is to be changed into an existing name
if(aNewElementName != aElementName && hasByName(aNewElementName))
throw container::ElementExistException();
@@ -400,7 +347,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName,
sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextRange* pxRange)
{
- ASSERT( pInsDoc, "kein Ins.Dokument" );
+ OSL_ENSURE( pInsDoc, "no InsDoc");
SwNodes& rNds = pInsDoc->GetNodes();
@@ -435,14 +382,12 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR
return bRet;
}
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const OUString& aName,
const OUString& aTitle, const uno::Reference< text::XTextRange > & xTextRange)
throw( container::ElementExistException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(hasByName(aName))
throw container::ElementExistException();
if(!xTextRange.is())
@@ -453,10 +398,6 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
String sLongName(aTitle);
if(pGlosGroup && !pGlosGroup->GetError())
{
- /*if( pGlosGroup->IsOld() && pGlosGroup->ConvertToNew())
- {
- throw uno::RuntimeException();
- } */
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
SwXTextRange* pxRange = 0;
OTextCursorHelper* pxCursor = 0;
@@ -477,12 +418,12 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwDoc* pGDoc = pGlosGroup->GetDoc();
// Bis es eine Option dafuer gibt, base util::URL loeschen
- if(pCfg->IsSaveRelFile())
+ if(rCfg.IsSaveRelFile())
{
INetURLObject aTemp(pGlosGroup->GetFileName());
pGlosGroup->SetBaseURL( aTemp.GetMainURL(INetURLObject::NO_DECODE));
@@ -515,17 +456,15 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
}
uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, sName, sShortName, true );
- DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" );
+ OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" );
// we just inserted the entry into the group, so why doesn't it exist?
return xEntry;
}
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::removeByName(const OUString& aEntryName) throw( container::NoSuchElementException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
if(pGlosGroup && !pGlosGroup->GetError())
{
@@ -537,20 +476,16 @@ void SwXAutoTextGroup::removeByName(const OUString& aEntryName) throw( container
else
throw container::NoSuchElementException();
}
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXAutoTextGroup::getName(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return sName;
}
-/*-- 21.12.98 12:42:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( !pGlossaries )
throw uno::RuntimeException();
@@ -593,12 +528,10 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti
pGlossaries = pTempGlossaries;
}
}
-/*-- 21.12.98 12:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXAutoTextGroup::getCount(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
int nCount = 0;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
if(pGlosGroup && !pGlosGroup->GetError())
@@ -608,13 +541,11 @@ sal_Int32 SwXAutoTextGroup::getCount(void) throw( uno::RuntimeException )
delete pGlosGroup;
return nCount;
}
-/*-- 21.12.98 12:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoTextGroup::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
sal_uInt16 nCount = 0;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
@@ -629,20 +560,16 @@ uno::Any SwXAutoTextGroup::getByIndex(sal_Int32 nIndex)
delete pGlosGroup;
return aRet;
}
-/*-- 21.12.98 12:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXAutoTextGroup::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((uno::Reference<text::XAutoTextEntry>*)0);
}
-/*-- 21.12.98 12:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
sal_uInt16 nCount = 0;
if(pGlosGroup && !pGlosGroup->GetError())
@@ -653,25 +580,21 @@ sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException )
return nCount > 0;
}
-/*-- 21.12.98 12:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoTextGroup::getByName(const OUString& _rName)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, sName, _rName, true );
- DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" );
+ OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" );
// we told it to create the object, so why didn't it?
return makeAny( xEntry );
}
-/*-- 21.12.98 12:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = 0;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
if(pGlosGroup && !pGlosGroup->GetError())
@@ -687,13 +610,11 @@ uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void)
delete pGlosGroup;
return aEntryNames;
}
-/*-- 21.12.98 12:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
sal_uInt16 nCount = 0;
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0;
@@ -715,24 +636,19 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName)
return bRet;
}
-/*-- 09.02.00 15:33:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXAutoTextGroup::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRet = pPropSet->getPropertySetInfo();
return xRet;
}
-/*-- 09.02.00 15:33:31---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::setPropertyValue(
const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName );
if(!pEntry)
@@ -758,13 +674,11 @@ void SwXAutoTextGroup::setPropertyValue(
}
delete pGlosGroup;
}
-/*-- 09.02.00 15:33:31---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoTextGroup::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName);
if(!pEntry)
@@ -786,64 +700,48 @@ uno::Any SwXAutoTextGroup::getPropertyValue(const OUString& rPropertyName)
delete pGlosGroup;
return aAny;
}
-/*-- 09.02.00 15:33:31---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::addPropertyChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 09.02.00 15:33:31---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::removePropertyChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 09.02.00 15:33:32---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::addVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 09.02.00 15:33:32---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
}
-/*-- 21.12.98 12:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextGroup::Invalidate()
{
pGlossaries = 0;
sName = aEmptyStr;
m_sGroupName = aEmptyStr;
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXAutoTextGroup::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXAutoTextGroup");
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.AutoTextGroup") == rServiceName;
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -851,20 +749,17 @@ uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.AutoTextGroup");
return aRet;
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXAutoTextEntryUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextEntryUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextEntryUnoTunnelId::get().getSeq();
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -876,9 +771,7 @@ sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8
}
return 0;
}
-/*-- 21.12.98 12:42:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoTextEntry::SwXAutoTextEntry(SwGlossaries* pGlss, const String& rGroupName,
const String& rEntryName) :
pGlossaries(pGlss),
@@ -887,13 +780,11 @@ SwXAutoTextEntry::SwXAutoTextEntry(SwGlossaries* pGlss, const String& rGroupName
pBodyText ( NULL )
{
}
-/*-- 21.12.98 12:42:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoTextEntry::~SwXAutoTextEntry()
{
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// ensure that any pending modifications are written
implFlushDocument( true );
@@ -905,9 +796,6 @@ SwXAutoTextEntry::~SwXAutoTextEntry()
}
}
-//---------------------------------------------------------------------
-//--- 03.03.2003 13:24:58 -----------------------------------------------
-
void SwXAutoTextEntry::implFlushDocument( bool _bCloseDoc )
{
if ( xDocSh.Is() )
@@ -926,9 +814,6 @@ void SwXAutoTextEntry::implFlushDocument( bool _bCloseDoc )
}
}
-//-----------------------------------------------------------------------
-//--- 03.03.2003 15:51:52 -----------------------------------------------
-
void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
{
if ( &_rBC == &xDocSh )
@@ -959,10 +844,10 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
void SwXAutoTextEntry::GetBodyText ()
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
xDocSh = pGlossaries->EditGroupDoc ( sGroupName, sEntryName, sal_False );
- DBG_ASSERT( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by EditGroupDoc!" );
+ OSL_ENSURE( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by EditGroupDoc!" );
// start listening at the document
StartListening( *&xDocSh );
@@ -973,114 +858,92 @@ void SwXAutoTextEntry::GetBodyText ()
uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursor(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
return pBodyText->createTextCursor();
}
-/*-- 21.12.98 12:42:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursorByRange(
const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
return pBodyText->createTextCursorByRange ( aTextPosition );
}
-/*-- 21.12.98 12:42:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextEntry::insertString(const uno::Reference< text::XTextRange > & xRange, const OUString& aString, sal_Bool bAbsorb) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
pBodyText->insertString ( xRange, aString, bAbsorb );
}
-/*-- 21.12.98 12:42:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextEntry::insertControlCharacter(const uno::Reference< text::XTextRange > & xRange,
sal_Int16 nControlCharacter, sal_Bool bAbsorb)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
pBodyText->insertControlCharacter ( xRange, nControlCharacter, bAbsorb );
}
-/*-- 21.12.98 12:42:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextEntry::insertTextContent(
const uno::Reference< text::XTextRange > & xRange,
const uno::Reference< text::XTextContent > & xContent, sal_Bool bAbsorb)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
pBodyText->insertTextContent ( xRange, xContent, bAbsorb );
}
-/*-- 21.12.98 12:42:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextEntry::removeTextContent(
const uno::Reference< text::XTextContent > & xContent)
throw( container::NoSuchElementException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
pBodyText->removeTextContent ( xContent );
}
-/*-- 21.12.98 12:42:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXAutoTextEntry::getText(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XText > xRet = (text::XText*)this;
return xRet;
}
-/*-- 21.12.98 12:42:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXAutoTextEntry::getStart(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
return pBodyText->getStart();
}
-/*-- 21.12.98 12:42:36---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXAutoTextEntry::getEnd(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
return pBodyText->getEnd();
}
-/*-- 21.12.98 12:42:36---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXAutoTextEntry::getString(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
return pBodyText->getString();
}
-/*-- 21.12.98 12:42:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXAutoTextEntry::setString(const OUString& aString) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
EnsureBodyText();
pBodyText->setString( aString );
}
-/* -----------------15.07.99 10:11-------------------
- --------------------------------------------------*/
void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextRange)throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// ensure that any pending modifications are written
// reason is that we're holding the _copy_ of the auto text, while the real auto text
@@ -1149,23 +1012,17 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR
if(!bResult)
throw uno::RuntimeException();
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXAutoTextEntry::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXAutoTextEntry");
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.AutoTextEntry") == rServiceName;
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1173,17 +1030,13 @@ uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.AutoTextEntry");
return aRet;
}
-/* -----------------------------06.04.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< container::XNameReplace > SwXAutoTextEntry::getEvents()
throw( uno::RuntimeException )
{
return new SwAutoTextEventDescriptor( *this );
}
-/* -----------------------------30.01.01 18:40--------------------------------
- ---------------------------------------------------------------------------*/
const struct SvEventDescription aAutotextEvents[] =
{
{ SW_EVENT_START_INS_GLOSSARY, "OnInsertStart" },
@@ -1191,9 +1044,6 @@ const struct SvEventDescription aAutotextEvents[] =
{ 0, NULL }
};
-/* -----------------------------30.01.01 18:40--------------------------------
-
- ---------------------------------------------------------------------------*/
SwAutoTextEventDescriptor::SwAutoTextEventDescriptor(
SwXAutoTextEntry& rAutoText ) :
SvBaseEventDescriptor(aAutotextEvents),
@@ -1202,23 +1052,17 @@ SwAutoTextEventDescriptor::SwAutoTextEventDescriptor(
rAutoTextEntry(rAutoText)
{
}
-/* -----------------------------30.01.01 18:40--------------------------------
- ---------------------------------------------------------------------------*/
SwAutoTextEventDescriptor::~SwAutoTextEventDescriptor()
{
}
-/* -----------------------------30.01.01 18:40--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwAutoTextEventDescriptor::getImplementationName()
throw( uno::RuntimeException )
{
return sSwAutoTextEventDescriptor;
}
-/* -----------------------------30.01.01 18:40--------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoTextEventDescriptor::replaceByName(
const sal_uInt16 nEvent,
const SvxMacro& rMacro)
@@ -1228,16 +1072,16 @@ void SwAutoTextEventDescriptor::replaceByName(
lang::WrappedTargetException,
uno::RuntimeException)
{
- DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(),
+ OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(),
"Strangely enough, the AutoText vanished!" );
- DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
+ OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
(nEvent == SW_EVENT_START_INS_GLOSSARY) ,
"Unknown event ID" );
const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries();
SwTextBlocks* pBlocks =
pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() );
- DBG_ASSERT( NULL != pBlocks,
+ OSL_ENSURE( NULL != pBlocks,
"can't get autotext group; SwAutoTextEntry has illegal name?");
if( pBlocks && !pBlocks->GetError())
@@ -1258,9 +1102,7 @@ void SwAutoTextEventDescriptor::replaceByName(
}
// else: ignore
}
-/* -----------------------------30.01.01 18:40--------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoTextEventDescriptor::getByName(
SvxMacro& rMacro,
const sal_uInt16 nEvent )
@@ -1269,15 +1111,15 @@ void SwAutoTextEventDescriptor::getByName(
lang::WrappedTargetException,
uno::RuntimeException)
{
- DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" );
- DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
+ OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" );
+ OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
(nEvent == SW_EVENT_START_INS_GLOSSARY) ,
"Unknown event ID" );
const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries();
SwTextBlocks* pBlocks =
pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() );
- DBG_ASSERT( NULL != pBlocks,
+ OSL_ENSURE( NULL != pBlocks,
"can't get autotext group; SwAutoTextEntry has illegal name?");
// return empty macro, unless macro is found
@@ -1306,3 +1148,4 @@ void SwAutoTextEventDescriptor::getByName(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx
index 87104a4fd4cb..3061183215ad 100644
--- a/sw/source/ui/uno/unodefaults.cxx
+++ b/sw/source/ui/uno/unodefaults.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,23 +35,16 @@
#include <svx/unoprov.hxx>
#include <doc.hxx>
-/* -----------------------------13.03.01 14:16--------------------------------
-
- ---------------------------------------------------------------------------*/
SwSvxUnoDrawPool::SwSvxUnoDrawPool( SwDoc* pDoc ) throw() :
SvxUnoDrawPool(pDoc->GetDrawModel(), SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER),
m_pDoc(pDoc)
{
}
-/* -----------------------------13.03.01 14:16--------------------------------
- ---------------------------------------------------------------------------*/
SwSvxUnoDrawPool::~SwSvxUnoDrawPool() throw()
{
}
-/* -----------------------------13.03.01 14:16--------------------------------
- ---------------------------------------------------------------------------*/
SfxItemPool* SwSvxUnoDrawPool::getModelPool( sal_Bool /*bReadOnly*/ ) throw()
{
if(m_pDoc)
@@ -60,13 +54,11 @@ SfxItemPool* SwSvxUnoDrawPool::getModelPool( sal_Bool /*bReadOnly*/ ) throw()
// it contains draw model item pool as secondary pool.
//SdrModel* pModel = m_pDoc->MakeDrawModel();
//return &pModel->GetItemPool();
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
m_pDoc->GetOrCreateDrawModel();
- // <--
return &(m_pDoc->GetAttrPool());
}
return 0;
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unodefaults.hxx b/sw/source/ui/uno/unodefaults.hxx
index eda851f1c8b5..2f61e566231a 100644
--- a/sw/source/ui/uno/unodefaults.hxx
+++ b/sw/source/ui/uno/unodefaults.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index 7f0347ac8bf7..32618ed9115f 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/dataaccessdescriptor.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <unodispatch.hxx>
#include <unobaseclass.hxx>
#include <view.hxx>
@@ -42,8 +43,8 @@
using namespace ::com::sun::star;
-using namespace rtl;
-using namespace vos;
+
+using ::rtl::OUString;
const char* cURLStart = ".uno:DataSourceBrowser/";
const char* cURLFormLetter = ".uno:DataSourceBrowser/FormLetter";
@@ -51,9 +52,7 @@ const char* cURLInsertContent = ".uno:DataSourceBrowser/InsertContent";//data
const char* cURLInsertColumns = ".uno:DataSourceBrowser/InsertColumns";//data into text
const char* cURLDocumentDataSource = ".uno:DataSourceBrowser/DocumentDataSource";//current data source of the document
const sal_Char* cInternalDBChangeNotification = ".uno::Writer/DataSourceChanged";
-/*-- 07.11.00 13:25:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) :
m_pView(&rVw)
{
@@ -71,15 +70,11 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) :
m_refCount--;
}
}
-/*-- 07.11.00 13:25:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDispatchProviderInterceptor::~SwXDispatchProviderInterceptor()
{
}
-/*-- 07.11.00 13:25:51---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch(
const util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags )
throw(uno::RuntimeException)
@@ -106,9 +101,7 @@ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch
return xResult;
}
-/*-- 07.11.00 13:25:52---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Reference< frame::XDispatch > > SwXDispatchProviderInterceptor::queryDispatches(
const uno::Sequence< frame::DispatchDescriptor >& aDescripts ) throw(uno::RuntimeException)
{
@@ -123,45 +116,35 @@ uno::Sequence< uno::Reference< frame::XDispatch > > SwXDispatchProviderIntercept
}
return aReturn;
}
-/*-- 07.11.00 13:25:52---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< frame::XDispatchProvider > SwXDispatchProviderInterceptor::getSlaveDispatchProvider( )
throw(uno::RuntimeException)
{
DispatchMutexLock_Impl aLock(*this);
return m_xSlaveDispatcher;
}
-/*-- 07.11.00 13:25:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatchProviderInterceptor::setSlaveDispatchProvider(
const uno::Reference< frame::XDispatchProvider >& xNewDispatchProvider ) throw(uno::RuntimeException)
{
DispatchMutexLock_Impl aLock(*this);
m_xSlaveDispatcher = xNewDispatchProvider;
}
-/*-- 07.11.00 13:25:52---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< frame::XDispatchProvider > SwXDispatchProviderInterceptor::getMasterDispatchProvider( )
throw(uno::RuntimeException)
{
DispatchMutexLock_Impl aLock(*this);
return m_xMasterDispatcher;
}
-/*-- 07.11.00 13:25:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatchProviderInterceptor::setMasterDispatchProvider(
const uno::Reference< frame::XDispatchProvider >& xNewSupplier ) throw(uno::RuntimeException)
{
DispatchMutexLock_Impl aLock(*this);
m_xMasterDispatcher = xNewSupplier;
}
-/*-- 07.11.00 13:25:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& )
throw(uno::RuntimeException)
{
@@ -176,17 +159,17 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& )
}
m_xIntercepted = NULL;
}
-/* -----------------------------01.10.2001 14:31------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXDispatchProviderInterceptorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDispatchProviderInterceptorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDispatchProviderInterceptorUnoTunnelId::get().getSeq();
}
-/* -----------------------------01.10.2001 14:31------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SwXDispatchProviderInterceptor::getSomething(
const uno::Sequence< sal_Int8 >& aIdentifier )
throw(uno::RuntimeException)
@@ -199,9 +182,7 @@ sal_Int64 SwXDispatchProviderInterceptor::getSomething(
}
return 0;
}
-/* -----------------------------01.10.2001 14:32------------------------------
- ---------------------------------------------------------------------------*/
void SwXDispatchProviderInterceptor::Invalidate()
{
DispatchMutexLock_Impl aLock(*this);
@@ -216,18 +197,14 @@ void SwXDispatchProviderInterceptor::Invalidate()
m_xIntercepted = NULL;
m_pView = 0;
}
-/* -----------------------------07.11.00 14:26--------------------------------
- ---------------------------------------------------------------------------*/
SwXDispatch::SwXDispatch(SwView& rVw) :
m_pView(&rVw),
m_bOldEnable(sal_False),
m_bListenerAdded(sal_False)
{
}
-/*-- 07.11.00 14:26:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDispatch::~SwXDispatch()
{
if(m_bListenerAdded && m_pView)
@@ -237,9 +214,7 @@ SwXDispatch::~SwXDispatch()
xSupplier->removeSelectionChangeListener(xThis);
}
}
-/*-- 07.11.00 14:26:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatch::dispatch(
const util::URL& aURL, const uno::Sequence< beans::PropertyValue >& aArgs ) throw(uno::RuntimeException)
{
@@ -264,11 +239,10 @@ void SwXDispatch::dispatch(
FN_MAILMERGE_WIZARD,
SFX_CALLMODE_ASYNCHRON,
&aDBProperties, 0L);
-// pNewDBMgr->ExecuteFormLetter(rSh, aArgs);
}
else if(!aURL.Complete.compareToAscii(cURLDocumentDataSource))
{
- OSL_ENSURE(sal_False, "SwXDispatch::dispatch: this URL is not to be dispatched!");
+ OSL_FAIL("SwXDispatch::dispatch: this URL is not to be dispatched!");
}
else if(!aURL.Complete.compareToAscii(cInternalDBChangeNotification))
{
@@ -300,9 +274,7 @@ void SwXDispatch::dispatch(
throw uno::RuntimeException();
}
-/*-- 07.11.00 14:26:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatch::addStatusListener(
const uno::Reference< frame::XStatusListener >& xControl, const util::URL& aURL ) throw(uno::RuntimeException)
{
@@ -351,9 +323,7 @@ void SwXDispatch::addStatusListener(
m_bListenerAdded = sal_True;
}
}
-/*-- 07.11.00 14:26:15---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXDispatch::removeStatusListener(
const uno::Reference< frame::XStatusListener >& xControl, const util::URL& ) throw(uno::RuntimeException)
{
@@ -375,9 +345,7 @@ void SwXDispatch::removeStatusListener(
m_bListenerAdded = sal_False;
}
}
-/* -----------------------------07.03.01 10:27--------------------------------
- ---------------------------------------------------------------------------*/
void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::RuntimeException)
{
ShellModes eMode = m_pView->GetShellMode();
@@ -403,9 +371,7 @@ void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::Runti
}
}
}
-/* -----------------------------07.03.01 10:46--------------------------------
- ---------------------------------------------------------------------------*/
void SwXDispatch::disposing( const lang::EventObject& rSource ) throw(uno::RuntimeException)
{
uno::Reference<view::XSelectionSupplier> xSupplier(rSource.Source, uno::UNO_QUERY);
@@ -423,26 +389,20 @@ void SwXDispatch::disposing( const lang::EventObject& rSource ) throw(uno::Runti
}
m_pView = 0;
}
-/* -----------------------------12.07.01 13:30--------------------------------
- ---------------------------------------------------------------------------*/
const sal_Char* SwXDispatch::GetDBChangeURL()
{
return cInternalDBChangeNotification;
}
-/* -----------------------------09.09.2002 08:48------------------------------
- ---------------------------------------------------------------------------*/
SwXDispatchProviderInterceptor::DispatchMutexLock_Impl::DispatchMutexLock_Impl(
SwXDispatchProviderInterceptor& ) :
-// aGuard(rInterceptor.m_aMutex) #102295# solar mutex has to be used currently
aGuard(Application::GetSolarMutex())
{
}
-/* -----------------------------09.09.2002 08:48------------------------------
- ---------------------------------------------------------------------------*/
SwXDispatchProviderInterceptor::DispatchMutexLock_Impl::~DispatchMutexLock_Impl()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx
index 3558b5391a06..e85dfead75ec 100644
--- a/sw/source/ui/uno/unodoc.cxx
+++ b/sw/source/ui/uno/unodoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@
#include "docsh.hxx"
#include "globdoc.hxx"
#include "wdocsh.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -64,8 +65,8 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags )
throw( uno::Exception )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -93,8 +94,8 @@ uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & )
throw( uno::Exception )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -120,9 +121,10 @@ uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
const uno::Reference< lang::XMultiServiceFactory > &)
throw( uno::Exception )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unofreg.cxx b/sw/source/ui/uno/unofreg.cxx
index a76aaa3cd0e5..ebf6701154ae 100644
--- a/sw/source/ui/uno/unofreg.cxx
+++ b/sw/source/ui/uno/unofreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,10 +39,11 @@
#define INCLUDED_STRING_H
#endif
-using namespace rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
+using ::rtl::OUString;
+
// module
extern uno::Sequence< OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() throw();
extern OUString SAL_CALL SwUnoModule_getImplementationName() throw();
@@ -128,7 +130,12 @@ extern uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames(
extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
extern uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-// --> OD 2007-05-24 #i73788#
+// Layout dump filter
+extern uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw();
+extern OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw();
+extern uno::Reference< uno::XInterface > SAL_CALL LayoutDumpFilter_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr ) throw( uno::Exception );
+
+// #i73788#
#include "cppuhelper/implementationentry.hxx"
namespace comp_FinalThreadManager {
@@ -139,9 +146,7 @@ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL _crea
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context );
}
-// <--
-//
#ifdef __cplusplus
extern "C"
{
@@ -360,14 +365,20 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
SwUnoModule_createInstance,
SwUnoModule_getSupportedServiceNames() );
}
- // --> OD 2007-05-24 #i73788#
+ else if( LayoutDumpFilter_getImplementationName().equalsAsciiL(
+ pImplName, nImplNameLen ) )
+ {
+ xFactory = ::cppu::createSingleFactory( xMSF,
+ LayoutDumpFilter_getImplementationName(),
+ LayoutDumpFilter_createInstance,
+ LayoutDumpFilter_getSupportedServiceNames() );
+ }
else if( comp_FinalThreadManager::_getImplementationName().equalsAsciiL(
pImplName, nImplNameLen ) )
{
pRet = ::cppu::component_getFactoryHelper(
pImplName, pServiceManager, pRegistryKey, entries);
}
- // <--
if( xFactory.is())
{
@@ -381,3 +392,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
#ifdef __cplusplus
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 1c4a838ae1ca..e7fd53293082 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
#include <osl/mutex.hxx>
#include <svl/itemprop.hxx>
#include <svl/urihelper.hxx>
@@ -54,9 +54,7 @@
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/util/XCloseable.hpp>
-#ifndef _COM_SUN_STAR_UTIL_CloseVetoException_HPP_
#include <com/sun/star/util/CloseVetoException.hpp>
-#endif
#include <com/sun/star/sdbcx/XRowLocate.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include "com/sun/star/mail/XSmtpService.hpp"
@@ -70,9 +68,7 @@
#include <unomap.hxx>
#include <swunohelper.hxx>
#include <docsh.hxx>
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
#include <IDocumentDeviceAccess.hxx>
-#endif
#include <view.hxx>
#include <dbmgr.hxx>
#include <unotxdoc.hxx>
@@ -244,7 +240,6 @@ namespace
DelayedFileDeletion& operator=( const DelayedFileDeletion& ); // never implemented
};
- DBG_NAME( DelayedFileDeletion )
//------------------------------------------------------
DelayedFileDeletion::DelayedFileDeletion( const Reference< XModel >& _rxModel, const String& _rTemporaryFile )
:
@@ -252,8 +247,6 @@ namespace
,m_sTemporaryFile( _rTemporaryFile )
,m_nPendingDeleteAttempts( 0 )
{
- DBG_CTOR( DelayedFileDeletion, NULL );
-
osl_incrementInterlockedCount( &m_refCount );
try
{
@@ -264,12 +257,12 @@ namespace
acquire();
}
else {
- DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: model is no component!" );
+ OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: model is no component!" );
}
}
catch( const Exception& )
{
- DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" );
+ OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" );
}
osl_decrementInterlockedCount( &m_refCount );
}
@@ -302,7 +295,7 @@ namespace
}
catch( const Exception& )
{
- DBG_ERROR( "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" );
+ OSL_FAIL("DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" );
bSuccess = sal_True;
// can't do anything here ...
}
@@ -326,7 +319,7 @@ namespace
}
catch( const Exception & )
{
- DBG_ERROR( "DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" );
+ OSL_FAIL("DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" );
}
m_aDeleteTimer.SetTimeout( 3000 ); // 3 seconds
@@ -350,7 +343,7 @@ namespace
//--------------------------------------------------------------------
void SAL_CALL DelayedFileDeletion::notifyClosing( const EventObject& ) throw (RuntimeException)
{
- DBG_ERROR( "DelayedFileDeletion::notifyClosing: how this?" );
+ OSL_FAIL("DelayedFileDeletion::notifyClosing: how this?" );
// this should not happen:
// Either, a foreign instance closes the document, then we should veto this, and take the ownership
// Or, we ourself close the document, then we should not be a listener anymore
@@ -359,7 +352,7 @@ namespace
//------------------------------------------------------
void SAL_CALL DelayedFileDeletion::disposing( const EventObject& ) throw (RuntimeException)
{
- DBG_ERROR( "DelayedFileDeletion::disposing: how this?" );
+ OSL_FAIL("DelayedFileDeletion::disposing: how this?" );
// this should not happen:
// Either, a foreign instance closes the document, then we should veto this, and take the ownership
// Or, we ourself close the document, then we should not be a listener anymore
@@ -368,7 +361,6 @@ namespace
//------------------------------------------------------
DelayedFileDeletion::~DelayedFileDeletion( )
{
- DBG_DTOR( DelayedFileDeletion, NULL );
}
}
@@ -452,7 +444,7 @@ SwXMailMerge::~SwXMailMerge()
//! because there is no automatism that will do that later.
//! #120086#
if ( eVetoed == CloseModelAndDocSh( xModel, xDocSh ) )
- DBG_WARNING( "owner ship transfered to vetoing object!" );
+ OSL_FAIL("owner ship transfered to vetoing object!" );
xModel = 0;
xDocSh = 0; // destroy doc shell
@@ -463,7 +455,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
const uno::Sequence< beans::NamedValue >& rArguments )
throw (IllegalArgumentException, Exception, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
//
// get property values to be used
@@ -643,7 +635,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
{
if (!aCurDataSourceName.getLength() || !aCurDataCommand.getLength() )
{
- DBG_ERROR("PropertyValues missing or unset");
+ OSL_FAIL("PropertyValues missing or unset");
throw IllegalArgumentException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Either the ResultSet or DataSourceName and DataCommand must be set." ) ), static_cast < cppu::OWeakObject * > ( this ), 0 );
}
@@ -657,7 +649,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
C2U( "com.sun.star.sdb.RowSet" ));
aRowSetDisposeHelper.reset( xInstance, SharedComponent::TakeOwnership );
Reference< XPropertySet > xRowSetPropSet( xInstance, UNO_QUERY );
- DBG_ASSERT( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" );
+ OSL_ENSURE( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" );
if (xRowSetPropSet.is())
{
if (xCurConnection.is())
@@ -675,7 +667,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
if( !xCurConnection.is() )
xCurConnection.set( xRowSetPropSet->getPropertyValue( C2U( "ActiveConnection" )), UNO_QUERY );
xCurResultSet = Reference< sdbc::XResultSet >( xRowSet, UNO_QUERY );
- DBG_ASSERT( xCurResultSet.is(), "failed to build ResultSet" );
+ OSL_ENSURE( xCurResultSet.is(), "failed to build ResultSet" );
}
}
}
@@ -704,7 +696,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
SwNewDBMgr* pMgr = rSh.GetNewDBMgr();
//force layout creation
rSh.CalcLayout();
- DBG_ASSERT( pMgr, "database manager missing" );
+ OSL_ENSURE( pMgr, "database manager missing" );
SwMergeDescriptor aMergeDesc( nMergeType, rSh, aDescriptor );
@@ -736,7 +728,6 @@ uno::Any SAL_CALL SwXMailMerge::execute(
aCurFileNamePrefix = aURLObj.GetBase(); // filename without extension
if (!aCurOutputURL.getLength())
{
- //aCurOutputURL = aURLObj.GetURLPath();
aURLObj.removeSegment();
aCurOutputURL = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
}
@@ -769,7 +760,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
aMergeDesc.aSaveToFilterData = aSaveFilterData;
aMergeDesc.bCreateSingleFile = bSaveAsSingleFile;
}
- else /*if(MailMergeType::MAIL == nCurOutputType)*/
+ else
{
pMgr->SetEMailColumn( sAddressFromColumn );
if(!sAddressFromColumn.getLength())
@@ -823,7 +814,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
pMgr->SetMergeSilent( sal_True ); // suppress dialogs, message boxes, etc.
const SwXMailMerge *pOldSrc = pMgr->GetMailMergeEvtSrc();
- DBG_ASSERT( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
+ OSL_ENSURE( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh));
@@ -882,7 +873,7 @@ void SwXMailMerge::launchEvent( const PropertyChangeEvent &rEvt ) const
uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXMailMerge::getPropertySetInfo( )
throw (RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
static Reference< XPropertySetInfo > aRef = pPropSet->getPropertySetInfo();
return aRef;
}
@@ -891,7 +882,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue )
throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName );
if (!pCur)
@@ -936,7 +927,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue(
case WID_IN_SERVER_PASSWORD: pData = &sInServerPassword; break;
case WID_OUT_SERVER_PASSWORD: pData = &sOutServerPassword; break;
default :
- DBG_ERROR("unknown WID");
+ OSL_FAIL("unknown WID");
}
Any aOld( pData, *pType );
@@ -1025,9 +1016,9 @@ void SAL_CALL SwXMailMerge::setPropertyValue(
else if(pData == &sOutServerPassword)
bOK = rValue >>= sInServerPassword;
else {
- DBG_ERROR( "invalid pointer" );
+ OSL_FAIL("invalid pointer" );
}
- DBG_ASSERT( bOK, "set value failed" );
+ OSL_ENSURE( bOK, "set value failed" );
bChanged = sal_True;
}
if (!bOK)
@@ -1046,7 +1037,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue(
const OUString& rPropertyName )
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Any aRet;
@@ -1089,7 +1080,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue(
case WID_IN_SERVER_PASSWORD: aRet <<= sInServerPassword; break;
case WID_OUT_SERVER_PASSWORD: aRet <<= sOutServerPassword; break;
default :
- DBG_ERROR("unknown WID");
+ OSL_FAIL("unknown WID");
}
}
@@ -1101,7 +1092,7 @@ void SAL_CALL SwXMailMerge::addPropertyChangeListener(
const uno::Reference< beans::XPropertyChangeListener >& rListener )
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rListener.is())
{
const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName );
@@ -1117,7 +1108,7 @@ void SAL_CALL SwXMailMerge::removePropertyChangeListener(
const uno::Reference< beans::XPropertyChangeListener >& rListener )
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rListener.is())
{
const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName );
@@ -1134,7 +1125,7 @@ void SAL_CALL SwXMailMerge::addVetoableChangeListener(
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
// no vetoable property, thus no support for vetoable change listeners
- DBG_WARNING( "not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL SwXMailMerge::removeVetoableChangeListener(
@@ -1143,14 +1134,14 @@ void SAL_CALL SwXMailMerge::removeVetoableChangeListener(
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
// no vetoable property, thus no support for vetoable change listeners
- DBG_WARNING( "not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL SwXMailMerge::dispose()
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing)
{
@@ -1167,7 +1158,7 @@ void SAL_CALL SwXMailMerge::addEventListener(
const Reference< XEventListener >& rxListener )
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rxListener.is())
aEvtListeners.addInterface( rxListener );
}
@@ -1176,7 +1167,7 @@ void SAL_CALL SwXMailMerge::removeEventListener(
const Reference< XEventListener >& rxListener )
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rxListener.is())
aEvtListeners.removeInterface( rxListener );
}
@@ -1185,7 +1176,7 @@ void SAL_CALL SwXMailMerge::addMailMergeEventListener(
const uno::Reference< XMailMergeListener >& rxListener )
throw (RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rxListener.is())
aMergeListeners.addInterface( rxListener );
}
@@ -1194,7 +1185,7 @@ void SAL_CALL SwXMailMerge::removeMailMergeEventListener(
const uno::Reference< XMailMergeListener >& rxListener )
throw (RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (!bDisposing && rxListener.is())
aMergeListeners.removeInterface( rxListener );
}
@@ -1202,14 +1193,14 @@ void SAL_CALL SwXMailMerge::removeMailMergeEventListener(
OUString SAL_CALL SwXMailMerge::getImplementationName()
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return SwXMailMerge_getImplementationName();
}
sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return C2U( SN_MAIL_MERGE ) == rServiceName ||
C2U( SN_DATA_ACCESS_DESCRIPTOR ) == rServiceName;
}
@@ -1217,7 +1208,7 @@ sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames()
throw(RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return SwXMailMerge_getSupportedServiceNames();
}
@@ -1243,11 +1234,12 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(
const uno::Reference< XMultiServiceFactory > & /*rSMgr*/)
throw( uno::Exception )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
//the module may not be loaded
- SwDLL::Init();
+ SwGlobals::ensure();
uno::Reference< uno::XInterface > xRef = (cppu::OWeakObject *) new SwXMailMerge();
return xRef;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 25b09c895687..d98212ba1fdf 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <swtypes.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <unomod.hxx>
#include <unomid.h>
#include <unoprnms.hxx>
@@ -42,7 +43,7 @@
#include <docsh.hxx>
#include <wrtsh.hxx>
#include <viewopt.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/text/NotePrintMode.hpp>
#include <doc.hxx>
@@ -53,7 +54,6 @@
#include <edtwin.hxx>
#include <rtl/ustrbuf.hxx>
#include <tools/urlobj.hxx>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -106,6 +106,7 @@ enum SwViewSettingsPropertyHandles
HANDLE_VIEWSET_HORI_RULER_METRIC,
HANDLE_VIEWSET_VERT_RULER_METRIC
};
+
enum SwPrintSettingsPropertyHandles
{
HANDLE_PRINTSET_ANNOTATION_MODE,
@@ -177,6 +178,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
};
return new ChainablePropertySetInfo ( aViewSettingsMap_Impl );
}
+
static ChainablePropertySetInfo * lcl_createPrintSettingsInfo()
{
static PropertyInfo aPrintSettingsMap_Impl[] =
@@ -207,85 +209,66 @@ static ChainablePropertySetInfo * lcl_createPrintSettingsInfo()
/******************************************************************
* SwXModule
******************************************************************/
-/* -----------------30.03.99 15:10-------------------
- *
- * --------------------------------------------------*/
Reference< uno::XInterface > SAL_CALL SwXModule_createInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/) throw( Exception )
{
static Reference< uno::XInterface > xModule = (cppu::OWeakObject*)new SwXModule();;
return xModule;
}
-/* -----------------------------17.04.01 13:11--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw()
{
OUString sService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalSettings"));
const Sequence< OUString > aSeq( &sService, 1 );
return aSeq;
}
-/* -----------------------------17.04.01 13:11--------------------------------
- ---------------------------------------------------------------------------*/
OUString SAL_CALL SwXModule_getImplementationName() throw()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM("SwXModule" ) );
}
-/*-- 17.12.98 12:19:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXModule::SwXModule() :
pxViewSettings(0),
pxPrintSettings(0)
{
}
-/*-- 17.12.98 12:19:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXModule::~SwXModule()
{
delete pxViewSettings;
delete pxPrintSettings;
}
-/*-- 17.12.98 12:19:03---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pxViewSettings)
{
((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ;
- DBG_ERROR("Web oder Text?");
+ OSL_FAIL("Web or Text?");
*pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, 0 ) );
}
return *pxViewSettings;
}
-/*-- 17.12.98 12:19:03---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pxPrintSettings)
{
((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ;
- DBG_ERROR("Web oder Text?");
+ OSL_FAIL("Web or Text?");
*pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) );
}
return *pxPrintSettings;
}
-/* -----------------------------06.04.00 10:59--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXModule::getImplementationName(void) throw( RuntimeException )
{
return SwXModule_getImplementationName();
}
-/* -----------------------------06.04.00 10:59--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames();
@@ -296,9 +279,7 @@ sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( Runtime
}
return sal_False;
}
-/* -----------------------------06.04.00 10:59--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException )
{
return SwXModule_getSupportedServiceNames();
@@ -307,9 +288,6 @@ Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeExc
/******************************************************************
* SwXPrintSettings
******************************************************************/
-/*-- 17.12.98 12:54:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc)
: ChainableHelperNoState ( lcl_createPrintSettingsInfo (), &Application::GetSolarMutex() )
, meType(eType)
@@ -317,9 +295,7 @@ SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc)
, mpDoc ( pDoc )
{
}
-/*-- 17.12.98 12:54:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXPrintSettings::~SwXPrintSettings()
throw()
{
@@ -475,6 +451,7 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo,
throw UnknownPropertyException();
}
}
+
void SwXPrintSettings::_postSetValues ()
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException )
{
@@ -501,6 +478,7 @@ void SwXPrintSettings::_preGetValues ()
break;
}
}
+
void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue )
throw(UnknownPropertyException, WrappedTargetException )
{
@@ -574,28 +552,23 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo,
throw UnknownPropertyException();
}
}
+
void SwXPrintSettings::_postGetValues ()
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException )
{
mpPrtOpt = NULL;
}
-/* -----------------------------06.04.00 11:02--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXPrintSettings::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXPrintSettings");
}
-/* -----------------------------06.04.00 11:02--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.PrintSettings") == rServiceName;
}
-/* -----------------------------06.04.00 11:02--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -604,13 +577,6 @@ Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( Run
return aRet;
}
-
-/******************************************************************
- *
- ******************************************************************/
-/*-- 18.12.98 11:01:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw)
: ChainableHelperNoState( lcl_createViewSettingsInfo (), &Application::GetSolarMutex() )
, pView(pVw)
@@ -628,14 +594,13 @@ SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw)
mpInfo->remove ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "HelpURL" ) ) );
}
-/*-- 18.12.98 11:01:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXViewSettings::~SwXViewSettings()
throw()
{
}
+
void SwXViewSettings::_preSetValues ()
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException )
{
@@ -654,6 +619,7 @@ void SwXViewSettings::_preSetValues ()
if(pView)
mpViewOption->SetStarOneSetting(sal_True);
}
+
void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException )
{
@@ -763,8 +729,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break;
default:
throw IllegalArgumentException(
- ::rtl::OUString::createFromAscii(
- "SwXViewSettings: invalid zoom type"), 0, 0);
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "SwXViewSettings: invalid zoom type")), 0, 0);
break;
}
if(eZoom < USHRT_MAX)
@@ -782,6 +748,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
pView->RecheckBrowseMode();
+ if(mpViewOption)
+ mpViewOption->setBrowseMode(bVal);
}
}
break;
@@ -880,6 +848,7 @@ void SwXViewSettings::_preGetValues ()
else
mpConstViewOption = SW_MOD()->GetViewOption(bWeb);
}
+
void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue )
throw(UnknownPropertyException, WrappedTargetException )
{
@@ -960,7 +929,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
nRet = view::DocumentZoomType::PAGE_WIDTH_EXACT;
break;
default:
- OSL_ENSURE(false, "SwXViewSettings: invalid zoom type");
+ OSL_FAIL("SwXViewSettings: invalid zoom type");
break;
}
rValue <<= nRet;
@@ -1017,11 +986,12 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
bBool = sal_False;
}
break;
- default: DBG_ERROR("Diese Id gibt's nicht!");
+ default: OSL_FAIL("there is no such ID!");
}
if( bBool )
rValue.setValue(&bBoolVal, ::getBooleanCppuType());
}
+
void SwXViewSettings::_postGetValues ()
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException )
{
@@ -1046,3 +1016,4 @@ Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( Runt
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx
index 85ef0f10c1d7..5a7f3be41516 100644
--- a/sw/source/ui/uno/unomodule.cxx
+++ b/sw/source/ui/uno/unomodule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,7 @@
#include <sfx2/objface.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -57,7 +58,7 @@ uno::Sequence< rtl::OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() t
uno::Reference< uno::XInterface > SAL_CALL SwUnoModule_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return uno::Reference< uno::XInterface >( dynamic_cast< frame::XDispatch * >(new SwUnoModule( rSMgr )), uno::UNO_QUERY );
}
@@ -69,8 +70,8 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons
// asynchronous ...
uno::Reference< uno::XInterface > xThis(static_cast< frame::XNotifyingDispatch* >(this));
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
sal_Int16 aState = frame::DispatchResultState::DONTKNOW;
@@ -136,8 +137,8 @@ REFERENCE< XDISPATCH > SAL_CALL SwUnoModule::queryDispatch(
{
REFERENCE< XDISPATCH > xReturn;
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SwDLL::Init();
+ SolarMutexGuard aGuard;
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
if ( pSlot )
xReturn = REFERENCE< XDISPATCH >(static_cast< XDISPATCH* >(this), uno::UNO_QUERY);
@@ -170,3 +171,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SwUnoModule::getSupportedServiceNames(
return SwUnoModule_getSupportedServiceNames();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unomodule.hxx b/sw/source/ui/uno/unomodule.hxx
index 0fc02fc21562..84a2b54d6704 100644
--- a/sw/source/ui/uno/unomodule.hxx
+++ b/sw/source/ui/uno/unomodule.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,3 +97,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 97d3f0756001..e1ac6b691b75 100755..100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/image.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
@@ -42,9 +43,7 @@
#include <swtypes.hxx>
#include <wdocsh.hxx>
#include <wrtsh.hxx>
-#include <view.hxx>
#include <pview.hxx>
-#include <srcview.hxx>
#include <viewsh.hxx>
#include <pvprtdat.hxx>
#include <printdata.hxx>
@@ -77,7 +76,6 @@
#include <globdoc.hxx>
#include <viewopt.hxx>
#include <unochart.hxx>
-#include <doc.hxx>
#include <charatr.hxx>
#include <svx/xmleohlp.hxx>
#include <globals.hrc>
@@ -115,17 +113,11 @@
#include <osl/file.hxx>
#include <comphelper/storagehelper.hxx>
-
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
#include <numrule.hxx>
-///////////////////////////Modified on Jun. 14th//////////////////////////
-///////////////////////for getDocumentLanguages///////////////////////////
-//-->
#include <editeng/langitem.hxx>
-#include <doc.hxx>
#include <docary.hxx> //SwCharFmts
#include <i18npool/mslangid.hxx>
@@ -140,7 +132,6 @@
#include <view.hxx>
#include <srcview.hxx>
-//#include <com/sun/star/i18n/ScriptType.hpp>
#include <svtools/langtab.hxx>
#include <map>
#include <set>
@@ -151,9 +142,9 @@
#include <svx/svdoutl.hxx>
#include <svl/languageoptions.hxx>
#include <svx/svdview.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
-//
-//<--
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::i18n;
@@ -166,9 +157,6 @@ using namespace ::com::sun::star::i18n;
using ::rtl::OUString;
using ::osl::FileBase;
-/* -----------------------------17.01.01 15:43--------------------------------
-
- ---------------------------------------------------------------------------*/
#define SW_CREATE_DASH_TABLE 0x01
#define SW_CREATE_GRADIENT_TABLE 0x02
#define SW_CREATE_HATCH_TABLE 0x03
@@ -177,7 +165,6 @@ using ::osl::FileBase;
#define SW_CREATE_MARKER_TABLE 0x06
#define SW_CREATE_DRAW_DEFAULTS 0x07
-
/******************************************************************************
*
******************************************************************************/
@@ -203,9 +190,6 @@ SwPrintUIOptions * lcl_GetPrintUIOptions(
return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
}
-////////////////////////////////////////////////////////////
-
-
SwTxtFmtColl *lcl_GetParaStyle(const String& rCollName, SwDoc* pDoc)
{
SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( rCollName );
@@ -217,6 +201,7 @@ SwTxtFmtColl *lcl_GetParaStyle(const String& rCollName, SwDoc* pDoc)
}
return pColl;
}
+
void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell )
{
// check if the view frame still exists
@@ -234,17 +219,17 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell )
sal_False );
}
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXTextDocumentUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextDocumentUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXTextDocument::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextDocumentUnoTunnelId::get().getSeq();
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rId )
throw(RuntimeException)
{
@@ -254,6 +239,12 @@ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rI
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
+ if( rId.getLength() == 16
+ && 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(),
+ rId.getConstArray(), 16 ) )
+ {
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell ));
+ }
sal_Int64 nRet = SfxBaseModel::getSomething( rId );
if ( nRet )
@@ -270,9 +261,7 @@ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rI
return SfxBaseModel::getSomething( rId );
}
-/* -----------------------------16.03.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(RuntimeException)
{
Any aRet = SwXTextDocumentBaseClass::queryInterface(rType);
@@ -300,30 +289,22 @@ Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(Run
}
return aRet;
}
-/* -----------------------------16.03.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextDocument::acquire()throw()
{
SfxBaseModel::acquire();
}
-/* -----------------------------16.03.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextDocument::release()throw()
{
SfxBaseModel::release();
}
-/* -----------------------------07.12.00 11:37--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XAdapter > SwXTextDocument::queryAdapter( ) throw(RuntimeException)
{
return SfxBaseModel::queryAdapter();
}
-/* -----------------------------16.03.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() throw(RuntimeException)
{
Sequence< uno::Type > aBaseTypes = SfxBaseModel::getTypes();
@@ -359,9 +340,7 @@ Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() throw(RuntimeExceptio
pBaseTypes[nIndex++] = ::getCppuType((Reference<lang::XMultiServiceFactory>*)0);
return aBaseTypes;
}
-/*-- 18.12.98 11:52:59---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextDocument::SwXTextDocument(SwDocShell* pShell) :
SfxBaseModel(pShell),
@@ -402,10 +381,11 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) :
m_pPrintUIOptions( NULL ),
m_pRenderData( NULL )
{
+ uno::Reference< document::XDocumentProperties > xWriterProps( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.writer.DocumentProperties") ), uno::UNO_QUERY_THROW);
+
+ SfxBaseModel::setDocumentProperties( xWriterProps );
}
-/*-- 18.12.98 11:53:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextDocument::~SwXTextDocument()
{
InitNewDoc();
@@ -419,13 +399,6 @@ SwXTextDocument::~SwXTextDocument()
delete m_pRenderData;
}
-
-/*-- 18.12.98 11:55:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-/* -----------------18.12.98 12:49-------------------
- *
- * --------------------------------------------------*/
SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper ()
{
if(!xPropertyHelper.is())
@@ -435,6 +408,7 @@ SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper ()
}
return pPropertyHelper;
}
+
void SwXTextDocument::GetNumberFormatter()
{
if(IsValid())
@@ -463,18 +437,16 @@ void SwXTextDocument::GetNumberFormatter()
xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
}
- DBG_ASSERT(pNumFmt, "No number formatter available");
+ OSL_ENSURE(pNumFmt, "No number formatter available");
if(!pNumFmt->GetNumberFormatter())
pNumFmt->SetNumberFormatter(pDocShell->GetDoc()->GetNumberFormatter( sal_True ));
}
}
}
-/*-- 18.12.98 11:55:11---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XText > SwXTextDocument::getText(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!xBodyText.is())
@@ -484,21 +456,17 @@ Reference< XText > SwXTextDocument::getText(void) throw( RuntimeException )
}
return xBodyText;
}
-/*-- 18.12.98 11:55:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::reformat(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
}
-/*-- 18.12.98 11:55:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::lockControllers(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
@@ -507,12 +475,10 @@ void SwXTextDocument::lockControllers(void) throw( RuntimeException )
else
throw RuntimeException();
}
-/*-- 18.12.98 11:55:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::unlockControllers(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(aActionArr.Count())
{
UnoActionContext* pContext = aActionArr.GetObject(0);
@@ -522,35 +488,27 @@ void SwXTextDocument::unlockControllers(void) throw( RuntimeException )
else
throw RuntimeException();
}
-/*-- 18.12.98 11:55:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextDocument::hasControllersLocked(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return aActionArr.Count() > 0;
}
-/*-- 18.12.98 13:12:23---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< frame::XController > SwXTextDocument::getCurrentController(void) throw( RuntimeException )
{
return SfxBaseModel::getCurrentController();
}
-/*-- 18.12.98 13:12:24---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::setCurrentController(const Reference< frame::XController > & xController)
throw( NoSuchElementException, RuntimeException )
{
SfxBaseModel::setCurrentController(xController);
}
-/* -----------------27.01.99 11:48-------------------
- *
- * --------------------------------------------------*/
+
Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< XInterface > xRef;
if(IsValid())
{
@@ -570,80 +528,58 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx
return xRef;
}
-/*-- 18.12.98 13:12:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwXTextDocument::attachResource(const OUString& aURL, const Sequence< beans::PropertyValue >& aArgs)
throw( RuntimeException )
{
return SfxBaseModel::attachResource(aURL, aArgs);
}
-/*-- 18.12.98 13:12:24---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextDocument::getURL(void) throw( RuntimeException )
{
return SfxBaseModel::getURL();
}
-/*-- 18.12.98 13:12:24---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< beans::PropertyValue > SwXTextDocument::getArgs(void) throw( RuntimeException )
{
return SfxBaseModel::getArgs();
}
-/*-- 18.12.98 13:12:24---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::connectController(const Reference< frame::XController > & xController) throw( RuntimeException )
{
SfxBaseModel::connectController(xController);
}
-/*-- 18.12.98 13:12:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::disconnectController(const Reference< frame::XController > & xController) throw( RuntimeException )
{
SfxBaseModel::disconnectController(xController);
}
-/*-- 18.12.98 13:12:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::dispose(void) throw( RuntimeException )
{
SfxBaseModel::dispose();
}
-/*-- 10.05.2005 14:14:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::close( sal_Bool bDeliverOwnership ) throw( util::CloseVetoException, RuntimeException )
{
if(IsValid() && m_pHiddenViewFrame)
lcl_DisposeView( m_pHiddenViewFrame, pDocShell);
SfxBaseModel::close(bDeliverOwnership);
}
-/*-- 18.12.98 13:12:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::addEventListener(const Reference< lang::XEventListener > & aListener) throw( RuntimeException )
{
SfxBaseModel::addEventListener(aListener);
}
-/*-- 18.12.98 13:12:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::removeEventListener(const Reference< lang::XEventListener > & aListener) throw( RuntimeException )
{
SfxBaseModel::removeEventListener(aListener);
}
-/*-- 18.12.98 11:55:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Reference< XPropertySet > SwXTextDocument::getLineNumberingProperties(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
if(!pxXLineNumberingProperties)
@@ -656,13 +592,11 @@ Reference< XPropertySet > SwXTextDocument::getLineNumberingProperties(void)
throw RuntimeException();
return *pxXLineNumberingProperties;
}
-/*-- 18.12.98 11:55:20---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XIndexReplace > SwXTextDocument::getChapterNumberingRules(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXChapterNumbering)
@@ -675,7 +609,7 @@ Reference< XIndexReplace > SwXTextDocument::getChapterNumberingRules(void)
Reference< XIndexAccess > SwXTextDocument::getNumberingRules(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXNumberingRules )
@@ -686,12 +620,9 @@ Reference< XIndexAccess > SwXTextDocument::getNumberingRules(void) throw( Runti
return *pxXNumberingRules;
}
-/*-- 18.12.98 11:55:21---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXFootnotes)
@@ -701,13 +632,11 @@ Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeExc
}
return *pxXFootnotes;
}
-/*-- 18.12.98 11:55:21---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySet > SAL_CALL
SwXTextDocument::getFootnoteSettings(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXFootnoteSettings)
@@ -717,12 +646,10 @@ Reference< XPropertySet > SAL_CALL
}
return *pxXFootnoteSettings;
}
-/*-- 18.12.98 11:55:21---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXEndnotes)
@@ -732,12 +659,10 @@ Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeExce
}
return *pxXEndnotes;
}
-/*-- 18.12.98 11:55:22---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySet > SwXTextDocument::getEndnoteSettings(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXEndnoteSettings)
@@ -747,19 +672,15 @@ Reference< XPropertySet > SwXTextDocument::getEndnoteSettings(void) throw( Runt
}
return *pxXEndnoteSettings;
}
-/*-- 18.12.98 11:55:22---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< util::XReplaceDescriptor > SwXTextDocument::createReplaceDescriptor(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< util::XReplaceDescriptor > xRet = new SwXTextSearch;
return xRet;
}
-/* -----------------26.02.99 15:52-------------------
- *
- * --------------------------------------------------*/
+
SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xCrsr)
{
getText();
@@ -773,13 +694,10 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xC
return pUnoCrsr;
}
-/*-- 18.12.98 11:55:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
throw RuntimeException();
@@ -848,18 +766,17 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor >
return (sal_Int32)nResult;
}
-/*-- 18.12.98 11:55:22---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< util::XSearchDescriptor > SwXTextDocument::createSearchDescriptor(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< util::XSearchDescriptor > xRet = new SwXTextSearch;
return xRet;
}
-/* -----------------26.02.99 16:08-------------------
+
+/* --------------------------------------------------
* wird fuer findAll/First/Next verwendet
* --------------------------------------------------*/
SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > & xDesc,
@@ -984,14 +901,12 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
}
return pUnoCrsr;
}
-/*-- 18.12.98 11:55:23---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XIndexAccess >
SwXTextDocument::findAll(const Reference< util::XSearchDescriptor > & xDesc)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< XInterface > xTmp;
sal_Int32 nResult = 0;
Reference< XTextCursor > xCrsr;
@@ -1003,13 +918,11 @@ Reference< XIndexAccess >
delete pResultCrsr;
return xRet;
}
-/*-- 18.12.98 11:55:23---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSearchDescriptor > & xDesc)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< XInterface > xTmp;
sal_Int32 nResult = 0;
Reference< XTextCursor > xCrsr;
@@ -1027,14 +940,12 @@ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSear
}
return xRet;
}
-/*-- 18.12.98 11:55:24---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > & xStartAt,
const Reference< util::XSearchDescriptor > & xDesc)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Reference< XInterface > xTmp;
sal_Int32 nResult = 0;
Reference< XTextCursor > xCrsr;
@@ -1055,13 +966,11 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface >
}
return xRet;
}
-/*-- 18.12.98 11:55:24---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< beans::PropertyValue > SwXTextDocument::getPagePrintSettings(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Sequence< beans::PropertyValue > aSeq(9);
if(IsValid())
{
@@ -1095,9 +1004,7 @@ Sequence< beans::PropertyValue > SwXTextDocument::getPagePrintSettings(void)
throw RuntimeException();
return aSeq;
}
-/* -----------------24.02.99 10:57-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt32 lcl_Any_To_ULONG(const Any& rValue, sal_Bool& bException)
{
bException = sal_False;
@@ -1116,9 +1023,7 @@ sal_uInt32 lcl_Any_To_ULONG(const Any& rValue, sal_Bool& bException)
return nRet;
}
-/*-- 09.06.2004 12:18:10---------------------------------------------------
- -----------------------------------------------------------------------*/
String lcl_CreateOutlineString( sal_uInt16 nIndex,
const SwOutlineNodes& rOutlineNodes, const SwNumRule* pOutlRule)
{
@@ -1140,13 +1045,11 @@ String lcl_CreateOutlineString( sal_uInt16 nIndex,
GetTxtNode()->GetExpandTxt( 0, STRING_LEN, sal_False );
return sEntry;
}
-/*-- 18.12.98 11:55:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue >& aSettings)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
SwPagePreViewPrtData aData;
@@ -1213,13 +1116,11 @@ void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue
else
throw RuntimeException();
}
-/*-- 18.12.98 11:55:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOptions)
throw( IllegalArgumentException, RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
SfxViewFrame* pFrame = SfxViewFrame::LoadHiddenDocument( *pDocShell, 7 );
@@ -1227,11 +1128,11 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
pDocShell->GetDoc()->GetAttrPool());
aReq.AppendItem(SfxBoolItem(FN_PRINT_PAGEPREVIEW, sal_True));
- OUString sFileName( C2U(SW_PROP_NAME_STR(UNO_NAME_FILE_NAME)));
- OUString sCopyCount(C2U(SW_PROP_NAME_STR(UNO_NAME_COPY_COUNT)));
- OUString sCollate(C2U(SW_PROP_NAME_STR(UNO_NAME_COLLATE)));
- OUString sSort(C2U(SW_PROP_NAME_STR(UNO_NAME_SORT)));
- OUString sPages(C2U(SW_PROP_NAME_STR(UNO_NAME_PAGES)));
+ OUString sFileName(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_FILE_NAME)));
+ OUString sCopyCount(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COPY_COUNT)));
+ OUString sCollate(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COLLATE)));
+ OUString sSort(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SORT)));
+ OUString sPages(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGES)));
for ( int n = 0; n < xOptions.getLength(); ++n )
{
@@ -1301,13 +1202,11 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
else
throw RuntimeException();
}
-/*-- 18.12.98 11:55:25---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXReferenceMarks)
@@ -1317,12 +1216,10 @@ Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void)
}
return *pxXReferenceMarks;
}
-/* -----------------21.12.98 10:20-------------------
- *
- * --------------------------------------------------*/
+
Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXTextFieldTypes)
@@ -1332,13 +1229,11 @@ Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( Run
}
return *pxXTextFieldTypes;
}
-/*-- 21.12.98 10:21:12---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXTextFieldMasters)
@@ -1348,12 +1243,10 @@ Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void)
}
return *pxXTextFieldMasters;
}
-/*-- 21.12.98 10:21:12---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXEmbeddedObjects)
@@ -1363,12 +1256,10 @@ Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( Runti
}
return *pxXEmbeddedObjects;
}
-/*-- 21.12.98 10:21:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXBookmarks)
@@ -1378,12 +1269,10 @@ Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeExce
}
return *pxXBookmarks;
}
-/*-- 21.12.98 10:21:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXTextSections)
@@ -1393,12 +1282,10 @@ Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeE
}
return *pxXTextSections;
}
-/*-- 21.12.98 10:21:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXTextTables)
@@ -1408,12 +1295,10 @@ Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeExc
}
return *pxXTextTables;
}
-/*-- 21.12.98 10:21:13---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXGraphicObjects)
@@ -1423,12 +1308,10 @@ Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( Runtim
}
return *pxXGraphicObjects;
}
-/*-- 21.12.98 10:21:14---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXTextFrames)
@@ -1438,12 +1321,10 @@ Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeExc
}
return *pxXTextFrames;
}
-/* -----------------21.12.98 10:56-------------------
- *
- * --------------------------------------------------*/
+
Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXStyleFamilies)
@@ -1453,13 +1334,11 @@ Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( Runtime
}
return *pxXStyleFamilies;
}
-/*-- 19.05.06 10:15:22---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< style::XAutoStyles > SwXTextDocument::getAutoStyles( )
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXAutoStyles)
@@ -1470,31 +1349,25 @@ uno::Reference< style::XAutoStyles > SwXTextDocument::getAutoStyles( )
return *pxXAutoStyles;
}
-/*-- 22.01.99 10:18:03---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXDrawPage)
{
- // simplified this creation, keeping original below as reference
- // for the case that it did something by purpose
((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc());
((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage);
-
- //((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage > ;
- //((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc());
- //Reference< drawing::XShapes > xTmp = pDrawPage;
- //*pxXDrawPage = Reference< drawing::XDrawPage>(xTmp, UNO_QUERY);
+ // Create a Reference to trigger the complete initialization of the
+ // object. Otherwise in some corner cases it would get initialized
+ // at ::InitNewDoc -> which would get called during
+ // close() or dispose() -> n#681746
+ uno::Reference<lang::XComponent> xComp( *pxXDrawPage, uno::UNO_QUERY );
}
return *pxXDrawPage;
}
-/* -----------------07.04.99 10:11-------------------
- *
- * --------------------------------------------------*/
+
SwXDrawPage* SwXTextDocument::GetDrawPage()
{
if(!IsValid())
@@ -1503,9 +1376,7 @@ SwXDrawPage* SwXTextDocument::GetDrawPage()
getDrawPage();
return pDrawPage;
}
-/*-- 18.12.98 11:55:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::Invalidate()
{
bObjectValid = sal_False;
@@ -1521,15 +1392,13 @@ void SwXTextDocument::Invalidate()
xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
pNumFmt->SetNumberFormatter(0);
}
- DBG_ASSERT(pNumFmt, "No number formatter available");
+ OSL_ENSURE(pNumFmt, "No number formatter available");
}
InitNewDoc();
pDocShell = 0;
aRefreshCont.Disposing();
}
-/* -----------------------------13.07.00 15:59--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell)
{
if(pDocShell && pDocShell != pNewDocShell)
@@ -1537,9 +1406,7 @@ void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell)
pDocShell = pNewDocShell;
bObjectValid = sal_True;
}
-/*-- 18.12.98 11:55:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::InitNewDoc()
{
// zunaechst alle Collections invalidieren, dann Referenzen loeschen und Null setzen
@@ -1593,7 +1460,7 @@ void SwXTextDocument::InitNewDoc()
xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
}
- DBG_ASSERT(pNumFmt, "No number formatter available");
+ OSL_ENSURE(pNumFmt, "No number formatter available");
pNumFmt->SetNumberFormatter(0);
}
@@ -1623,11 +1490,10 @@ void SwXTextDocument::InitNewDoc()
if(pxXDrawPage)
{
- // --> OD 2008-07-23 #i91798#, #i91895#
+ // #i91798#, #i91895#
// dispose XDrawPage here. We are the owner and know that it is no longer in a valid condition.
uno::Reference<lang::XComponent> xComp( *pxXDrawPage, uno::UNO_QUERY );
xComp->dispose();
- // <--
pDrawPage->InvalidateSwDoc();
delete pxXDrawPage;
pxXDrawPage = 0;
@@ -1748,14 +1614,11 @@ void SwXTextDocument::InitNewDoc()
}
}
-/*-- 11.03.99 11:51:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
#define COM_SUN_STAR__DRAWING_LENGTH 13
Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServiceName)
throw( Exception, RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
Reference< XInterface > xRet;
@@ -1826,18 +1689,17 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
if (rServiceName.lastIndexOf( C2U(".OLE2Shape") ) == rServiceName.getLength() - 10)
throw ServiceNotRegisteredException(); // declare service to be not registered with this factory
- // --> OD 2006-02-22 #b6382898#
+ //
// the XML import is allowed to create instances of com.sun.star.drawing.OLE2Shape.
// Thus, a temporary service name is introduced to make this possible.
OUString aTmpServiceName( rServiceName );
if ( bShape &&
rServiceName.compareToAscii( "com.sun.star.drawing.temporaryForXMLImportOLE2Shape" ) == 0 )
{
- aTmpServiceName = OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" );
+ aTmpServiceName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape"));
}
//hier den Draw - Service suchen
Reference< XInterface > xTmp = SvxFmMSFactory::createInstance(aTmpServiceName);
- // <--
if(bShape)
{
nIndex = COM_SUN_STAR__DRAWING_LENGTH;
@@ -1856,9 +1718,7 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
}
return xRet;
}
-/*-- 11.03.99 11:51:40---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XInterface > SwXTextDocument::createInstanceWithArguments(
const OUString& ServiceSpecifier,
const Sequence< Any >& /*Arguments*/)
@@ -1869,9 +1729,7 @@ Reference< XInterface > SwXTextDocument::createInstanceWithArguments(
//Parameter zwingend angewiesen sind - bis jetzt haben wir das nicht
return xInt;
}
-/*-- 11.03.99 11:51:41---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void)
throw( RuntimeException )
{
@@ -1895,16 +1753,12 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void)
return aServices;
}
-/* -----------------18.03.99 11:36-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextDocument::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextDocument");
}
-/* -----------------20.01.04 10:14-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
if (
@@ -1923,9 +1777,7 @@ sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( R
(bTextDoc && rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument" )))
);
}
-/* -----------------20.01.04 10:17-------------------
- *
- * --------------------------------------------------*/
+
Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException )
{
sal_Bool bWebDoc = (0 != PTR_CAST(SwWebDocShell, pDocShell));
@@ -1949,12 +1801,10 @@ Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( Runt
return aRet;
}
-/* -----------------05.05.99 12:10-------------------
- *
- * --------------------------------------------------*/
+
Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
if(!pxXDocumentIndexes)
@@ -1965,23 +1815,18 @@ Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( Runt
return *pxXDocumentIndexes;
}
-/*-- 10.05.99 13:58:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Reference< XPropertySetInfo > SwXTextDocument::getPropertySetInfo(void) throw( RuntimeException )
{
static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo();
return xRet;
}
-/*-- 10.05.99 13:58:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
const Any& aValue)
throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException,
WrappedTargetException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName);
@@ -2090,9 +1935,8 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// must thus create an SdrModel, if we don't have an
// SdrModel and we are leaving the default at false,
// we don't need to make an SdrModel and can do nothing
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
- // <--
pDrawDoc->SetAutoControlFocus ( bAuto );
}
}
@@ -2112,14 +1956,13 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// SdrModel and we are leaving the default at true,
// we don't need to make an SdrModel and can do
// nothing
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
- // <--
pDrawDoc->SetOpenInDesignMode ( bMode );
}
}
break;
- // --> FME 2005-02-25 #i42634# New property to set the bInReading
+ // #i42634# New property to set the bInReading
// flag at the document, used during binary import
case WID_DOC_LOCK_UPDATES :
{
@@ -2129,11 +1972,10 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
pDoc->SetInReading( bBool );
}
break;
- // <--
case WID_DOC_BUILDID:
aValue >>= maBuildId;
break;
- // --> OD 2006-03-21 #b6375613#
+ //
case WID_APPLY_WORKAROUND_FOR_B6375613:
{
bool bApplyWorkaroundForB6375613( false );
@@ -2141,7 +1983,6 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
pDocShell->GetDoc()->SetApplyWorkaroundForB6375613( bApplyWorkaroundForB6375613 );
}
break;
- // <--
default:
{
@@ -2153,13 +1994,11 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
}
}
}
-/*-- 10.05.99 13:58:59---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName);
@@ -2169,6 +2008,9 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
Any aAny;
switch(pEntry->nWID)
{
+ case WID_DOC_ISTEMPLATEID :
+ aAny <<= pDocShell->IsTemplate();
+ break;
case WID_DOC_CHAR_COUNT :
case WID_DOC_PARA_COUNT :
case WID_DOC_WORD_COUNT :
@@ -2277,6 +2119,14 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
case WID_DOC_DIALOG_LIBRARIES:
aAny <<= pDocShell->GetDialogContainer();
break;
+ case WID_DOC_VBA_DOCOBJ:
+ {
+ beans::PropertyValue aProp;
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisWordDoc") );
+ aProp.Value <<= pDocShell->GetModel();
+ aAny <<= aProp;
+ }
+ break;
case WID_DOC_RUNTIME_UID:
aAny <<= getRuntimeUID();
break;
@@ -2289,13 +2139,12 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
case WID_DOC_HAS_VALID_SIGNATURES:
aAny <<= hasValidSignatures();
break;
- // --> OD 2006-03-21 #b6375613#
+ //
case WID_APPLY_WORKAROUND_FOR_B6375613:
{
aAny <<= pDocShell->GetDoc()->ApplyWorkaroundForB6375613();
}
break;
- // <--
default:
{
@@ -2305,45 +2154,35 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
}
return aAny;
}
-/*-- 10.05.99 13:58:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::addPropertyChangeListener(const OUString& /*PropertyName*/,
const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-/*-- 10.05.99 13:58:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::removePropertyChangeListener(const OUString& /*PropertyName*/,
const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-/*-- 10.05.99 13:59:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::addVetoableChangeListener(const OUString& /*PropertyName*/,
const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-/*-- 10.05.99 13:59:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::removeVetoableChangeListener(const OUString& /*PropertyName*/,
const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-/* -----------------25.10.99 10:42-------------------
- --------------------------------------------------*/
Reference< XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeException )
{
if(!pxLinkTargetSupplier)
@@ -2353,9 +2192,7 @@ Reference< XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeExceptio
}
return (*pxLinkTargetSupplier);
}
-/* -----------------------------11.01.01 15:01--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XEnumerationAccess > SwXTextDocument::getRedlines( ) throw(RuntimeException)
{
if(!pxXRedlines)
@@ -2365,12 +2202,10 @@ Reference< XEnumerationAccess > SwXTextDocument::getRedlines( ) throw(RuntimeEx
}
return *pxXRedlines;
}
-/*-- 21.02.00 08:41:06---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::refresh(void) throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
ViewShell *pViewShell = pDocShell->GetWrtShell();
@@ -2378,33 +2213,27 @@ void SwXTextDocument::refresh(void) throw( RuntimeException )
if(pViewShell)
pViewShell->CalcLayout();
}
-/*-- 21.02.00 08:41:06---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::addRefreshListener(const Reference< util::XRefreshListener > & l)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !IsValid() )
throw RuntimeException();
aRefreshCont.AddListener ( reinterpret_cast < const Reference < lang::XEventListener > &> ( l ));
}
-/*-- 21.02.00 08:41:07---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextDocument::removeRefreshListener(const Reference< util::XRefreshListener > & l)
throw( RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !IsValid() || !aRefreshCont.RemoveListener ( reinterpret_cast < const Reference < lang::XEventListener > &> ( l ) ) )
throw RuntimeException();
}
-/* -----------------------------26.02.01 12:22--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextDocument::updateLinks( ) throw(RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
SwDoc* pDoc = pDocShell->GetDoc();
@@ -2415,11 +2244,12 @@ void SwXTextDocument::updateLinks( ) throw(RuntimeException)
rLnkMan.UpdateAllLinks( sal_False, sal_False, sal_True );
}
}
+
//XPropertyState
PropertyState SAL_CALL SwXTextDocument::getPropertyState( const OUString& rPropertyName )
throw (UnknownPropertyException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
PropertyState eRet = PropertyState_DIRECT_VALUE;
if(!IsValid())
throw RuntimeException();
@@ -2434,6 +2264,7 @@ PropertyState SAL_CALL SwXTextDocument::getPropertyState( const OUString& rPrope
}
return eRet;
}
+
Sequence< PropertyState > SAL_CALL SwXTextDocument::getPropertyStates( const Sequence< OUString >& rPropertyNames )
throw (UnknownPropertyException, RuntimeException)
{
@@ -2447,10 +2278,11 @@ Sequence< PropertyState > SAL_CALL SwXTextDocument::getPropertyStates( const Seq
return aRet;
}
+
void SAL_CALL SwXTextDocument::setPropertyToDefault( const OUString& rPropertyName )
throw (UnknownPropertyException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName);
@@ -2461,10 +2293,11 @@ void SAL_CALL SwXTextDocument::setPropertyToDefault( const OUString& rPropertyNa
case 0:default:break;
}
}
+
Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName )
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName);
@@ -2494,7 +2327,6 @@ static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptio
return pOut;
}
-
static bool lcl_SeqHasProperty(
const uno::Sequence< beans::PropertyValue >& rOptions,
const sal_Char *pPropName )
@@ -2510,7 +2342,6 @@ static bool lcl_SeqHasProperty(
return bRes;
}
-
SfxViewShell * SwXTextDocument::GetRenderView(
bool &rbIsSwSrcView,
const uno::Sequence< beans::PropertyValue >& rOptions,
@@ -2527,7 +2358,7 @@ SfxViewShell * SwXTextDocument::GetRenderView(
const beans::PropertyValue *pProps = rOptions.getConstArray();
for (sal_Int32 i = 0; i < nLen; ++i)
{
- if (pProps[i].Name.equalsAscii( "View" ))
+ if (pProps[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "View" ) ))
{
aTmp = pProps[i].Value;
break;
@@ -2537,14 +2368,13 @@ SfxViewShell * SwXTextDocument::GetRenderView(
uno::Reference< frame::XController > xController;
if (aTmp >>= xController)
{
- DBG_ASSERT( xController.is(), "controller is empty!" );
+ OSL_ENSURE( xController.is(), "controller is empty!" );
pView = GuessViewShell( rbIsSwSrcView, xController );
}
}
return pView;
}
-
/*
* GetRenderDoc:
* returns the document to be rendered, usually this will be the 'regular'
@@ -2553,7 +2383,6 @@ SfxViewShell * SwXTextDocument::GetRenderView(
* The rpView variable will be set (if not already done) to the used
* SfxViewShell.
*/
-
SwDoc * SwXTextDocument::GetRenderDoc(
SfxViewShell *&rpView,
const uno::Any& rSelection,
@@ -2567,7 +2396,7 @@ SwDoc * SwXTextDocument::GetRenderDoc(
pDoc = pDocShell->GetDoc();
else
{
- DBG_ASSERT( !xModel.is(), "unexpected model found" );
+ OSL_ENSURE( !xModel.is(), "unexpected model found" );
if (rSelection.hasValue()) // is anything selected ?
{
@@ -2579,11 +2408,11 @@ SwDoc * SwXTextDocument::GetRenderDoc(
{
(void) bIsPDFExport;
// aside from maybe PDF export the view should always have been provided!
- DBG_ASSERT( bIsPDFExport, "view is missing, guessing one..." );
+ OSL_ENSURE( bIsPDFExport, "view is missing, guessing one..." );
rpView = GuessViewShell( bIsSwSrcView );
}
- DBG_ASSERT( rpView, "ViewShell missing" );
+ OSL_ENSURE( rpView, "ViewShell missing" );
// the view shell should be SwView for documents PDF export.
// for the page preview no selection should be possible
// (the export dialog does not allow for this option)
@@ -2599,17 +2428,13 @@ SwDoc * SwXTextDocument::GetRenderDoc(
}
else
{
- DBG_ERROR( "unexpected ViewShell" );
+ OSL_FAIL("unexpected ViewShell" );
}
}
}
return pDoc;
}
-/* -----------------------------23.08.02 16:00--------------------------------
-
- ---------------------------------------------------------------------------*/
-
static void lcl_SavePrintUIOptionsToDocumentPrintData(
SwDoc &rDoc,
const SwPrintUIOptions &rPrintUIOptions,
@@ -2639,13 +2464,12 @@ static void lcl_SavePrintUIOptionsToDocumentPrintData(
rDoc.setPrintData( aDocPrintData );
}
-
sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
const uno::Any& rSelection,
const uno::Sequence< beans::PropertyValue >& rxOptions )
throw (IllegalArgumentException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
@@ -2658,10 +2482,9 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
if (!m_pPrintUIOptions)
m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView );
bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions );
- // const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
- DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+ OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
if (!pDoc || !pView)
return 0;
@@ -2750,9 +2573,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
bStateChanged = true;
}
- // --> FME 2005-05-23 #122919# Force field update before PDF export:
+ // #122919# Force field update before PDF export
pViewShell->ViewShell::UpdateFlds(sal_True);
- // <--
if( bStateChanged )
pRenderDocShell->EnableSetModified( sal_True );
@@ -2801,20 +2623,18 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
nRet = m_pRenderData->GetPagesToPrint().size();
}
}
- DBG_ASSERT( nRet >= 0, "negative number of pages???" );
+ OSL_ENSURE( nRet >= 0, "negative number of pages???" );
return nRet;
}
-/* -----------------------------23.08.02 16:00--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
sal_Int32 nRenderer,
const uno::Any& rSelection,
const uno::Sequence< beans::PropertyValue >& rxOptions )
throw (IllegalArgumentException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
@@ -2837,7 +2657,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", false );
SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
- DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+ OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
if (!pDoc || !pView)
return uno::Sequence< beans::PropertyValue >();
@@ -2858,7 +2678,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
sal_Int32 nMaxRenderer = 0;
if (!bIsSwSrcView && m_pRenderData)
{
- DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" );
+ OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" );
nMaxRenderer = bPrintProspect?
m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
m_pRenderData->GetPagesToPrint().size() - 1;
@@ -2871,14 +2691,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
uno::Sequence< beans::PropertyValue > aRenderer;
if (m_pRenderData)
{
- // --> TL, OD 2010-09-07 #i114210#
+ // #i114210#
// determine the correct page number from the renderer index
// --> OD 2010-10-01 #i114875
// consider brochure print
const sal_uInt16 nPage = bPrintProspect
? nRenderer + 1
: m_pRenderData->GetPagesToPrint()[ nRenderer ];
- // <--
// get paper tray to use ...
sal_Int32 nPrinterPaperTray = -1;
@@ -2976,9 +2795,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
return aRenderer;
}
-/* -----------------------------28.10.02 16:00--------------------------------
- ---------------------------------------------------------------------------*/
SfxViewShell * SwXTextDocument::GuessViewShell(
/* out */ bool &rbIsSwSrcView,
const uno::Reference< css::frame::XController > xController )
@@ -3012,23 +2829,19 @@ SfxViewShell * SwXTextDocument::GuessViewShell(
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False );
}
- DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" );
+ OSL_ENSURE( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" );
if (pView)
rbIsSwSrcView = pSwSrcView != 0;
return pView;
-// return pSwView ? dynamic_cast< SfxViewShell * >(pSwView) :
-// (pSwSrcView ? dynamic_cast< SfxViewShell * >(pSwSrcView) :
-// dynamic_cast< SfxViewShell * >(pSwPagePreView) );
}
-
void SAL_CALL SwXTextDocument::render(
sal_Int32 nRenderer,
const uno::Any& rSelection,
const uno::Sequence< beans::PropertyValue >& rxOptions )
throw (IllegalArgumentException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
@@ -3042,8 +2855,8 @@ void SAL_CALL SwXTextDocument::render(
bool bIsSwSrcView = false;
SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport );
- DBG_ASSERT( m_pRenderData, "data should have been created already in getRendererCount..." );
- DBG_ASSERT( m_pPrintUIOptions, "data should have been created already in getRendererCount..." );
+ OSL_ENSURE( m_pRenderData, "data should have been created already in getRendererCount..." );
+ OSL_ENSURE( m_pPrintUIOptions, "data should have been created already in getRendererCount..." );
if (!bIsSwSrcView && !m_pRenderData)
m_pRenderData = new SwRenderData;
if (!m_pPrintUIOptions)
@@ -3053,13 +2866,13 @@ void SAL_CALL SwXTextDocument::render(
const bool bLastPage = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False );
SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
- DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+ OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
if (pDoc && pView)
{
sal_Int32 nMaxRenderer = 0;
if (!bIsSwSrcView)
{
- DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" );
+ OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" );
nMaxRenderer = bPrintProspect?
m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
m_pRenderData->GetPagesToPrint().size() - 1;
@@ -3079,7 +2892,7 @@ void SAL_CALL SwXTextDocument::render(
// the view shell should be SwView for documents PDF export
// or SwPagePreView for PDF export of the page preview
//!! (check for SwView first as in GuessViewShell) !!
- DBG_ASSERT( pView, "!! view missing !!" );
+ OSL_ENSURE( pView, "!! view missing !!" );
const TypeId aSwViewTypeId = TYPE(SwView);
ViewShell* pVwSh = 0;
if (pView)
@@ -3101,7 +2914,7 @@ void SAL_CALL SwXTextDocument::render(
const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False );
bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
- DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust())
+ OSL_ENSURE(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust())
|| (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()),
"SwView / SwViewOptionAdjust_Impl availability mismatch" );
@@ -3109,7 +2922,7 @@ void SAL_CALL SwXTextDocument::render(
// should be set for printing as well ...
pVwSh->SetPDFExportOption( sal_True );
- // --> FME 2004-06-08 #i12836# enhanced pdf export
+ // #i12836# enhanced pdf export
//
// First, we have to export hyperlinks, notes, and outline to pdf.
// During this process, additional information required for tagging
@@ -3123,7 +2936,6 @@ void SAL_CALL SwXTextDocument::render(
{
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_False );
}
- // <--
SwPrintData const& rSwPrtOptions =
*m_pRenderData->GetSwPrtOptions();
@@ -3132,7 +2944,7 @@ void SAL_CALL SwXTextDocument::render(
else // normal printing and PDF export
pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer );
- // --> FME 2004-10-08 #i35176#
+ // #i35176#
//
// After printing the last page, we take care for the links coming
// from the EditEngine. The links are generated during the painting
@@ -3142,7 +2954,6 @@ void SAL_CALL SwXTextDocument::render(
{
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_True );
}
- // <--
pVwSh->SetPDFExportOption( sal_False );
@@ -3179,10 +2990,8 @@ void SAL_CALL SwXTextDocument::render(
delete m_pPrintUIOptions; m_pPrintUIOptions = NULL;
}
}
-/* -----------------------------03.10.04 -------------------------------------
- ---------------------------------------------------------------------------*/
- // xforms::XFormsSupplier
+// xforms::XFormsSupplier
Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
throw( RuntimeException )
{
@@ -3192,20 +3001,15 @@ Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
return pDoc->getXForms();
}
-/* -----------------------------25.09.07 -------------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic)
throw ( uno::RuntimeException )
{
return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic );
}
-/*-- 07.05.2009 09:21:12---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
@@ -3222,22 +3026,17 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::
xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
}
-/* -----------------------------20.06.00 09:54--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextDocument::operator new( size_t t) throw()
{
return SwXTextDocumentBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 09:54--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextDocument::operator delete( void * p) throw()
{
SwXTextDocumentBaseClass::operator delete(p);
}
-
/*---------------------------------------------------
retrieve languages already used in current document
-----------------------------------------------------*/
@@ -3246,7 +3045,8 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
::sal_Int16 nMaxCount )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
+
// possible canonical values for nScriptTypes
// any bit wise combination is allowed
@@ -3260,7 +3060,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
const bool bComplex = 0 != (nScriptTypes & nComplex);
if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex))
- throw IllegalArgumentException(::rtl::OUString::createFromAscii("nScriptTypes ranges from 1 to 7!"), Reference< XInterface >(), 1);
+ throw IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nScriptTypes ranges from 1 to 7!")), Reference< XInterface >(), 1);
if (!pDocShell)
throw DisposedException();
SwDoc* pDoc = pDocShell->GetDoc();
@@ -3412,11 +3212,11 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
nMaxCount = static_cast< sal_Int16 >( aAllLangs.size() );
// build return value
- sal_Int32 nCount = 0;
uno::Sequence< lang::Locale > aLanguages( nMaxCount );
lang::Locale* pLanguage = aLanguages.getArray();
if (nMaxCount > 0)
{
+ sal_Int32 nCount = 0;
const SvtLanguageTable aLangTab;
for (std::set< LanguageType >::const_iterator it = aAllLangs.begin(); it != aAllLangs.end(); ++it)
{
@@ -3434,9 +3234,6 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
return aLanguages;
}
-/* -----------------25.10.99 11:06-------------------
-
- --------------------------------------------------*/
SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) :
pxDoc(&rxDoc)
{
@@ -3448,16 +3245,11 @@ SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) :
sOutlines = String(SW_RES(STR_CONTENT_TYPE_OUTLINE));
sBookmarks = String(SW_RES(STR_CONTENT_TYPE_BOOKMARK));
}
-/* -----------------25.10.99 11:11-------------------
- --------------------------------------------------*/
SwXLinkTargetSupplier::~SwXLinkTargetSupplier()
{
}
-/*-- 25.10.99 11:12:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Any SwXLinkTargetSupplier::getByName(const OUString& rName)
throw( NoSuchElementException, WrappedTargetException, RuntimeException )
{
@@ -3491,14 +3283,6 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0));
}
-/* else if(sToCompare == )
- {
- sSuffix += UniString::CreateFromAscii(pMarkToText);
- Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
- pxDoc->, sSuffix );
- Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
- aRet.setValue(&xRet, ::getCppuType((const XPropertySet*)0));
- }*/
else if(sToCompare == sGraphics)
{
sSuffix += UniString::CreateFromAscii(pMarkToGraphic);
@@ -3535,9 +3319,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
throw NoSuchElementException();
return aRet;
}
-/*-- 25.10.99 11:12:46---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< OUString > SwXLinkTargetSupplier::getElementNames(void)
throw( RuntimeException )
{
@@ -3552,9 +3334,7 @@ Sequence< OUString > SwXLinkTargetSupplier::getElementNames(void)
pNames[6] = sBookmarks;
return aRet;
}
-/*-- 25.10.99 11:12:46---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName)
throw( RuntimeException )
{
@@ -3569,40 +3349,30 @@ sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName)
return sal_True;
return sal_False;
}
-/*-- 25.10.99 11:12:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXLinkTargetSupplier::getElementType(void)
throw( RuntimeException )
{
return ::getCppuType((Reference< XPropertySet>*)0);
}
-/*-- 25.10.99 11:12:47---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkTargetSupplier::hasElements(void) throw( RuntimeException )
{
return 0 != pxDoc;
}
-/*-- 25.10.99 11:12:47---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXLinkTargetSupplier::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXLinkTargetSupplier");
}
-/*-- 25.10.99 11:12:48---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return (rServiceName == C2U("com.sun.star.document.LinkTargets"));
}
-/*-- 25.10.99 11:12:48---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void)
throw( RuntimeException )
{
@@ -3612,9 +3382,6 @@ Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void)
return aRet;
}
-/*-- 26.10.99 09:16:23---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(
Reference< XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix ) :
xRealAccess(xAccess),
@@ -3624,9 +3391,7 @@ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(
pxDoc(0)
{
}
-/* -----------------26.10.99 14:17-------------------
- --------------------------------------------------*/
SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc,
const String& rLinkDisplayName, String sSuffix) :
pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)),
@@ -3636,15 +3401,11 @@ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc,
pxDoc(&rxDoc)
{
}
-/*-- 26.10.99 09:16:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXLinkNameAccessWrapper::~SwXLinkNameAccessWrapper()
{
}
-/*-- 26.10.99 09:16:24---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXLinkNameAccessWrapper::getByName(const OUString& rName)
throw( NoSuchElementException, WrappedTargetException, RuntimeException )
{
@@ -3696,9 +3457,7 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName)
throw NoSuchElementException();
return aRet;
}
-/*-- 26.10.99 09:16:24---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void)
throw( RuntimeException )
{
@@ -3736,9 +3495,7 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void)
}
return aRet;
}
-/*-- 26.10.99 09:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkNameAccessWrapper::hasByName(const OUString& rName)
throw( RuntimeException )
{
@@ -3777,23 +3534,19 @@ sal_Bool SwXLinkNameAccessWrapper::hasByName(const OUString& rName)
}
return bRet;
}
-/*-- 26.10.99 09:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXLinkNameAccessWrapper::getElementType(void)
throw( RuntimeException )
{
return ::getCppuType((Reference<XPropertySet>*)0);
}
-/*-- 26.10.99 09:16:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException )
{
sal_Bool bRet = sal_False;
if(pxDoc)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
else
{
@@ -3801,18 +3554,14 @@ sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException )
}
return bRet;
}
-/*-- 26.10.99 09:16:26---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySetInfo > SwXLinkNameAccessWrapper::getPropertySetInfo(void)
throw( RuntimeException )
{
static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo();
return xRet;
}
-/*-- 26.10.99 09:16:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLinkNameAccessWrapper::setPropertyValue(
const OUString& , const Any& )
throw( UnknownPropertyException,
@@ -3823,9 +3572,7 @@ void SwXLinkNameAccessWrapper::setPropertyValue(
{
throw UnknownPropertyException();
}
-/* -----------------------------08.12.99 11:10--------------------------------
- ---------------------------------------------------------------------------*/
Any lcl_GetDisplayBitmap(String sLinkSuffix)
{
Any aRet;
@@ -3841,8 +3588,6 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix)
nImgId = CONTENT_TYPE_FRAME;
else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToGraphic))
nImgId = CONTENT_TYPE_GRAPHIC;
-// else if(== sLinkSuffix)
-// nImgId = CONTENT_TYPE_BOOKMARK;
else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToRegion))
nImgId = CONTENT_TYPE_REGION;
else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToOLE))
@@ -3852,8 +3597,7 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix)
if(USHRT_MAX != nImgId)
{
nImgId += 20000;
- sal_Bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList aEntryImages( SW_RES(bHighContrast ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP) );
+ ImageList aEntryImages( SW_RES(IMG_NAVI_ENTRYBMP) );
const Image& rImage = aEntryImages.GetImage( nImgId );
Bitmap aBitmap( rImage.GetBitmapEx().GetBitmap() );
Reference<awt::XBitmap> xBmp = VCLUnoHelper::CreateBitmap( aBitmap );
@@ -3861,9 +3605,7 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix)
}
return aRet;
}
-/*-- 26.10.99 09:16:27---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXLinkNameAccessWrapper::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
@@ -3880,62 +3622,44 @@ Any SwXLinkNameAccessWrapper::getPropertyValue(const OUString& rPropertyName)
throw UnknownPropertyException();
return aRet;
}
-/*-- 26.10.99 09:16:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLinkNameAccessWrapper::addPropertyChangeListener(
const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{}
-/*-- 26.10.99 09:16:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLinkNameAccessWrapper::removePropertyChangeListener(
const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{}
-/*-- 26.10.99 09:16:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLinkNameAccessWrapper::addVetoableChangeListener(
const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{}
-/*-- 26.10.99 09:16:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLinkNameAccessWrapper::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{}
-/*-- 26.10.99 09:16:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
Reference< XNameAccess > SwXLinkNameAccessWrapper::getLinks(void)
throw( RuntimeException )
{
return (SwXLinkNameAccessWrapper*)this;
}
-/*-- 26.10.99 09:21:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXLinkNameAccessWrapper::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXLinkNameAccessWrapper");
}
-/*-- 26.10.99 09:21:48---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return (rServiceName == C2U("com.sun.star.document.LinkTargets"));
}
-/*-- 26.10.99 09:21:48---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void)
throw( RuntimeException )
{
@@ -3944,31 +3668,23 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void)
pNames[0] = C2U("com.sun.star.document.LinkTargets");
return aRet;
}
-/* -----------------26.10.99 15:50-------------------
- --------------------------------------------------*/
SwXOutlineTarget::SwXOutlineTarget(const String& rOutlineText) :
pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)),
sOutlineText(rOutlineText)
{
}
-/*-- 26.10.99 15:51:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXOutlineTarget::~SwXOutlineTarget()
{
}
-/*-- 26.10.99 15:51:46---------------------------------------------------
- -----------------------------------------------------------------------*/
Reference< XPropertySetInfo > SwXOutlineTarget::getPropertySetInfo(void) throw( RuntimeException )
{
static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo();
return xRet;
}
-/*-- 26.10.99 15:51:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXOutlineTarget::setPropertyValue(
const OUString& /*PropertyName*/, const Any& /*aValue*/)
throw( UnknownPropertyException, PropertyVetoException,
@@ -3976,9 +3692,7 @@ void SwXOutlineTarget::setPropertyValue(
{
throw UnknownPropertyException();
}
-/*-- 26.10.99 15:51:46---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXOutlineTarget::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
@@ -3989,55 +3703,41 @@ Any SwXOutlineTarget::getPropertyValue(const OUString& rPropertyName)
throw UnknownPropertyException();
return aRet;
}
-/*-- 26.10.99 15:51:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXOutlineTarget::addPropertyChangeListener(
const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
}
-/*-- 26.10.99 15:51:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXOutlineTarget::removePropertyChangeListener(
const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
}
-/*-- 26.10.99 15:51:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXOutlineTarget::addVetoableChangeListener(
const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
}
-/*-- 26.10.99 15:51:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXOutlineTarget::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXOutlineTarget::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXOutlineTarget");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.document.LinkTarget") == ServiceName;
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence < OUString > aRet(1);
@@ -4046,23 +3746,17 @@ Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( Run
return aRet;
}
-/* -----------------------------17.01.01 16:06--------------------------------
- ---------------------------------------------------------------------------*/
SwXDocumentPropertyHelper::SwXDocumentPropertyHelper(SwDoc& rDoc) :
SvxUnoForbiddenCharsTable ( rDoc.getForbiddenCharacterTable() )
,m_pDoc(&rDoc)
{
}
-/* -----------------------------17.01.01 16:06--------------------------------
- ---------------------------------------------------------------------------*/
SwXDocumentPropertyHelper::~SwXDocumentPropertyHelper()
{
}
-/* -----------------------------17.01.01 16:06--------------------------------
- ---------------------------------------------------------------------------*/
Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
{
Reference<XInterface> xRet;
@@ -4070,7 +3764,7 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
{
switch(nWhich)
{
- // --> OD 2005-08-08 #i52858#
+ // #i52858#
// assure that Draw model is created, if it doesn't exist.
case SW_CREATE_DASH_TABLE :
if(!xDashTable.is())
@@ -4102,14 +3796,13 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
xMarkerTable = SvxUnoMarkerTable_createInstance( m_pDoc->GetOrCreateDrawModel() );
xRet = xMarkerTable;
break;
- // <--
case SW_CREATE_DRAW_DEFAULTS:
if(!xDrawDefaults.is())
xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc);
xRet = xDrawDefaults;
break;
-#ifdef DBG_UTIL
- default: DBG_ERROR("which table?");
+#if OSL_DEBUG_LEVEL > 1
+ default: OSL_FAIL("which table?");
#endif
}
}
@@ -4126,33 +3819,26 @@ void SwXDocumentPropertyHelper::Invalidate()
xMarkerTable = 0;
xDrawDefaults = 0;
m_pDoc = 0;
- SvxUnoForbiddenCharsTable::mxForbiddenChars.unbind();
+ SvxUnoForbiddenCharsTable::mxForbiddenChars.clear();
}
-/* -----------------13.08.2003 12:43-----------------
- --------------------------------------------------*/
void SwXDocumentPropertyHelper::onChange()
{
if(m_pDoc)
m_pDoc->SetModified();
}
-
-/*****************************************************************************/
-
SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ) :
m_rShell( rSh ),
m_aOldViewOptions( rViewOptions )
{
}
-
SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl()
{
m_rShell.ApplyViewOptions( m_aOldViewOptions );
}
-
void
SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions)
{
@@ -4209,7 +3895,4 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions)
}
}
-
-/*****************************************************************************/
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 3f7b0427b41c..c9a6b25ca868 100755..100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
#include <frmatr.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <IMark.hxx>
#include <unotxdoc.hxx>
#include <unodraw.hxx>
@@ -84,7 +85,7 @@
#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
-
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -93,28 +94,24 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::frame;
-using namespace rtl;
using ::com::sun::star::util::URL;
using comphelper::HelperBaseNoState;
+using ::rtl::OUString;
+
SV_IMPL_PTRARR( SelectionChangeListenerArr, XSelectionChangeListenerPtr );
-/* -----------------22.05.98 12:20-------------------
- *
- * --------------------------------------------------*/
SwPaM* lcl_createPamCopy(const SwPaM& rPam)
{
SwPaM *const pRet = new SwPaM(*rPam.GetPoint());
::sw::DeepCopyPaM(rPam, *pRet);
return pRet;
}
+
/******************************************************************
* SwXTextView
******************************************************************/
-/*-- 17.12.98 09:34:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextView::SwXTextView(SwView* pSwView) :
SfxBaseController(pSwView),
m_pView(pSwView),
@@ -124,16 +121,12 @@ SwXTextView::SwXTextView(SwView* pSwView) :
{
}
-/*-- 17.12.98 09:34:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextView::~SwXTextView()
{
Invalidate();
}
-/* -----------------------------09.03.01 15:47--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextView::Invalidate()
{
if(pxViewSettings)
@@ -174,12 +167,8 @@ void SwXTextView::Invalidate()
m_pView = 0;
}
-/* -----------------------------18.05.00 10:18--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeException)
{
-// uno::Sequence< uno::Type > aViewTypes = SwXTextViewBaseClass::getTypes();
uno::Sequence< uno::Type > aBaseTypes = SfxBaseController::getTypes();
long nIndex = aBaseTypes.getLength();
@@ -197,38 +186,27 @@ Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeExcep
pBaseTypes[nIndex++] = ::getCppuType((uno::Reference<datatransfer::XTransferableSupplier >*)0);
return aBaseTypes;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXTextViewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( ) throw(uno::RuntimeException)
{
- 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 = sal_True;
- }
- return aId;
+ return theSwXTextViewImplementationId::get().getSeq();
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextView::acquire( )throw()
{
SfxBaseController::acquire();
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextView::release( )throw()
{
SfxBaseController::release();
}
-/* -----------------------------18.05.00 10:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType )
throw (RuntimeException)
{
@@ -282,12 +260,10 @@ uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType )
aRet = SfxBaseController::queryInterface(aType);
return aRet;
}
-/*-- 17.12.98 09:34:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< uno::XInterface > xInterface;
if(GetView() && (aInterface >>= xInterface))
{
@@ -476,7 +452,6 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
SdrObject *pObj = pSvxShape->GetSdrObject();
if (pObj)
{
-// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj );
SdrPageView* pPV = pDrawView->GetSdrPageView();
if ( pPV && pObj->GetPage() == pPV->GetPage() )
{
@@ -509,7 +484,6 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
if (!pPV) // erstes Objekt
{
-// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj );
pPV = pDrawView->GetSdrPageView();
}
if ( pPV && pObj->GetPage() == pPV->GetPage() )
@@ -529,12 +503,10 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
return sal_False;
}
-/*-- 17.12.98 09:34:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< uno::XInterface > aRef;
if(GetView())
{
@@ -549,7 +521,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
{
if(rSh.GetTableCrsr())
{
- DBG_ASSERT(rSh.GetTableFmt(), "kein Tabellenformat?");
+ OSL_ENSURE(rSh.GetTableFmt(), "kein Tabellenformat?");
uno::Reference< text::XTextTableCursor > xCrsr = new SwXTextTableCursor(*rSh.GetTableFmt(),
rSh.GetTableCrsr());
aRef = uno::Reference< uno::XInterface > (xCrsr, uno::UNO_QUERY);;
@@ -633,26 +605,22 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
uno::Any aRet(&aRef, ::getCppuType((uno::Reference<uno::XInterface>*)0));
return aRet;
}
-/*-- 17.12.98 09:34:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextView::addSelectionChangeListener(
const uno::Reference< view::XSelectionChangeListener > & rxListener)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< view::XSelectionChangeListener > * pInsert = new uno::Reference< view::XSelectionChangeListener > ;
*pInsert = rxListener;
aSelChangedListeners.Insert(pInsert, aSelChangedListeners.Count());
}
-/*-- 17.12.98 09:34:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextView::removeSelectionChangeListener(
const uno::Reference< view::XSelectionChangeListener > & rxListener)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
view::XSelectionChangeListener* pLeft = rxListener.get();
for(sal_uInt16 i = 0; i < aSelChangedListeners.Count(); i++)
{
@@ -666,9 +634,7 @@ void SwXTextView::removeSelectionChangeListener(
}
}
}
-/* -----------------------------01.06.01 14:41--------------------------------
- ---------------------------------------------------------------------------*/
SdrObject* SwXTextView::GetControl(
const uno::Reference< awt::XControlModel > & xModel,
uno::Reference< awt::XControl >& xToFill )
@@ -678,37 +644,32 @@ SdrObject* SwXTextView::GetControl(
SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
- DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
+ OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
SdrObject* pControl = NULL;
if ( pFormShell && pDrawView && pWindow )
pControl = pFormShell->GetFormControl( xModel, *pDrawView, *pWindow, xToFill );
return pControl;
}
-/*-- 17.12.98 09:34:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< awt::XControl > SwXTextView::getControl(const uno::Reference< awt::XControlModel > & xModel)
throw( container::NoSuchElementException, uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< awt::XControl > xRet;
GetControl(xModel, xRet);
return xRet;
}
-/*-- 08.03.07 13:55------------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormController( const uno::Reference< form::XForm >& _Form ) throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SwView* pView2 = GetView();
FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
- DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" );
+ OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" );
uno::Reference< form::runtime::XFormController > xController;
if ( pFormShell && pDrawView && pWindow )
@@ -716,35 +677,26 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo
return xController;
}
-/*-- 08.03.07 13:55------------------------------------------------------
-
- -----------------------------------------------------------------------*/
::sal_Bool SAL_CALL SwXTextView::isFormDesignMode( ) throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SwView* pView2 = GetView();
FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
return pFormShell ? pFormShell->IsDesignMode() : sal_True;
}
-/*-- 08.03.07 13:55------------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextView::setFormDesignMode( ::sal_Bool _DesignMode ) throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SwView* pView2 = GetView();
FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
if ( pFormShell )
pFormShell->SetDesignMode( _DesignMode );
}
-/*-- 17.12.98 09:34:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(GetView())
{
if(!pxTextViewCursor)
@@ -757,12 +709,10 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw(
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:34:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if(!pxViewSettings)
@@ -775,12 +725,10 @@ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw(
throw uno::RuntimeException();
return *pxViewSettings;
}
-/* -----------------------------30.01.01 15:01--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAutomatic*/ ) throw(RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetView())
throw RuntimeException();
@@ -808,29 +756,27 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto
pRet[n].realloc(5);
PropertyValue* pValues = pRet[n].getArray();
- pValues[0].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_BASE_TEXT));
+ pValues[0].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_BASE_TEXT));
pValues[0].Value <<= OUString(rEntryText);
- pValues[1].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_TEXT));
+ pValues[1].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_TEXT));
pValues[1].Value <<= OUString(rAttr.GetText());
- pValues[2].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_CHAR_STYLE_NAME));
+ pValues[2].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_CHAR_STYLE_NAME));
SwStyleNameMapper::FillProgName(rAttr.GetCharFmtName(), aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
pValues[2].Value <<= OUString( aString );
- pValues[3].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_ADJUST));
+ pValues[3].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_ADJUST));
pValues[3].Value <<= (sal_Int16)rAttr.GetAdjustment();
- pValues[4].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_IS_ABOVE));
+ pValues[4].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_IS_ABOVE));
sal_Bool bVal = !rAttr.GetPosition();
pValues[4].Value.setValue(&bVal, ::getBooleanCppuType());
}
return aRet;
}
-/* -----------------------------30.01.01 15:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextView::setRubyList(
const Sequence< Sequence< PropertyValue > >& rRubyList, sal_Bool /*bAutomatic*/ )
throw(RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetView() || !rRubyList.getLength())
throw RuntimeException();
@@ -898,9 +844,7 @@ void SAL_CALL SwXTextView::setRubyList(
SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 );
}
-/*-- 29.12.02 15:45:29---------------------------------------------------
- -----------------------------------------------------------------------*/
SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc()
{
SwWrtShell& rOldSh = m_pView->GetWrtShell();
@@ -936,12 +880,9 @@ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc()
return xDocSh;
}
-/*-- 17.12.98 09:34:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextView::NotifySelChanged()
{
- DBG_ASSERT( m_pView, "view is missing" );
+ OSL_ENSURE( m_pView, "view is missing" );
// destroy temporary document with selected text that is used
// in PDF export of (multi-)selections.
@@ -962,13 +903,11 @@ void SwXTextView::NotifySelChanged()
(*pObj)->selectionChanged(aEvent);
}
}
-/* -----------------------------12.07.01 13:26--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextView::NotifyDBChanged()
{
URL aURL;
- aURL.Complete = C2U(SwXDispatch::GetDBChangeURL());
+ aURL.Complete = rtl::OUString::createFromAscii(SwXDispatch::GetDBChangeURL());
sal_uInt16 nCount = aSelChangedListeners.Count();
for ( sal_uInt16 i = nCount; i--; )
@@ -980,24 +919,19 @@ void SwXTextView::NotifyDBChanged()
}
}
-/* -----------------------------10.12.04 11:07--------------------------------
-
- ---------------------------------------------------------------------------*/
-
uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetInfo( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
static uno::Reference< XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo();
return aRef;
}
-
void SAL_CALL SwXTextView::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName );
if (!pEntry)
throw UnknownPropertyException();
@@ -1023,17 +957,16 @@ void SAL_CALL SwXTextView::setPropertyValue(
}
break;
default :
- DBG_ERROR("unknown WID");
+ OSL_FAIL("unknown WID");
}
}
}
-
uno::Any SAL_CALL SwXTextView::getPropertyValue(
const OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Any aRet;
@@ -1074,67 +1007,56 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue(
}
break;
default :
- DBG_ERROR("unknown WID");
+ OSL_FAIL("unknown WID");
}
}
return aRet;
}
-
void SAL_CALL SwXTextView::addPropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-
void SAL_CALL SwXTextView::removePropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-
void SAL_CALL SwXTextView::addVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-
void SAL_CALL SwXTextView::removeVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
-/* -----------------------------06.04.00 11:07--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextView::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextView");
}
-/* -----------------------------06.04.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextView::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
- return rServiceName.equalsAscii("com.sun.star.text.TextDocumentView") ||
- rServiceName.equalsAscii("com.sun.star.view.OfficeDocumentView");
+ return rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocumentView")) ||
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.view.OfficeDocumentView"));
}
-/* -----------------------------06.04.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(2);
@@ -1147,23 +1069,15 @@ Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeE
/******************************************************************
* SwXTextViewCursor
******************************************************************/
-/*-- 17.12.98 09:36:23---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextViewCursor::SwXTextViewCursor(SwView* pVw) :
m_pView(pVw),
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR))
{
}
-/*-- 17.12.98 09:36:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextViewCursor::~SwXTextViewCursor()
{
}
-/*-- 06.10.04 09:36:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
// used to determine if there is a text selction or not.
// If there is no text selection the functions that need a working
@@ -1173,12 +1087,11 @@ SwXTextViewCursor::~SwXTextViewCursor()
// - XTextCursor
// - XTextRange
// - XLineCursor
-
sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const
{
sal_Bool bRes = sal_False;
- DBG_ASSERT(m_pView, "m_pView is NULL ???");
+ OSL_ENSURE(m_pView, "m_pView is NULL ???");
if(m_pView)
{
//! m_pView->GetShellMode() will only work after the shell
@@ -1191,29 +1104,22 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const
return bRes;
}
-/*-- 17.12.98 09:36:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::isVisible(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
- DBG_WARNING("not implemented");
+ SolarMutexGuard aGuard;
+ OSL_FAIL("not implemented");
return sal_True;
}
-/*-- 17.12.98 09:36:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::setVisible(sal_Bool /*bVisible*/) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
- DBG_WARNING("not implemented");
+ SolarMutexGuard aGuard;
+ OSL_FAIL("not implemented");
}
-/*-- 17.12.98 09:36:26---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
awt::Point aRet;
if(m_pView)
{
@@ -1234,12 +1140,10 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return aRet;
}
-/*-- 17.12.98 09:36:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection())
@@ -1259,12 +1163,10 @@ void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:36:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection())
@@ -1284,12 +1186,10 @@ void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:36:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1304,12 +1204,10 @@ sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException )
return bRet;
}
-/*-- 17.12.98 09:36:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1323,12 +1221,10 @@ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( un
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1343,15 +1239,13 @@ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( u
return bRet;
}
-/* -----------------08.03.99 11:18-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextViewCursor::gotoRange(
const uno::Reference< text::XTextRange > & xRange,
sal_Bool bExpand)
throw(RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView && xRange.is())
{
if (!IsTextSelection())
@@ -1487,12 +1381,10 @@ void SwXTextViewCursor::gotoRange(
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:36:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection())
@@ -1503,12 +1395,10 @@ void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:36:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection())
@@ -1519,12 +1409,10 @@ void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 09:36:28---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1541,12 +1429,10 @@ sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:29---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1564,12 +1450,10 @@ sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:30---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
bRet = m_pView->GetWrtShell().GotoPage(nPage, sal_True);
@@ -1577,12 +1461,10 @@ sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeExcep
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:30---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
bRet = m_pView->GetWrtShell().SttNxtPg();
@@ -1590,12 +1472,10 @@ sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:31---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
bRet = m_pView->GetWrtShell().EndPrvPg();
@@ -1603,12 +1483,10 @@ sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeExceptio
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:32---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
bRet = m_pView->GetWrtShell().EndPg();
@@ -1616,12 +1494,10 @@ sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:32---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
bRet = m_pView->GetWrtShell().SttPg();
@@ -1629,12 +1505,10 @@ sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException
throw uno::RuntimeException();
return bRet;
}
-/* -----------------04.10.99 14:21-------------------
- --------------------------------------------------*/
sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
short nRet = 0;
if(m_pView)
{
@@ -1646,12 +1520,10 @@ sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return nRet;
}
-/*-- 17.12.98 09:36:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1664,12 +1536,10 @@ sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 09:36:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1682,12 +1552,10 @@ sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 11:59:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XText > xRet;
if(m_pView)
{
@@ -1703,12 +1571,10 @@ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::Runt
throw uno::RuntimeException();
return xRet;
}
-/*-- 17.12.98 11:59:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
if(m_pView)
{
@@ -1724,12 +1590,10 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno
throw uno::RuntimeException();
return xRet;
}
-/*-- 17.12.98 11:59:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
if(m_pView)
{
@@ -1745,12 +1609,10 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno::
throw uno::RuntimeException();
return xRet;
}
-/* -----------------12.10.99 09:03-------------------
- --------------------------------------------------*/
OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString uRet;
if(m_pView)
{
@@ -1778,12 +1640,10 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException )
}
return uRet;
}
-/*-- 17.12.98 11:59:06---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection( sal_False ))
@@ -1810,22 +1670,17 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx
}
}
-/*-- 29.06.00 17:33:38---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< XPropertySetInfo > SwXTextViewCursor::getPropertySetInfo( ) throw(RuntimeException)
{
static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 29.06.00 17:33:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException,
IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
SwWrtShell& rSh = m_pView->GetWrtShell();
@@ -1842,13 +1697,11 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const
else
throw RuntimeException();
}
-/*-- 29.06.00 17:33:39---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Any aRet;
if(m_pView)
{
@@ -1861,44 +1714,34 @@ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName )
throw RuntimeException();
return aRet;
}
-/*-- 29.06.00 17:33:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::addPropertyChangeListener(
const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 29.06.00 17:33:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::removePropertyChangeListener(
const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*aListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 29.06.00 17:33:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::addVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 29.06.00 17:33:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 29.06.00 17:33:41---------------------------------------------------
- -----------------------------------------------------------------------*/
PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyName )
throw(UnknownPropertyException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
PropertyState eState;
if(m_pView)
{
@@ -1911,13 +1754,11 @@ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyNam
throw RuntimeException();
return eState;
}
-/*-- 29.06.00 17:33:42---------------------------------------------------
- -----------------------------------------------------------------------*/
Sequence< PropertyState > SwXTextViewCursor::getPropertyStates(
const Sequence< OUString >& rPropertyNames ) throw(UnknownPropertyException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Sequence< PropertyState > aRet;
if(m_pView)
{
@@ -1928,13 +1769,11 @@ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates(
}
return aRet;
}
-/*-- 29.06.00 17:33:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName )
throw(UnknownPropertyException, RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
SwWrtShell& rSh = m_pView->GetWrtShell();
@@ -1943,14 +1782,12 @@ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName )
*pShellCrsr, *m_pPropSet, rPropertyName);
}
}
-/*-- 29.06.00 17:33:43---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
Any aRet;
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
SwWrtShell& rSh = m_pView->GetWrtShell();
@@ -1960,12 +1797,10 @@ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName )
}
return aRet;
}
-/*-- 28.09.99 08:31:19---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1979,12 +1814,10 @@ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( un
throw uno::RuntimeException();
return bRet;
}
-/*-- 28.09.99 08:31:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -1998,12 +1831,10 @@ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno:
throw uno::RuntimeException();
return bRet;
}
-/*-- 28.09.99 08:31:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -2016,12 +1847,10 @@ sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 28.09.99 08:31:21---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(m_pView)
{
@@ -2034,12 +1863,10 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 28.09.99 08:31:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection( sal_False ))
@@ -2050,12 +1877,10 @@ void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeExcep
else
throw uno::RuntimeException();
}
-/*-- 28.09.99 08:31:22---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_pView)
{
if (!IsTextSelection( sal_False ))
@@ -2066,16 +1891,12 @@ void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeExc
else
throw uno::RuntimeException();
}
-/* -----------------------------06.04.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextViewCursor::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextViewCursor");
}
-/* -----------------------------06.04.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return !rServiceName.compareToAscii("com.sun.star.text.TextViewCursor") ||
@@ -2086,9 +1907,7 @@ sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw(
!rServiceName.compareToAscii("com.sun.star.style.ParagraphPropertiesAsian") ||
!rServiceName.compareToAscii("com.sun.star.style.ParagraphPropertiesComplex");
}
-/* -----------------------------06.04.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(7);
@@ -2102,17 +1921,17 @@ Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( Ru
pArray[6] = C2U("com.sun.star.style.ParagraphPropertiesComplex");
return aRet;
}
-/* -----------------------------03.03.03 11:07--------------------------------
- ---------------------------------------------------------------------------*/
+namespace
+{
+ class theSwXTextViewCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewCursorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextViewCursorUnoTunnelId::get().getSeq();
}
-/* -----------------------------03.03.03 11:07--------------------------------
- ---------------------------------------------------------------------------*/
//XUnoTunnel
sal_Int64 SAL_CALL SwXTextViewCursor::getSomething(
const uno::Sequence< sal_Int8 >& rId )
@@ -2126,7 +1945,6 @@ sal_Int64 SAL_CALL SwXTextViewCursor::getSomething(
}
return OTextCursorHelper::getSomething(rId);;
}
-// -----------------------------------------------------------------------------
IMPLEMENT_FORWARD_XINTERFACE2(SwXTextViewCursor,SwXTextViewCursor_Base,OTextCursorHelper)
const SwDoc* SwXTextViewCursor::GetDoc() const
@@ -2134,19 +1952,19 @@ const SwDoc* SwXTextViewCursor::GetDoc() const
SwWrtShell& rSh = m_pView->GetWrtShell();
return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0;
}
-// -----------------------------------------------------------------------------
+
SwDoc* SwXTextViewCursor::GetDoc()
{
SwWrtShell& rSh = m_pView->GetWrtShell();
return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0;
}
-// -----------------------------------------------------------------------------
+
const SwPaM* SwXTextViewCursor::GetPaM() const
{
SwWrtShell& rSh = m_pView->GetWrtShell();
return rSh.GetCrsr();
}
-// -----------------------------------------------------------------------------
+
SwPaM* SwXTextViewCursor::GetPaM()
{
SwWrtShell& rSh = m_pView->GetWrtShell();
@@ -2155,7 +1973,7 @@ SwPaM* SwXTextViewCursor::GetPaM()
uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransferable( ) throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
//force immediat shell update
GetView()->StopShellTimer();
@@ -2179,7 +1997,7 @@ uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransfera
void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfer::XTransferable >& xTrans ) throw (datatransfer::UnsupportedFlavorException, uno::RuntimeException)
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
//force immediat shell update
GetView()->StopShellTimer();
@@ -2203,5 +2021,4 @@ void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfe
}
}
-// -----------------------------------------------------------------------------
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 1b4dcc90f82d..79b59b8b66ea 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,9 +61,7 @@
#include <charfmt.hxx>
#include <fmtcol.hxx>
#include <tox.hxx>
-#ifndef _ATTRDESC_HRC
#include <attrdesc.hrc>
-#endif
#include <fmtftntx.hxx>
#include <fmtfollowtextflow.hxx>
@@ -72,14 +71,14 @@ using namespace com::sun::star;
TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient);
-// erfrage die Attribut-Beschreibung
+// query the attribute descriptions
void SwAttrSet::GetPresentation(
SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText ) const
{
-static sal_Char __READONLY_DATA sKomma[] = ", ";
+static sal_Char const sKomma[] = ", ";
rText.Erase();
String aStr;
@@ -912,20 +911,12 @@ SfxItemPresentation SwFmtFtnEndAtTxtEnd::GetPresentation
switch( GetValue() )
{
case FTNEND_ATPGORDOCEND:
-// rText = SW_RESSTR( STR_LAYOUT_FTN );
break;
case FTNEND_ATTXTEND:
break;
case FTNEND_ATTXTEND_OWNNUMSEQ:
- {
-// String sPrefix;
-// String sSuffix;
-// SvxNumberType aFmt;
-// sal_uInt16 nOffset;
-// rText +=
- }
break;
}
}
@@ -1063,20 +1054,6 @@ SfxItemPresentation SwHeaderAndFooterEatSpacingItem::GetPresentation
const IntlWrapper* /*pIntl*/
) const
{
-// rText.Erase();
-// switch ( ePres )
-// {
-// case SFX_ITEM_PRESENTATION_NONE:
-// rText.Erase();
-// break;
-// case SFX_ITEM_PRESENTATION_NAMELESS:
-// case SFX_ITEM_PRESENTATION_COMPLETE:
-// {
-// if ( GetValue() )
-// rText = SW_RESSTR(STR_EDIT_IN_READONLY);
-// return ePres;
-// }
-// }
return SFX_ITEM_PRESENTATION_NONE;
}
@@ -1348,3 +1325,4 @@ SfxItemPresentation SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation eP
return ePres;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/attrdesc.src b/sw/source/ui/utlui/attrdesc.src
index 809af110da6f..474ff791e7ec 100644
--- a/sw/source/ui/utlui/attrdesc.src
+++ b/sw/source/ui/utlui/attrdesc.src
@@ -32,7 +32,6 @@
---------------------------------------------------------------------*/
String STR_DROP_OVER
{
- /* ### ACHTUNG: Neuer Text in Resource? Initialen über : Initialen ³ber */
Text [ en-US ] = "Drop Caps over" ;
};
String STR_DROP_LINES
@@ -77,12 +76,10 @@ String STR_NO_CHARFMT
};
String STR_FOOTER
{
- /* ### ACHTUNG: Neuer Text in Resource? Fußzeile : Fu˜zeile */
Text [ en-US ] = "Footer" ;
};
String STR_NO_FOOTER
{
- /* ### ACHTUNG: Neuer Text in Resource? keine Fußzeile : keine Fu˜zeile */
Text [ en-US ] = "No footer" ;
};
String STR_HEADER
@@ -127,7 +124,6 @@ String STR_SURROUND_INSIDE
};
String STR_SURROUND_OUTSIDE
{
- /* ### ACHTUNG: Neuer Text in Resource? Umlauf außen : Umlauf au˜en */
Text [ en-US ] = "Outer wrap" ;
};
String STR_SURROUND_ANCHORONLY
@@ -140,12 +136,10 @@ String STR_FRM_WIDTH
};
String STR_FRM_FIXEDHEIGHT
{
- /* ### ACHTUNG: Neuer Text in Resource? feste Höhe: : feste H÷he: */
Text [ en-US ] = "Fixed height:" ;
};
String STR_FRM_MINHEIGHT
{
- /* ### ACHTUNG: Neuer Text in Resource? min. Höhe: : min. H÷he: */
Text [ en-US ] = "Min. height:" ;
};
String STR_FLY_AT_PARA
@@ -218,7 +212,6 @@ String STR_HORI_INSIDE
};
String STR_HORI_OUTSIDE
{
- /* ### ACHTUNG: Neuer Text in Resource? außen : au˜en */
Text [ en-US ] = "outside" ;
};
String STR_HORI_FULL
@@ -235,17 +228,10 @@ String STR_LINE_WIDTH
};
String STR_MAX_FTN_HEIGHT
{
- /* ### ACHTUNG: Neuer Text in Resource? max. Fußnotenbereich: : max. Fu˜notenbereich: */
Text [ en-US ] = "Max. footnote area:" ;
};
String STR_EDIT_IN_READONLY
{
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im Schreibeschütztem Dokument */
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im Schreibeschütztem Dokument */
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im Schreibeschütztem Dokument */
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im Schreibeschütztem Dokument */
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im Schreibeschütztem Dokument */
- /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgeschütztem Dokument : editierbar im schreibgesch³tztem Dokument */
Text [ en-US ] = "Editable in read-only document" ;
};
String STR_LAYOUT_SPLIT
diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx
index 5b112f84ba0d..9836dc827e05 100644
--- a/sw/source/ui/utlui/bookctrl.cxx
+++ b/sw/source/ui/utlui/bookctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,17 +38,10 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <sfx2/dispatch.hxx>
-#ifndef _EVENT_HXX //autogen
#include <vcl/event.hxx>
-#endif
-#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
-#endif
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
#include "cmdid.h"
-#include "errhdl.hxx"
#include "swmodule.hxx"
#include "wrtsh.hxx"
#include "IMark.hxx"
@@ -71,16 +65,12 @@ private:
virtual void Select();
};
-// -----------------------------------------------------------------------
-
BookmarkPopup_Impl::BookmarkPopup_Impl() :
PopupMenu(),
nCurId(USHRT_MAX)
{
}
-// -----------------------------------------------------------------------
-
void BookmarkPopup_Impl::Select()
{
nCurId = GetCurItemId();
@@ -95,14 +85,10 @@ SwBookmarkControl::SwBookmarkControl( sal_uInt16 _nSlotId,
{
}
-// -----------------------------------------------------------------------
-
SwBookmarkControl::~SwBookmarkControl()
{
}
-// -----------------------------------------------------------------------
-
void SwBookmarkControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
@@ -115,15 +101,11 @@ void SwBookmarkControl::StateChanged(
}
}
-// -----------------------------------------------------------------------
-
void SwBookmarkControl::Paint( const UserDrawEvent& )
{
GetStatusBar().SetItemText( GetId(), sPageNumber );
}
-// -----------------------------------------------------------------------
-
void SwBookmarkControl::Command( const CommandEvent& rCEvt )
{
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU &&
@@ -162,3 +144,5 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt )
ReleaseMouse();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/condedit.cxx b/sw/source/ui/utlui/condedit.cxx
index ed2379dae8b1..72994ff0f671 100644
--- a/sw/source/ui/utlui/condedit.cxx
+++ b/sw/source/ui/utlui/condedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// include ---------------------------------------------------------------
-
-
#include <sot/formats.hxx>
-#ifndef _CONDEDIT_HXX
#include <condedit.hxx>
-#endif
#include <svx/dbaexchange.hxx>
using namespace ::svx;
using ::rtl::OUString;
@@ -44,10 +40,6 @@ using namespace ::com::sun::star::uno;
// STATIC DATA -----------------------------------------------------------
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
ConditionEdit::ConditionEdit( Window* pParent, const ResId& rResId )
: Edit( pParent, rResId ),
DropTargetHelper( this ),
@@ -58,7 +50,6 @@ ConditionEdit::ConditionEdit( Window* pParent, const ResId& rResId )
/*--------------------------------------------------------------------
Beschreibung: Drop moeglich, bzw Format bekannt?
--------------------------------------------------------------------*/
-
sal_Int8 ConditionEdit::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
{
return OColumnTransferable::canExtractColumnDescriptor
@@ -106,3 +97,4 @@ sal_Int8 ConditionEdit::ExecuteDrop( const ExecuteDropEvent& rEvt )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 62ceb3860fe6..51f45297805d 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,6 @@
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
-#include <errhdl.hxx>
#include <docsh.hxx>
#include <content.hxx>
#include <frmfmt.hxx>
@@ -83,7 +83,6 @@
#include <svx/svdpage.hxx>
#include <svx/svdview.hxx>
#include <vcl/scrbar.hxx>
-#include <comcore.hrc>
#include <SwRewriter.hxx>
#include <hints.hxx>
#include <numrule.hxx>
@@ -98,6 +97,7 @@
#include "globals.hrc"
#include <unomid.h>
+#include "navmgr.hxx"
#define CTYPE_CNT 0
#define CTYPE_CTT 1
@@ -108,20 +108,14 @@ using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
-
#define NAVI_BOOKMARK_DELIM (sal_Unicode)1
-/***************************************************************************
-
-***************************************************************************/
-
typedef SwContent* SwContentPtr;
SV_DECL_PTRARR_SORT_DEL( SwContentArr, SwContentPtr, 0,4)
SV_IMPL_OP_PTRARR_SORT(SwContentArr, SwContentPtr)
sal_Bool SwContentTree::bIsInDrag = sal_False;
-
namespace
{
static sal_Bool lcl_IsContent(SvLBoxEntry* pEntry)
@@ -129,13 +123,11 @@ namespace
return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT;
}
-
static sal_Bool lcl_IsContentType(SvLBoxEntry* pEntry)
{
return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT;
}
-
static sal_Bool lcl_FindShell(SwWrtShell* pShell)
{
sal_Bool bFound = sal_False;
@@ -162,7 +154,6 @@ namespace
Beschreibung: Inhalt, enthaelt Namen und Verweis auf den Inhalstyp
***************************************************************************/
-
SwContent::SwContent(const SwContentType* pCnt, const String& rName, long nYPos) :
SwTypeNumber(CTYPE_CNT),
pParent(pCnt),
@@ -172,7 +163,6 @@ SwContent::SwContent(const SwContentType* pCnt, const String& rName, long nYPos)
{
}
-
sal_uInt8 SwTypeNumber::GetTypeId()
{
return nTypeId;
@@ -203,6 +193,7 @@ sal_Bool SwURLFieldContent::IsProtect() const
SwGraphicContent::~SwGraphicContent()
{
}
+
SwTOXBaseContent::~SwTOXBaseContent()
{
}
@@ -211,7 +202,6 @@ SwTOXBaseContent::~SwTOXBaseContent()
Beschreibung: Inhaltstyp, kennt seine Inhalte und die WrtShell
***************************************************************************/
-
SwContentType::SwContentType(SwWrtShell* pShell, sal_uInt16 nType, sal_uInt8 nLevel) :
SwTypeNumber(CTYPE_CTT),
pWrtShell(pShell),
@@ -233,7 +223,6 @@ SwContentType::SwContentType(SwWrtShell* pShell, sal_uInt16 nType, sal_uInt8 nLe
Beschreibung: Initialisierung
***************************************************************************/
-
void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
// wenn sich der MemberCount aendert ...
@@ -336,7 +325,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
if( !pFmt->GetInfo( aAskItem ) &&
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
- pMember->Insert(pCnt);//, pMember->Count());
+ pMember->Insert(pCnt);
sal_uInt16 nPos = pMember->Count() - 1;
if(nOldRegionCount > nPos &&
@@ -394,7 +383,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
RTL_TEXTENCODING_UTF8 ),
&p->rINetAttr,
n );
- pMember->Insert( pCnt );//, n );
+ pMember->Insert( pCnt );
}
bEdit = sal_True;
nOldMemberCount = nMemberCount;
@@ -431,28 +420,8 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
nMemberCount++;
}
}
- /*
- // this code can be used once we want redline comments in the margin
- else // redcomment
- {
- SwRedline* pRedline = static_cast<SwRedline*>((*i)->GetBroadCaster());
- if ( pRedline->GetComment() != String(::rtl::OUString::createFromAscii("")) )
- {
- String sEntry = pRedline->GetComment();
- RemoveNewline(sEntry);
- SwPostItContent* pCnt = new SwPostItContent(
- this,
- sEntry, // hier steht der Text
- pRedline,
- nMemberCount);
- pMember->Insert(pCnt);
- nMemberCount++;
- }
- }
- */
}
}
- //
sTypeToken = aEmptyStr;
bEdit = sal_True;
nOldMemberCount = nMemberCount;
@@ -470,10 +439,8 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
for( sal_uInt32 i=0; i< nCount; i++ )
{
SdrObject* pTemp = pPage->GetObj(i);
- // --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len())
+ // #i51726# - all drawing objects can be named now
if ( pTemp->GetName().Len() )
- // <--
nMemberCount++;
}
}
@@ -487,11 +454,6 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
bDataValid = sal_False;
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
SwContentType::~SwContentType()
{
delete pMember;
@@ -501,7 +463,6 @@ SwContentType::~SwContentType()
Beschreibung: Inhalt liefern, dazu gfs. die Liste fuellen
***************************************************************************/
-
const SwContent* SwContentType::GetMember(sal_uInt16 nIndex)
{
if(!bDataValid || !pMember)
@@ -515,12 +476,6 @@ const SwContent* SwContentType::GetMember(sal_uInt16 nIndex)
}
-
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
void SwContentType::Invalidate()
{
bDataValid = sal_False;
@@ -530,7 +485,6 @@ void SwContentType::Invalidate()
Beschreibung: Liste der Inhalte fuellen
***************************************************************************/
-
void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
{
SwContentArr* pOldMember = 0;
@@ -584,9 +538,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
case CONTENT_TYPE_TABLE :
{
- DBG_ASSERT(nMemberCount ==
- pWrtShell->GetTblFrmFmtCount(sal_True),
- "MemberCount differiert");
+ OSL_ENSURE(nMemberCount == pWrtShell->GetTblFrmFmtCount(sal_True),
+ "MemberCount differs");
Point aNullPt;
nMemberCount = pWrtShell->GetTblFrmFmtCount(sal_True);
for(sal_uInt16 i = 0; i < nMemberCount; i++)
@@ -600,7 +553,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
- pMember->Insert(pCnt);//, i);
+ pMember->Insert(pCnt);
if(nOldMemberCount > (int)i &&
(pOldMember->GetObject(i))->IsInvisible() != pCnt->IsInvisible())
@@ -617,8 +570,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
eType = FLYCNTTYPE_OLE;
else if(nContentType == CONTENT_TYPE_GRAPHIC)
eType = FLYCNTTYPE_GRF;
- DBG_ASSERT(nMemberCount == pWrtShell->GetFlyCount(eType),
- "MemberCount differiert");
+ OSL_ENSURE(nMemberCount == pWrtShell->GetFlyCount(eType),
+ "MemberCount differs");
Point aNullPt;
nMemberCount = pWrtShell->GetFlyCount(eType);
for(sal_uInt16 i = 0; i < nMemberCount; i++)
@@ -645,7 +598,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
if( !pFrmFmt->GetInfo( aAskItem ) &&
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
- pMember->Insert(pCnt);//, i);
+ pMember->Insert(pCnt);
if(nOldMemberCount > (int)i &&
(pOldMember->GetObject(i))->IsInvisible() != pCnt->IsInvisible())
*pbLevelOrVisibiblityChanged = sal_True;
@@ -664,7 +617,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
const String& rBkmName = ppBookmark->get()->GetName();
//nYPos von 0 -> text::Bookmarks werden nach Alphabet sortiert
SwContent* pCnt = new SwContent(this, rBkmName, 0);
- pMember->Insert(pCnt);//, pMember->Count());
+ pMember->Insert(pCnt);
}
}
}
@@ -697,7 +650,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
if( !pFmt->GetInfo( aAskItem ) &&
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
- pMember->Insert(pCnt);//, pMember->Count());
+ pMember->Insert(pCnt);
sal_uInt16 nPos = pMember->Count() - 1;
if(nOldMemberCount > nPos &&
@@ -719,7 +672,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
//Referenzen nach Alphabet sortiert
SwContent* pCnt = new SwContent(
this, *aRefMarks.GetObject(i), 0);
- pMember->Insert(pCnt);//, i);
+ pMember->Insert(pCnt);
}
}
break;
@@ -740,7 +693,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
RTL_TEXTENCODING_UTF8 ),
&p->rINetAttr,
n );
- pMember->Insert( pCnt );//, n );
+ pMember->Insert( pCnt );
}
}
break;
@@ -760,7 +713,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
- pMember->Insert( pCnt );//, nTox );
+ pMember->Insert( pCnt );
sal_uInt16 nPos = pMember->Count() - 1;
if(nOldMemberCount > nPos &&
(pOldMember->GetObject(nPos))->IsInvisible()
@@ -798,27 +751,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
nMemberCount++;
}
}
- /* this code can be used once we want redline comments in the margin
- else // redcomment
- {
- SwRedline* pRedline = static_cast<SwRedline*>((*i)->GetBroadCaster());
- if ( pRedline->GetComment() != String(::rtl::OUString::createFromAscii("")) )
- {
- String sEntry = pRedline->GetComment();
- RemoveNewline(sEntry);
- SwPostItContent* pCnt = new SwPostItContent(
- this,
- sEntry,
- pRedline,
- nMemberCount);
- pMember->Insert(pCnt);
- nMemberCount++;
- }
- }
- */
}
}
- //
}
break;
case CONTENT_TYPE_DRAWOBJECT:
@@ -838,10 +772,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
for( sal_uInt32 i=0; i< nCount; i++ )
{
SdrObject* pTemp = pPage->GetObj(i);
- // --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len())
+ // #i51726# - all drawing objects can be named now
if ( pTemp->GetName().Len() )
- // <--
{
SwContact* pContact = (SwContact*)pTemp->GetUserCall();
long nYPos = 0;
@@ -875,7 +807,6 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
Beschreibung: TreeListBox fuer Inhaltsanzeige
***************************************************************************/
-
SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) :
SvTreeListBox( pParent, rResId ),
@@ -939,11 +870,6 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) :
SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
SwContentTree::~SwContentTree()
{
Clear(); // vorher gfs. Inhaltstypen loeschen
@@ -953,7 +879,6 @@ SwContentTree::~SwContentTree()
/***************************************************************************
Drag&Drop methods
***************************************************************************/
-
void SwContentTree::StartDrag( sal_Int8 nAction, const Point& rPosPixel )
{
if( !bIsRoot || nRootType != CONTENT_TYPE_OUTLINE )
@@ -1003,14 +928,50 @@ sal_Int8 SwContentTree::AcceptDrop( const AcceptDropEvent& rEvt )
/***************************************************************************
Beschreibung: Drop wird im Navigator ausgefuehrt
***************************************************************************/
+void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent)
+{
+ void* key = 0;
+ if( pTree && pContent )
+ {
+ SwWrtShell* pShell = pTree->GetWrtShell();
+ sal_Int32 nPos = pContent->GetYPos();
+ if( nPos )
+ {
+ key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
+ }
+ }
+ return key;
+}
+
sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
+ SvLBoxEntry* pEntry = pTargetEntry;
+ if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) )
+ {
+ SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() );
+ if( pOutlineContent )
+ {
+ void* key = lcl_GetOutlineKey(this, pOutlineContent);
+ if( !mOutLineNodeMap[key] )
+ {
+ while( pEntry->HasChilds() )
+ {
+ SvLBoxEntry* pChildEntry = FirstChild( pEntry );
+ while( pChildEntry )
+ {
+ pEntry = pChildEntry;
+ pChildEntry = NextSibling( pChildEntry );
+ }
+ }
+ pTargetEntry = pEntry;
+ }
+ }
+ }
if( bIsRoot )
return SvTreeListBox::ExecuteDrop( rEvt );
return bIsInDrag ? DND_ACTION_NONE : GetParentWindow()->ExecuteDrop(rEvt);
}
-
/***************************************************************************
Beschreibung: Handler fuer Dragging und ContextMenu
***************************************************************************/
@@ -1165,14 +1126,6 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
pSubPop4->InsertItem(600, sPostItShow );
pSubPop4->InsertItem(601, sPostItHide );
pSubPop4->InsertItem(602, sPostItDelete );
- /*
- pSubPop4->InsertItem(603,rtl::OUString::createFromAscii("Sort"));
- PopupMenu* pMenuSort = new PopupMenu;
- pMenuSort->InsertItem(604,rtl::OUString::createFromAscii("By Position"));
- pMenuSort->InsertItem(605,rtl::OUString::createFromAscii("By Author"));
- pMenuSort->InsertItem(606,rtl::OUString::createFromAscii("By Date"));
- pSubPop4->SetPopupMenu(603, pMenuSort);
- */
pPop->InsertItem(4, pType->GetSingleName());
pPop->SetPopupMenu(4, pSubPop4);
}
@@ -1184,11 +1137,10 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
return pPop;
}
+
/***************************************************************************
Beschreibung: Einrueckung fuer outlines (und sections)
***************************************************************************/
-
-
long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
{
sal_uInt16 nLevel = 0;
@@ -1212,8 +1164,6 @@ long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
/***************************************************************************
Beschreibung: Inhalte werden erst auf Anforderung in die Box eingefuegt
***************************************************************************/
-
-
void SwContentTree::RequestingChilds( SvLBoxEntry* pParent )
{
// ist es ein Inhaltstyp?
@@ -1221,34 +1171,79 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent )
{
if(!pParent->HasChilds())
{
- DBG_ASSERT(pParent->GetUserData(), "keine UserData?");
+ OSL_ENSURE(pParent->GetUserData(), "no UserData?");
SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
sal_uInt16 nCount = pCntType->GetMemberCount();
- for(sal_uInt16 i = 0; i < nCount; i++)
- {
- const SwContent* pCnt = pCntType->GetMember(i);
- if(pCnt)
- {
- String sEntry = pCnt->GetName();
- if(!sEntry.Len())
- sEntry = sSpace;
- InsertEntry(sEntry, pParent,
- sal_False, LIST_APPEND, (void*)pCnt);
- }
-
+ /**************************************************************
+ Add for outline plus/minus
+ ***************************************************************/
+ if(pCntType->GetType() == CONTENT_TYPE_OUTLINE)
+ {
+ SvLBoxEntry* pChild = 0;
+ for(sal_uInt16 i = 0; i < nCount; i++)
+ {
+ const SwContent* pCnt = pCntType->GetMember(i);
+ if(pCnt)
+ {
+ sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel();
+ String sEntry = pCnt->GetName();
+ if(!sEntry.Len())
+ sEntry = sSpace;
+ if(!pChild || (nLevel == 0))
+ pChild = InsertEntry(sEntry, pParent,
+ sal_False, LIST_APPEND,(void*)pCnt);
+ else
+ {
+ //back search parent.
+ if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel)
+ pChild = InsertEntry(sEntry, pChild,
+ sal_False, LIST_APPEND, (void*)pCnt);
+ else
+ {
+ pChild = Prev(pChild);
+ while(pChild &&
+ lcl_IsContent(pChild) &&
+ !(((SwOutlineContent*)pChild->GetUserData())->GetOutlineLevel() < nLevel)
+ )
+ {
+ pChild = Prev(pChild);
+ }
+ if(pChild)
+ pChild = InsertEntry(sEntry, pChild,
+ sal_False, LIST_APPEND, (void*)pCnt);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ for(sal_uInt16 i = 0; i < nCount; i++)
+ {
+ const SwContent* pCnt = pCntType->GetMember(i);
+ if(pCnt)
+ {
+ String sEntry = pCnt->GetName();
+ if(!sEntry.Len())
+ sEntry = sSpace;
+ InsertEntry(sEntry, pParent,
+ sal_False, LIST_APPEND, (void*)pCnt);
+ }
+
+ }
}
}
}
}
+
/***************************************************************************
Beschreibung: Expand - Zustand fuer Inhaltstypen merken
***************************************************************************/
-
-
sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent )
{
- if(!bIsRoot)
+ if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
+ (nRootType == CONTENT_TYPE_OUTLINE))
{
if(lcl_IsContentType(pParent))
{
@@ -1261,22 +1256,58 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent )
}
else
nHiddenBlock |= nOr;
+ if((pCntType->GetType() == CONTENT_TYPE_OUTLINE))
+ {
+ std::map< void*, sal_Bool > mCurrOutLineNodeMap;
+
+ SwWrtShell* pShell = GetWrtShell();
+ sal_Bool bBool = SvTreeListBox::Expand(pParent);
+ SvLBoxEntry* pChild = Next(pParent);
+ while(pChild && lcl_IsContent(pChild) && pParent->HasChilds())
+ {
+ if(pChild->HasChilds())
+ {
+ sal_Int32 nPos = ((SwContent*)pChild->GetUserData())->GetYPos();
+ void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
+ mCurrOutLineNodeMap.insert(std::map<void*, sal_Bool>::value_type( key, sal_False ) );
+ std::map<void*,sal_Bool>::iterator iter = mOutLineNodeMap.find( key );
+ if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key])
+ {
+ mCurrOutLineNodeMap[key] = sal_True;
+ SvTreeListBox::Expand(pChild);
+ }
+ }
+ pChild = Next(pChild);
+ }
+ mOutLineNodeMap = mCurrOutLineNodeMap;
+ return bBool;
+ }
+
+ }
+ else if( lcl_IsContent(pParent) )
+ {
+ SwWrtShell* pShell = GetWrtShell();
+ sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
+ void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
+ mOutLineNodeMap[key] = sal_True;
}
}
return SvTreeListBox::Expand(pParent);
}
+
/***************************************************************************
Beschreibung: Collapse - Zustand fuer Inhaltstypen merken
***************************************************************************/
-
-
sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent )
{
sal_Bool bRet;
- if(!bIsRoot)
+ if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
+ (nRootType == CONTENT_TYPE_OUTLINE))
{
if(lcl_IsContentType(pParent))
{
+ if(bIsRoot)
+ return bRet = sal_False;
SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
sal_uInt16 nAnd = 1 << pCntType->GetType();
nAnd = ~nAnd;
@@ -1288,29 +1319,33 @@ sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent )
else
nHiddenBlock &= nAnd;
}
+ else if( lcl_IsContent(pParent) )
+ {
+ SwWrtShell* pShell = GetWrtShell();
+ sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
+ void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
+ mOutLineNodeMap[key] = sal_False;
+ }
bRet = SvTreeListBox::Collapse(pParent);
}
else
- bRet = sal_False;
+ bRet = SvTreeListBox::Collapse(pParent);
return bRet;
}
-
/***************************************************************************
Beschreibung: Auch auf Doppelclick wird zunaechst nur aufgeklappt
***************************************************************************/
-
-
IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG )
{
SvLBoxEntry* pEntry = GetCurEntry();
// ist es ein Inhaltstyp?
- DBG_ASSERT(pEntry, "kein aktueller Eintrag!");
+ OSL_ENSURE(pEntry, "no current entry!");
if(pEntry)
{
- if(lcl_IsContentType(pEntry))
+ if(lcl_IsContentType(pEntry) && !pEntry->HasChilds())
RequestingChilds(pEntry);
- else if(bIsActive || bIsConstant)
+ else if(!lcl_IsContentType(pEntry) && (bIsActive || bIsConstant))
{
if(bIsConstant)
{
@@ -1318,7 +1353,7 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG )
}
//Inhaltstyp anspringen:
SwContent* pCnt = (SwContent*)pEntry->GetUserData();
- DBG_ASSERT( pCnt, "keine UserData");
+ OSL_ENSURE( pCnt, "no UserData");
GotoContent(pCnt);
if(pCnt->GetParent()->GetType() == CONTENT_TYPE_FRAME)
pActiveShell->EnterStdMode();
@@ -1330,14 +1365,11 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG )
/***************************************************************************
Beschreibung: Anzeigen der Datei
***************************************************************************/
-
-
void SwContentTree::Display( sal_Bool bActive )
{
if(!bIsImageListInitialized)
{
- sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP;
- aEntryImages = ImageList(SW_RES(nResId));
+ aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
bIsImageListInitialized = sal_True;
}
// erst den selektierten Eintrag auslesen, um ihn spaeter evtl. wieder
@@ -1354,9 +1386,14 @@ void SwContentTree::Display( sal_Bool bActive )
nOldScrollPos = pVScroll->GetThumbPos();
sEntryName = GetEntryText(pOldSelEntry);
+ SvLBoxEntry* pParantEntry = pOldSelEntry;
+ while( GetParent(pParantEntry))
+ {
+ pParantEntry = GetParent(pParantEntry);
+ }
if(GetParent(pOldSelEntry))
{
- nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(GetParent(pOldSelEntry)));
+ nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParantEntry));
}
}
Clear();
@@ -1391,7 +1428,6 @@ void SwContentTree::Display( sal_Bool bActive )
if(!*ppContentT)
(*ppContentT) = new SwContentType(pShell, nCntType, nOutlineLevel );
-
String sEntry = (*ppContentT)->GetName();
SvLBoxEntry* pEntry;
const Image& rImage = aEntryImages.GetImage(SID_SW_START + nCntType);
@@ -1450,18 +1486,23 @@ void SwContentTree::Display( sal_Bool bActive )
(*ppRootContentT)->GetName(), rImage, rImage,
0, sal_False, LIST_APPEND, *ppRootContentT);
- for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ )
+ if(nRootType != CONTENT_TYPE_OUTLINE)
{
- const SwContent* pCnt = (*ppRootContentT)->GetMember(i);
- if(pCnt)
+ for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ )
{
- String sEntry = pCnt->GetName();
- if(!sEntry.Len())
- sEntry = sSpace;
- InsertEntry( sEntry, pParent,
- sal_False, LIST_APPEND, (void*)pCnt);
+ const SwContent* pCnt = (*ppRootContentT)->GetMember(i);
+ if(pCnt)
+ {
+ String sEntry = pCnt->GetName();
+ if(!sEntry.Len())
+ sEntry = sSpace;
+ InsertEntry( sEntry, pParent,
+ sal_False, LIST_APPEND, (void*)pCnt);
+ }
}
- }
+ }
+ else
+ RequestingChilds(pParent);
Expand(pParent);
if( nRootType == CONTENT_TYPE_OUTLINE && bIsActive )
{
@@ -1522,8 +1563,6 @@ void SwContentTree::Display( sal_Bool bActive )
/***************************************************************************
Beschreibung: Im Clear muessen auch die ContentTypes geloescht werden
***************************************************************************/
-
-
void SwContentTree::Clear()
{
SetUpdateMode(sal_False);
@@ -1531,15 +1570,11 @@ void SwContentTree::Clear()
SetUpdateMode(sal_True);
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
sal_Int8& rDragMode )
{
SwWrtShell* pWrtShell = GetWrtShell();
- DBG_ASSERT(pWrtShell, "keine Shell!");
+ OSL_ENSURE(pWrtShell, "no Shell!");
SvLBoxEntry* pEntry = GetCurEntry();
if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell)
return sal_False;
@@ -1555,10 +1590,10 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
case CONTENT_TYPE_OUTLINE:
{
sal_uInt16 nPos = ((SwOutlineContent*)pCnt)->GetPos();
- DBG_ASSERT(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(),
- "outlinecnt veraendert");
+ OSL_ENSURE(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(),
+ "outlinecnt changed");
- // #100738# make sure outline may actually be copied
+ // make sure outline may actually be copied
if( pWrtShell->IsOutlineCopyable( nPos ) )
{
const SwNumRule* pOutlRule = pWrtShell->GetOutlineNumRule();
@@ -1593,7 +1628,7 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
break;
case CONTENT_TYPE_URLFIELD:
sUrl = ((SwURLFieldContent*)pCnt)->GetURL();
- // kein break;
+ // no break;
case CONTENT_TYPE_OLE:
case CONTENT_TYPE_GRAPHIC:
if(GetParentWindow()->GetRegionDropMode() != REGION_MODE_NONE)
@@ -1674,11 +1709,10 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
}
return bRet;
}
+
/***************************************************************************
Beschreibung: Umschalten der Anzeige auf Root
***************************************************************************/
-
-
sal_Bool SwContentTree::ToggleToRoot()
{
if(!bIsRoot)
@@ -1711,8 +1745,6 @@ sal_Bool SwContentTree::ToggleToRoot()
/***************************************************************************
Beschreibung: Angezeigten Inhalt auf Gueltigkeit pruefen
***************************************************************************/
-
-
sal_Bool SwContentTree::HasContentChanged()
{
/*
@@ -1836,9 +1868,9 @@ sal_Bool SwContentTree::HasContentChanged()
// or if the visibility of objects (frames, sections, tables) has changed
// i.e. in header/footer
pArrType->FillMemberList(&bLevelOrVisibiblityChanged);
- if(bLevelOrVisibiblityChanged)
- bInvalidate = sal_True;
sal_uInt16 nChildCount = (sal_uInt16)GetChildCount(pEntry);
+ if((nType == CONTENT_TYPE_OUTLINE) && bLevelOrVisibiblityChanged)
+ bRepaint = sal_True;
if(bLevelOrVisibiblityChanged)
bInvalidate = sal_True;
@@ -1945,8 +1977,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData()
if(pEntry->GetUserData() && lcl_IsContentType(pEntry))
nLastSelType = ((SwContentType*)pEntry->GetUserData())->GetType();
}
-// else
-// nLastSelType = USHRT_MAX;
pEntry = First();
while(pEntry)
{
@@ -1959,8 +1989,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData()
Beschreibung: Nachdem ein File auf den Navigator gedroppt wurde,
wird die neue Shell gesetzt
***************************************************************************/
-
-
void SwContentTree::SetHiddenShell(SwWrtShell* pSh)
{
pHiddenShell = pSh;
@@ -1978,8 +2006,6 @@ void SwContentTree::SetHiddenShell(SwWrtShell* pSh)
/***************************************************************************
Beschreibung: Dokumentwechsel - neue Shell setzen
***************************************************************************/
-
-
void SwContentTree::SetActiveShell(SwWrtShell* pSh)
{
if(bIsInternalDrag)
@@ -2017,8 +2043,6 @@ void SwContentTree::SetActiveShell(SwWrtShell* pSh)
/***************************************************************************
Beschreibung: Eine offene View als aktiv festlegen
***************************************************************************/
-
-
void SwContentTree::SetConstantShell(SwWrtShell* pSh)
{
pActiveShell = pSh;
@@ -2031,11 +2055,10 @@ void SwContentTree::SetConstantShell(SwWrtShell* pSh)
}
Display(sal_True);
}
+
/***************************************************************************
Beschreibung: Kommandos des Navigators ausfuehren
***************************************************************************/
-
-
void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
{
sal_Bool nMove = sal_False;
@@ -2055,7 +2078,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
SvLBoxEntry* pFirstEntry = FirstSelected();
if (pFirstEntry && lcl_IsContent(pFirstEntry))
{
- if((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
+ if ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
((SwContent*)pFirstEntry->GetUserData())->GetParent()->GetType()
== CONTENT_TYPE_OUTLINE)
{
@@ -2073,8 +2096,8 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
if( nMove )
{
short nDir = nCmd == FN_ITEM_UP ? -1 : 1;
- if( !bModifier && ((nDir == -1 && nActPos > 0) ||
- (nDir == 1 && nActPos < GetEntryCount() - 2 )) )
+ if( !bModifier && ( (nDir == -1 && nActPos > 0) ||
+ (nDir == 1 && nActPos < GetEntryCount() - 2) ) )
{
pShell->MoveOutlinePara( nDir );
//Cursor wieder an die aktuelle Position setzen
@@ -2192,10 +2215,6 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier)
}
}
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
void SwContentTree::ShowTree()
{
@@ -2206,8 +2225,6 @@ void SwContentTree::ShowTree()
/***************************************************************************
Beschreibung: zusammengefaltet wird nicht geidlet
***************************************************************************/
-
-
void SwContentTree::HideTree()
{
aUpdTimer.Stop();
@@ -2217,8 +2234,6 @@ void SwContentTree::HideTree()
/***************************************************************************
Beschreibung: Kein Idle mit Focus oder waehrend des Dragging
***************************************************************************/
-
-
IMPL_LINK( SwContentTree, TimerUpdate, Timer*, EMPTYARG)
{
// kein Update waehrend D&D
@@ -2256,11 +2271,6 @@ IMPL_LINK( SwContentTree, TimerUpdate, Timer*, EMPTYARG)
return 0;
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
DragDropMode SwContentTree::NotifyStartDrag(
TransferDataContainer& rContainer,
SvLBoxEntry* pEntry )
@@ -2280,13 +2290,10 @@ DragDropMode SwContentTree::NotifyStartDrag(
return eMode;
}
-
/***************************************************************************
Beschreibung : Nach dem Drag wird der aktuelle Absatz m i t
Childs verschoben
***************************************************************************/
-
-
sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget,
SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& )
{
@@ -2309,8 +2316,8 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget,
}
- DBG_ASSERT( pEntry &&
- lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" );
+ OSL_ENSURE( pEntry &&
+ lcl_IsContent(pEntry),"Source == 0 or Source has no Content" );
GetParentWindow()->MoveOutline( nSourcePos,
nTargetPos,
sal_True);
@@ -2318,15 +2325,14 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget,
aActiveContentArr[CONTENT_TYPE_OUTLINE]->Invalidate();
Display(sal_True);
}
- //TreeListBox wird aus dem Dokument neu geladen
+ //TreeListBox will be reloaded from the document
return sal_False;
}
+
/***************************************************************************
Beschreibung : Nach dem Drag wird der aktuelle Absatz o h n e
Childs verschoben
***************************************************************************/
-
-
sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget,
SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& )
{
@@ -2350,9 +2356,8 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget,
}
-
- DBG_ASSERT( pEntry &&
- lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" );
+ OSL_ENSURE( pEntry &&
+ lcl_IsContent(pEntry),"Source == 0 or Source has no Content" );
GetParentWindow()->MoveOutline( nSourcePos, nTargetPos, sal_False);
//TreeListBox wird aus dem Dokument neu geladen
@@ -2365,13 +2370,11 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget,
/***************************************************************************
Beschreibung: Kein Drop vor den ersten Eintrag - es ist ein SwContentType
***************************************************************************/
-
sal_Bool SwContentTree::NotifyAcceptDrop( SvLBoxEntry* pEntry)
{
return pEntry != 0;
}
-
/***************************************************************************
Beschreibung: Wird ein Ctrl+DoubleClick in einen freien Bereich ausgefuehrt,
* dann soll die Basisfunktion des Controls gerufen werden
@@ -2389,8 +2392,6 @@ void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt )
/***************************************************************************
Beschreibung: sofort aktualisieren
***************************************************************************/
-
-
void SwContentTree::GetFocus()
{
SwView* pActView = GetParentWindow()->GetCreateView();
@@ -2415,11 +2416,6 @@ void SwContentTree::GetFocus()
SvTreeListBox::GetFocus();
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
void SwContentTree::KeyInput(const KeyEvent& rEvent)
{
const KeyCode aCode = rEvent.GetKeyCode();
@@ -2471,11 +2467,6 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
{
sal_Bool bCallBase = sal_True;
@@ -2591,11 +2582,6 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
Window::RequestHelp( rHEvt );
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
{
SvLBoxEntry* pFirst = FirstSelected();
@@ -2660,7 +2646,7 @@ void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
break;
}
//Anzeige
- default: // nSelectedPopupEntry > 300
+ default:
if(nSelectedPopupEntry > 300 && nSelectedPopupEntry < 400)
{
nSelectedPopupEntry -= 300;
@@ -2686,11 +2672,6 @@ void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
GetParentWindow()->UpdateListBox();
}
-/***************************************************************************
- Beschreibung:
-***************************************************************************/
-
-
void SwContentTree::SetOutlineLevel(sal_uInt8 nSet)
{
nOutlineLevel = nSet;
@@ -2709,8 +2690,6 @@ void SwContentTree::SetOutlineLevel(sal_uInt8 nSet)
/***************************************************************************
Beschreibung: Moduswechsel: gedropptes Doc anzeigen
***************************************************************************/
-
-
void SwContentTree::ShowHiddenShell()
{
if(pHiddenShell)
@@ -2724,8 +2703,6 @@ void SwContentTree::ShowHiddenShell()
/***************************************************************************
Beschreibung: Moduswechsel: aktive Sicht anzeigen
***************************************************************************/
-
-
void SwContentTree::ShowActualView()
{
bIsActive = sal_True;
@@ -2734,20 +2711,23 @@ void SwContentTree::ShowActualView()
GetParentWindow()->UpdateListBox();
}
-/*-----------------20.11.96 13.34-------------------
+/***************************************************************************
Beschreibung: Hier sollen die Buttons zum Verschieben von
Outlines en-/disabled werden
---------------------------------------------------*/
-
+***************************************************************************/
sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if(!pEntry)
return sal_False;
sal_Bool bEnable = sal_False;
SvLBoxEntry* pParentEntry = GetParent(pEntry);
+ while(pParentEntry && (!lcl_IsContentType(pParentEntry)))
+ {
+ pParentEntry = GetParent(pParentEntry);
+ }
if(!bIsLastReadOnly && (!IsVisible() ||
- ((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) ||
- (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))))
+ ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) ||
+ (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)) ))
bEnable = sal_True;
SwNavigationPI* pNavi = GetParentWindow();
pNavi->aContentToolBox.EnableItem(FN_ITEM_UP , bEnable);
@@ -2758,10 +2738,6 @@ sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
return SvTreeListBox::Select(pEntry, bSelect);
}
-/*-----------------27.11.96 12.56-------------------
-
---------------------------------------------------*/
-
void SwContentTree::SetRootType(sal_uInt16 nType)
{
nRootType = nType;
@@ -2769,10 +2745,6 @@ void SwContentTree::SetRootType(sal_uInt16 nType)
pConfig->SetRootType( nRootType );
}
-/*-----------------10.01.97 12.19-------------------
-
---------------------------------------------------*/
-
void SwContentType::RemoveNewline(String& rEntry)
{
sal_Unicode* pStr = rEntry.GetBufferAccess();
@@ -2783,10 +2755,6 @@ void SwContentType::RemoveNewline(String& rEntry)
}
}
-/*-----------------14.01.97 16.38-------------------
-
---------------------------------------------------*/
-
void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
{
SwContent* pCnt = (SwContent*)pEntry->GetUserData();
@@ -2920,15 +2888,6 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
pActiveShell->GetView().GetPostItMgr()->SetActiveSidebarWin(0);
pActiveShell->DelRight();
}
- /*
- // this code can be used once we want redline comments in the margin
- else
- {
- SwMarginWin* pComment = pActiveShell->GetView().GetPostItMgr()->GetPostIt(((SwPostItContent*)pCnt)->GetRedline());
- if (pComment)
- pComment->Delete();
- }
- */
}
else
{
@@ -2996,10 +2955,10 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
aObj >>= xTmp;
uno::Reference< container::XNamed > xNamed(xTmp, uno::UNO_QUERY);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwRenameXNamedDlg* pDlg = pFact->CreateSwRenameXNamedDlg( this, xNamed, xNameAccess, DLG_RENAME_XNAMED );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(xSecond.is())
pDlg->SetAlternativeAccess( xSecond, xThird);
@@ -3018,10 +2977,6 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
}
}
-/*-----------------14.01.97 16.53-------------------
-
---------------------------------------------------*/
-
void SwContentTree::GotoContent(SwContent* pCnt)
{
pActiveShell->EnterStdMode();
@@ -3091,6 +3046,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
break;
case CONTENT_TYPE_DRAWOBJECT:
{
+ SwPosition aPos = *pActiveShell->GetCrsr()->GetPoint();
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
@@ -3102,10 +3058,8 @@ void SwContentTree::GotoContent(SwContent* pCnt)
for( sal_uInt32 i=0; i< nCount; i++ )
{
SdrObject* pTemp = pPage->GetObj(i);
- // --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName() == pCnt->GetName())
+ // #i51726# - all drawing objects can be named now
if ( pTemp->GetName() == pCnt->GetName() )
- // <--
{
SdrPageView* pPV = pDrawView->GetSdrPageView();
if( pPV )
@@ -3114,6 +3068,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
}
}
}
+ pActiveShell->GetNavigationMgr().addEntry(aPos);
}
}
break;
@@ -3128,10 +3083,8 @@ void SwContentTree::GotoContent(SwContent* pCnt)
rView.GetPostItMgr()->SetActiveSidebarWin(0);
rView.GetEditWin().GrabFocus();
}
-/*-----------------06.02.97 19.14-------------------
- Jetzt nochtdie passende text::Bookmark
---------------------------------------------------*/
+/* Jetzt nochtdie passende text::Bookmark */
NaviContentBookmark::NaviContentBookmark()
:
nDocSh(0),
@@ -3139,10 +3092,6 @@ NaviContentBookmark::NaviContentBookmark()
{
}
-/*-----------------06.02.97 20.12-------------------
-
---------------------------------------------------*/
-
NaviContentBookmark::NaviContentBookmark( const String &rUrl,
const String& rDesc,
sal_uInt16 nDragType,
@@ -3183,10 +3132,6 @@ sal_Bool NaviContentBookmark::Paste( TransferableDataHelper& rData )
return bRet;
}
-
-/* -----------------------------09.12.99 13:50--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwContentLBoxString : public SvLBoxString
{
public:
@@ -3197,9 +3142,6 @@ public:
SvLBoxEntry* pEntry);
};
-/* -----------------------------09.12.99 13:49--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwContentTree::InitEntry(SvLBoxEntry* pEntry,
const XubString& rStr ,const Image& rImg1,const Image& rImg2,
SvLBoxButtonKind eButtonKind)
@@ -3210,16 +3152,13 @@ void SwContentTree::InitEntry(SvLBoxEntry* pEntry,
SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, pCol->GetText() );
pEntry->ReplaceItem( pStr, nColToHilite );
}
-/* -----------------------------09.12.99 13:49--------------------------------
- ---------------------------------------------------------------------------*/
void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry )
{
if(lcl_IsContent(pEntry) &&
((SwContent *)pEntry->GetUserData())->IsInvisible())
{
- //* pCont = (SwContent*)pEntry->GetUserData();
Font aOldFont( rDev.GetFont());
Font aFont(aOldFont);
Color aCol( COL_LIGHTGRAY );
@@ -3231,20 +3170,17 @@ void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFl
else
SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
}
-/* -----------------------------06.05.2002 10:20------------------------------
- ---------------------------------------------------------------------------*/
void SwContentTree::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP;
- aEntryImages = ImageList(SW_RES(nResId));
+ aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
FindActiveTypeAndRemoveUserData();
Display(sal_True);
}
SvTreeListBox::DataChanged( rDCEvt );
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index 2b7efb0037b5..1855d9f23277 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,6 @@
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
-#include <errhdl.hxx>
#include <docsh.hxx>
#include <content.hxx>
#include <edglbldc.hxx>
@@ -66,26 +66,17 @@
#include <cmdid.h>
#include <helpid.h>
-#ifndef _NAVIPI_HRC
#include <navipi.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <globals.hrc>
#include "swabstdlg.hxx"
using namespace ::com::sun::star::uno;
using ::rtl::OUString;
-
// Kontextmenue fuer GlobalTree
#define CTX_INSERT_ANY_INDEX 10
-//#define CTX_INSERT_CNTIDX 11
-//#define CTX_INSERT_USRIDX 12
#define CTX_INSERT_FILE 11
#define CTX_INSERT_NEW_FILE 12
#define CTX_INSERT_TEXT 13
@@ -117,7 +108,7 @@ using ::rtl::OUString;
#define GLBL_TABPOS_SUB 5
const SfxObjectShell* SwGlobalTree::pShowShell = 0;
-static const char* __FAR_DATA aHelpForMenu[] =
+static const char* aHelpForMenu[] =
{
0, //
HID_GLBLTREE_UPDATE, //CTX_UPDATE
@@ -145,12 +136,6 @@ static const char* __FAR_DATA aHelpForMenu[] =
HID_GLBLTREEUPD_ALL //CTX_UPDATE_ALL
};
-/************************************************************************/
-/* */
-/************************************************************************/
-/* -----------------------------24.08.00 12:04--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwGlobalFrameListener_Impl : public SfxListener
{
sal_Bool bValid;
@@ -165,9 +150,7 @@ public:
sal_Bool IsValid() const {return bValid;}
};
-/* -----------------------------24.08.00 12:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if( rHint.ISA(SfxSimpleHint) &&
@@ -175,9 +158,6 @@ void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHi
bValid = sal_False;
}
-/*-----------------12.06.97 09:38-------------------
-
---------------------------------------------------*/
SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) :
SvTreeListBox(pParent, rResId),
@@ -212,18 +192,12 @@ SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) :
EnableContextMenuHandling();
}
-/*-----------------12.06.97 09:38-------------------
-
---------------------------------------------------*/
SwGlobalTree::~SwGlobalTree()
{
delete pSwGlblDocContents;
delete pDocInserter;
}
-/*-----------------12.06.97 09:38-------------------
-
---------------------------------------------------*/
sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
sal_Int8 nRet = DND_ACTION_NONE;
@@ -303,9 +277,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
return nRet;
}
-/*-----------------12.06.97 09:38-------------------
---------------------------------------------------*/
sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt )
{
sal_Int8 nRet = rEvt.mnAction;
@@ -364,9 +336,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt )
}
return nRet;
}
-/*-----------------12.06.97 09:38-------------------
---------------------------------------------------*/
PopupMenu* SwGlobalTree::CreateContextMenu()
{
PopupMenu* pPop = 0;
@@ -427,9 +397,7 @@ PopupMenu* SwGlobalTree::CreateContextMenu()
}
return pPop;
}
-/*-----------------16.06.97 10:41-------------------
---------------------------------------------------*/
void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox)
{
sal_uInt16 nEnableFlags = GetEnableFlags();
@@ -442,8 +410,6 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox)
pMenu->SetHelpId(i, aHelpForMenu[i] );
}
pMenu->EnableItem(CTX_INSERT_ANY_INDEX, 0 != (nEnableFlags & ENABLE_INSERT_IDX ));
-// pMenu->EnableItem(CTX_INSERT_CNTIDX, 0 != (nEnableFlags & ENABLE_INSERT_IDX ));
-// pMenu->EnableItem(CTX_INSERT_USRIDX, 0 != (nEnableFlags & ENABLE_INSERT_IDX ));
pMenu->EnableItem(CTX_INSERT_TEXT, 0 != (nEnableFlags & ENABLE_INSERT_TEXT));
pMenu->EnableItem(CTX_INSERT_FILE, 0 != (nEnableFlags & ENABLE_INSERT_FILE));
pMenu->EnableItem(CTX_INSERT_NEW_FILE, 0 != (nEnableFlags & ENABLE_INSERT_FILE));
@@ -469,9 +435,7 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox)
pBox->Invalidate();
}
}
-/*-----------------16.06.97 11:02-------------------
---------------------------------------------------*/
sal_uInt16 SwGlobalTree::GetEnableFlags() const
{
SvLBoxEntry* pEntry = FirstSelected();
@@ -502,9 +466,6 @@ sal_uInt16 SwGlobalTree::GetEnableFlags() const
return nRet;
}
-/*-----------------12.06.97 09:38-------------------
-
---------------------------------------------------*/
void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt )
{
sal_Bool bParent = sal_True;
@@ -552,9 +513,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt )
if(bParent)
SvTreeListBox::RequestHelp(rHEvt);
}
-/*-----------------16.06.97 16:15-------------------
---------------------------------------------------*/
void SwGlobalTree::SelectHdl()
{
@@ -573,17 +532,12 @@ void SwGlobalTree::SelectHdl()
nSelCount == 1 && nAbsPos < ((sal_uInt16)GetEntryCount()) - 1 && !bReadonly);
}
-/*-----------------16.06.97 16:15-------------------
---------------------------------------------------*/
void SwGlobalTree::DeselectHdl()
{
SelectHdl();
}
-/*-----------------17.06.97 13:11-------------------
-
---------------------------------------------------*/
DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& ,
SvLBoxEntry* pEntry )
{
@@ -592,17 +546,11 @@ DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& ,
return SV_DRAGDROP_CTRL_MOVE;
}
-/*-----------------21.06.97 12:44-------------------
-
---------------------------------------------------*/
long SwGlobalTree::GetTabPos( SvLBoxEntry*, SvLBoxTab* pTab)
{
return pTab->GetPos() - GLBL_TABPOS_SUB;
}
-/*-----------------12.06.97 09:38-------------------
-
---------------------------------------------------*/
sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget,
SvLBoxEntry* pSource,
SvLBoxEntry*&,
@@ -619,9 +567,7 @@ sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget,
Display();
return sal_False;
}
-/*-----------------12.06.97 09:39-------------------
---------------------------------------------------*/
sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/,
SvLBoxEntry* /*pEntry*/,
SvLBoxEntry*& /*rpNewParent*/,
@@ -630,24 +576,18 @@ sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/,
{
return sal_False;
}
-/*-----------------12.06.97 09:39-------------------
---------------------------------------------------*/
sal_Bool SwGlobalTree::NotifyAcceptDrop( SvLBoxEntry* pEntry)
{
return pEntry != 0;
}
-/*-----------------12.06.97 09:39-------------------
---------------------------------------------------*/
void SwGlobalTree::StartDrag( sal_Int8 nAction, const Point& rPt )
{
if( 1 == GetSelectionCount() )
SvTreeListBox::StartDrag( nAction, rPt );
}
-/*-----------------12.06.97 09:39-------------------
---------------------------------------------------*/
void SwGlobalTree::DragFinished( sal_Int8 nAction )
{
SvTreeListBox::DragFinished( nAction );
@@ -668,9 +608,6 @@ void SwGlobalTree::MouseButtonDown( const MouseEvent& rMEvt )
SvTreeListBox::MouseButtonDown( rMEvt );
}
-/*-----------------12.06.97 13:08-------------------
-
---------------------------------------------------*/
void SwGlobalTree::GetFocus()
{
if(Update( sal_False ))
@@ -678,9 +615,6 @@ void SwGlobalTree::GetFocus()
SvTreeListBox::GetFocus();
}
-/*-----------------12.06.97 12:34-------------------
-
---------------------------------------------------*/
void SwGlobalTree::KeyInput(const KeyEvent& rKEvt)
{
const KeyCode aCode = rKEvt.GetKeyCode();
@@ -698,23 +632,17 @@ void SwGlobalTree::KeyInput(const KeyEvent& rKEvt)
SvTreeListBox::KeyInput(rKEvt);
}
-/*-----------------17.06.97 11:59-------------------
-
---------------------------------------------------*/
void SwGlobalTree::Clear()
{
pEmphasisEntry = 0;
SvTreeListBox::Clear();
}
-/*-----------------12.06.97 12:38-------------------
---------------------------------------------------*/
void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData)
{
if(!bIsImageListInitialized)
{
- sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP;
- aEntryImages = ImageList(SW_RES(nResId));
+ aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
bIsImageListInitialized = sal_True;
}
sal_uInt16 nCount = pSwGlblDocContents->Count();
@@ -795,9 +723,6 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData)
}
}
-/*-----------------13.06.97 10:32-------------------
-
---------------------------------------------------*/
void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const String* pFileName )
{
Sequence< OUString > aFileNames;
@@ -820,9 +745,6 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const String* pF
}
}
-/*-----------------18.06.97 12:42-------------------
-
---------------------------------------------------*/
void SwGlobalTree::EditContent(const SwGlblDocContent* pCont )
{
sal_uInt16 nSlot = 0;
@@ -857,21 +779,14 @@ void SwGlobalTree::EditContent(const SwGlblDocContent* pCont )
}
}
-/*-----------------13.06.97 14:22-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu)
{
ExcecuteContextMenuAction( pMenu->GetCurItemId());
return sal_True;
}
-/* -----------------26.08.2003 11:57-----------------
- --------------------------------------------------*/
void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
-//IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu)
{
-// sal_uInt16 nId = pMenu->GetCurItemId();
SvLBoxEntry* pEntry = FirstSelected();
SwGlblDocContent* pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0;
// wird waehrend des Dialogs ein RequestHelp gerufen,
@@ -928,13 +843,13 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
break;
case CTX_EDIT:
{
- DBG_ASSERT(pCont, "Edit ohne Entry ? " );
+ OSL_ENSURE(pCont, "edit without entry ? " );
EditContent(pCont);
}
break;
case CTX_EDIT_LINK:
{
- DBG_ASSERT(pCont, "Edit ohne Entry ? " );
+ OSL_ENSURE(pCont, "edit without entry ? " );
SfxStringItem aName(FN_EDIT_REGION,
pCont->GetSection()->GetSectionName());
rDispatch.Execute(FN_EDIT_REGION, SFX_CALLMODE_ASYNCHRON, &aName, 0L);
@@ -966,8 +881,6 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
}
break;
case CTX_INSERT_ANY_INDEX:
-// case CTX_INSERT_CNTIDX:
-// case CTX_INSERT_USRIDX:
{
if(pContCopy)
{
@@ -981,14 +894,14 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
0);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX,
this, aSet,
*pActiveShell,
0,
USHRT_MAX,
sal_True);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
SwTOXDescription& rDesc = pDlg->GetTOXDescription(
@@ -1101,12 +1014,8 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
delete pContCopy;
else
bDeleteContentCopy = true;
-// return sal_True;
}
-/*-----------------16.06.97 07:57-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwGlobalTree, Timeout, Timer*, EMPTYARG )
{
if(!HasFocus() && Update( sal_False ))
@@ -1114,9 +1023,6 @@ IMPL_LINK( SwGlobalTree, Timeout, Timer*, EMPTYARG )
return 0;
}
-/*-----------------13.06.97 16:56-------------------
-
---------------------------------------------------*/
void SwGlobalTree::GotoContent(const SwGlblDocContent* pCont)
{
pActiveShell->EnterStdMode();
@@ -1138,29 +1044,23 @@ void SwGlobalTree::GotoContent(const SwGlblDocContent* pCont)
}
}
-/*-----------------16.06.97 07:42-------------------
---------------------------------------------------*/
void SwGlobalTree::ShowTree()
{
aUpdateTimer.Start();
SvTreeListBox::Show();
}
-/*-----------------16.06.97 07:42-------------------
---------------------------------------------------*/
void SwGlobalTree::HideTree()
{
aUpdateTimer.Stop();
SvTreeListBox::Hide();
}
-/*-----------------18.06.97 10:02-------------------
---------------------------------------------------*/
void SwGlobalTree::ExecCommand(sal_uInt16 nCmd)
{
SvLBoxEntry* pEntry = FirstSelected();
- DBG_ASSERT(pEntry, "gleich knallt's");
+ OSL_ENSURE(pEntry, "gleich knallt's");
if(FN_GLOBAL_EDIT == nCmd)
{
const SwGlblDocContent* pCont = (const SwGlblDocContent*)
@@ -1199,9 +1099,6 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd)
}
}
-/*-----------------16.06.97 07:43-------------------
-
---------------------------------------------------*/
sal_Bool SwGlobalTree::Update(sal_Bool bHard)
{
SwView* pActView = GetParentWindow()->GetCreateView();
@@ -1284,9 +1181,6 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard)
return bRet;
}
-/*-----------------25.06.97 16:20-------------------
-
---------------------------------------------------*/
void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont)
{
String sFileName(pCont->GetSection()->GetLinkFileName().GetToken(0,
@@ -1320,9 +1214,6 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont)
}
}
-/*-----------------25.06.97 16:08-------------------
-
---------------------------------------------------*/
IMPL_LINK( SwGlobalTree, DoubleClickHdl, SwGlobalTree *, EMPTYARG )
{
SvLBoxEntry* pEntry = GetCurEntry();
@@ -1337,9 +1228,6 @@ IMPL_LINK( SwGlobalTree, DoubleClickHdl, SwGlobalTree *, EMPTYARG )
return 0;
}
-/*-----------------07.10.97 08:09-------------------
-
---------------------------------------------------*/
IMPL_STATIC_LINK_NOINSTANCE(SwGlobalTree, ShowFrameHdl, SwGlobalTree*, EMPTYARG)
{
if(SwGlobalTree::GetShowShell())
@@ -1347,9 +1235,7 @@ IMPL_STATIC_LINK_NOINSTANCE(SwGlobalTree, ShowFrameHdl, SwGlobalTree*, EMPTYARG)
SwGlobalTree::SetShowShell(0);
return 0;
}
-/* -----------------04.11.98 10:43-------------------
- *
- * --------------------------------------------------*/
+
void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry,
const XubString& rStr ,const Image& rImg1,const Image& rImg2,
SvLBoxButtonKind eButtonKind)
@@ -1360,17 +1246,13 @@ void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry,
SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() );
pEntry->ReplaceItem( pStr, nColToHilite );
}
-/* -----------------04.11.98 10:39-------------------
- *
- * --------------------------------------------------*/
void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
SvLBoxEntry* pEntry )
{
SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData();
- const SwSection* pSect;
if(pCont->GetType() == GLBLDOC_SECTION &&
- !(pSect = pCont->GetSection())->IsConnectFlag() )
+ !(pCont->GetSection())->IsConnectFlag() )
{
Font aOldFont( rDev.GetFont());
Font aFont(aOldFont);
@@ -1383,16 +1265,13 @@ void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
else
SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
}
-/* -----------------------------06.05.2002 10:20------------------------------
- ---------------------------------------------------------------------------*/
void SwGlobalTree::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP;
- aEntryImages = ImageList(SW_RES(nResId));
+ aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
Update(sal_True);
}
SvTreeListBox::DataChanged( rDCEvt );
@@ -1435,7 +1314,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
//update the global document content after each inserted document
rSh.GetGlobalDocContent(aTempContents);
SwGlblDocContent* pAnchorContent = 0;
- DBG_ASSERT(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed");
+ OSL_ENSURE(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed");
if ( aTempContents.Count() > (nAnchorContent + nFile) )
pAnchorContent = aTempContents.GetObject(nAnchorContent + (sal_uInt16)nFile);
else
@@ -1500,18 +1379,17 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
SfxMediumList* pMedList = pDocInserter->CreateMediumList();
if ( pMedList )
{
- Sequence< OUString >aFileNames( pMedList->Count() );
+ Sequence< OUString >aFileNames( pMedList->size() );
OUString* pFileNames = aFileNames.getArray();
- SfxMedium* pMed = pMedList->First();
sal_Int32 nPos = 0;
- while ( pMed )
+ for ( size_t i = 0, n = pMedList->size(); i < n; ++i )
{
+ SfxMedium* pMed = pMedList->at( i );
String sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
sFileName += sfx2::cTokenSeperator;
sFileName += pMed->GetFilter()->GetFilterName();
sFileName += sfx2::cTokenSeperator;
pFileNames[nPos++] = sFileName;
- pMed = pMedList->Next();
}
delete pMedList;
InsertRegion( pDocContent, aFileNames );
@@ -1521,3 +1399,4 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index 3d80e55e1ace..a5f35394b33c 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,16 +38,10 @@
#include <tools/urlobj.hxx>
#include <vcl/dialog.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <vcl/lstbox.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
#include <svl/fstathelper.hxx>
-#endif
#include <unotools/pathoptions.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <swtypes.hxx>
@@ -57,12 +52,8 @@
#include <gloslst.hxx>
#include <swunohelper.hxx>
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _GLOSLST_HRC
#include <gloslst.hrc>
-#endif
#define STRING_DELIM (char)0x0A
@@ -97,10 +88,6 @@ class SwGlossDecideDlg : public ModalDialog
ListBox& GetListBox() {return aListLB;}
};
-/*-----------------21.01.97 13.25-------------------
-
---------------------------------------------------*/
-
SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) :
ModalDialog(pParent, SW_RES(DLG_GLOSSARY_DECIDE_DLG)),
aOk(this, SW_RES(PB_OK)),
@@ -114,18 +101,11 @@ SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) :
aListLB.SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl));
}
-/*-----------------21.01.97 13.25-------------------
-
---------------------------------------------------*/
-
IMPL_LINK(SwGlossDecideDlg, DoubleClickHdl, ListBox*, EMPTYARG)
{
EndDialog(RET_OK);
return 0;
}
-/*-----------------21.01.97 13.29-------------------
-
---------------------------------------------------*/
IMPL_LINK(SwGlossDecideDlg, SelectHdl, ListBox*, EMPTYARG)
{
@@ -246,7 +226,7 @@ sal_uInt16 SwGlossaryList::GetGroupCount()
String SwGlossaryList::GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath, String* pTitle)
{
- DBG_ASSERT(aGroupArr.Count() > nPos, "Gruppe nicht vorhanden");
+ OSL_ENSURE(aGroupArr.Count() > nPos, "group not available");
String sRet(aEmptyStr);
if(nPos < aGroupArr.Count())
{
@@ -268,7 +248,7 @@ String SwGlossaryList::GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath, String* p
sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
{
- DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden");
+ OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available");
if(nGroup < aGroupArr.Count())
{
AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup);
@@ -284,7 +264,7 @@ sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
String SwGlossaryList::GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName)
{
- DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden");
+ OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available");
if(nGroup < aGroupArr.Count())
{
AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup);
@@ -512,3 +492,4 @@ void SwGlossaryList::ClearGroups()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index 565b32339792..d7fde30f511f 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,19 +39,11 @@
#include <glosdoc.hxx>
#include <gloslst.hxx>
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _INITUI_HRC
#include <initui.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <authfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <unotools/syslocale.hxx>
#include <unomid.h>
@@ -160,9 +153,8 @@ ShellResource::ShellResource()
aGetRefFld_Up( SW_RES( STR_GETREFFLD_UP ) ),
aGetRefFld_Down( SW_RES( STR_GETREFFLD_DOWN ) ),
- // --> OD 2007-09-13 #i81002#
+ // #i81002#
aGetRefFld_RefItemNotFound( SW_RES( STR_GETREFFLD_REFITEMNOTFOUND ) ),
- // <--
aStrAllPageHeadFoot( SW_RES( STR_ALLPAGE_HEADFOOT ) ),
aStrNone( SW_RES( STR_TEMPLATE_NONE )),
aFixedStr( SW_RES( STR_FIELD_FIXED )),
@@ -205,11 +197,24 @@ ShellResource::~ShellResource()
delete pAutoFmtNameLst, pAutoFmtNameLst = 0;
}
-String ShellResource::GetPageDescName( sal_uInt16 nNo, sal_Bool bIsFirst, sal_Bool bFollow )
+String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode )
{
- String sRet( bIsFirst ? sPageDescFirstName
- : bFollow ? sPageDescFollowName
- : sPageDescName );
+ String sRet;
+
+ switch (eMode)
+ {
+ case NORMAL_PAGE:
+ sRet = sPageDescName;
+ break;
+ break;
+ case FIRST_PAGE:
+ sRet = sPageDescFirstName;
+ break;
+ case FOLLOW_PAGE:
+ sRet = sPageDescFollowName;
+ break;
+ }
+
sRet.SearchAndReplaceAscii( "$(ARG1)", String::CreateFromInt32( nNo ));
return sRet;
}
@@ -271,9 +276,7 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst )
}
FreeResource();
}
-/* -----------------16.09.99 12:28-------------------
- --------------------------------------------------*/
const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType)
{
if(!pAuthFieldNameList)
@@ -287,9 +290,7 @@ const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType)
}
return *pAuthFieldNameList->GetObject( static_cast< sal_uInt16 >(eType) );
}
-/* -----------------16.09.99 12:29-------------------
- --------------------------------------------------*/
const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType)
{
if(!pAuthFieldTypeList)
@@ -305,3 +306,4 @@ const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/initui.src b/sw/source/ui/utlui/initui.src
index 3b08e771a309..ccb3243ea776 100644
--- a/sw/source/ui/utlui/initui.src
+++ b/sw/source/ui/utlui/initui.src
@@ -62,7 +62,6 @@ Resource RID_SW_SHELLRES
String STR_CALC_POW
{
Text [ en-US ] = "** Square function overflow **" ;
- /* ### ACHTUNG: Neuer Text in Resource? ** Überlauf in Quadratfunktion ** : ** šberlauf in Quadratfunktion ** */
};
String STR_CALC_VARNFND
{
@@ -71,7 +70,6 @@ Resource RID_SW_SHELLRES
String STR_CALC_OVERFLOW
{
Text [ en-US ] = "** Overflow **" ;
- /* ### ACHTUNG: Neuer Text in Resource? ** Überlauf ** : ** šberlauf ** */
};
String STR_CALC_WRONGTIME
{
@@ -162,7 +160,6 @@ Resource RID_SW_SHELLRES
};
String FLD_DOCINFO_KEYS
{
- /* ### ACHTUNG: Neuer Text in Resource? Schlüsselwörter : Schl³sselw÷rter */
Text [ en-US ] = "Keywords" ;
};
String FLD_DOCINFO_COMMENT
diff --git a/sw/source/ui/utlui/navicfg.cxx b/sw/source/ui/utlui/navicfg.cxx
index 2edc5e9d8f71..4f53ee64d5e2 100644
--- a/sw/source/ui/utlui/navicfg.cxx
+++ b/sw/source/ui/utlui/navicfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <swtypes.hxx> // fuer Pathfinder
#include <navicfg.hxx>
#include <swcont.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -42,9 +43,6 @@ using namespace ::utl;
using namespace ::rtl;
using namespace ::com::sun::star::uno;
-/* -----------------------------08.09.00 16:30--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence<OUString> SwNavigationConfig::GetPropertyNames()
{
static const char* aPropNames[] =
@@ -66,9 +64,6 @@ Sequence<OUString> SwNavigationConfig::GetPropertyNames()
}
return aNames;
}
-/*-----------------13.11.96 11.03-------------------
-
---------------------------------------------------*/
SwNavigationConfig::SwNavigationConfig() :
utl::ConfigItem(C2U("Office.Writer/Navigator")),
@@ -82,9 +77,8 @@ SwNavigationConfig::SwNavigationConfig() :
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
-// EnableNotification(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
@@ -105,14 +99,11 @@ SwNavigationConfig::SwNavigationConfig() :
}
}
}
-/* -----------------------------08.09.00 16:35--------------------------------
- ---------------------------------------------------------------------------*/
SwNavigationConfig::~SwNavigationConfig()
-{}
-/* -----------------------------08.09.00 16:35--------------------------------
+{
+}
- ---------------------------------------------------------------------------*/
void SwNavigationConfig::Commit()
{
Sequence<OUString> aNames = GetPropertyNames();
@@ -139,3 +130,4 @@ void SwNavigationConfig::Commit()
void SwNavigationConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 7ad513ed479e..1d0e41882528 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,12 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#define NAVIPI_CXX
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
-#include <tools/list.hxx>
+#include <string>
#include <svl/urlbmk.hxx>
#include <svl/stritem.hxx>
#include <svtools/filter.hxx>
@@ -46,16 +44,11 @@
#include <sfx2/dockwin.hxx>
#include <vcl/toolbox.hxx>
#include <swtypes.hxx> // fuer Pathfinder
-#include <errhdl.hxx>
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <navicfg.hxx>
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <actctrl.hxx>
#include <IMark.hxx>
#include <navipi.hxx>
@@ -64,27 +57,16 @@
#include <section.hxx>
#include <edtwin.hxx>
#include <sfx2/app.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _RIBBAR_HRC
#include <ribbar.hrc>
-#endif
-#ifndef _NAVIPI_HRC
#include <navipi.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include "access.hrc"
#include <unomid.h>
-
#define PAGE_CHANGE_TIMEOUT 1000 //Timeout fuer Seitenwechsel
#define JUMP_TYPE_TBL 0
@@ -299,7 +281,6 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox )
}
}
return sal_True;
- //break;
// Funktionen, die eine direkte Aktion ausloesen
case FN_SELECT_FOOTER:
@@ -415,9 +396,6 @@ IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox )
return sal_True;
}
-/*-----------------13.07.04 -------------------
- ----------------------------------------------*/
-
IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox )
{
const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
@@ -479,15 +457,11 @@ IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox )
return sal_True;
}
-/*-----------------13.07.04 -------------------
---------------------------------------------------*/
SwNavHelpToolBox::SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId) :
SwHelpToolBox(pParent, rResId)
{}
-/*-----------------19.06.97 09:09-------------------
---------------------------------------------------*/
void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
{
if(rEvt.GetButtons() == MOUSE_LEFT &&
@@ -498,18 +472,13 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
else
SwHelpToolBox::MouseButtonDown(rEvt);
}
-/* -----------------------------12.03.2002 16:55------------------------------
- ---------------------------------------------------------------------------*/
void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetFocus)
{
-// SfxBindings& rBind = GetCreateView()->GetViewFrame()->GetBindings();
-// rBind.ENTERREGISTRATIONS();
Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface();
SwScrollNaviPopup* pPopup = new
SwScrollNaviPopup(FN_SCROLL_NAVIGATION,
xFrame );
-// rBind.LEAVEREGISTRATIONS();
Rectangle aRect(rRect);
Point aT1 = aRect.TopLeft();
@@ -524,9 +493,6 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetF
}
}
-/*-----------------19.06.97 10:12-------------------
-
---------------------------------------------------*/
void SwNavHelpToolBox::RequestHelp( const HelpEvent& rHEvt )
{
sal_uInt16 nItemId = GetItemId(ScreenToOutputPixel(rHEvt.GetMousePosPixel()));
@@ -576,10 +542,6 @@ IMPL_LINK( SwNavigationPI, EditGetFocus, NumEditAction *, pEdit )
return 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
sal_Bool SwNavigationPI::Close()
{
SfxViewFrame* pVFrame = pCreateView->GetViewFrame();
@@ -622,10 +584,6 @@ void SwNavigationPI::MakeMark()
nAutoMarkIdx = 0;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNavigationPI::GotoPage()
{
if ( pContextWin->GetFloatingWindow() && pContextWin->GetFloatingWindow()->IsRollUp())
@@ -636,10 +594,6 @@ void SwNavigationPI::GotoPage()
GetPageEdit().GrabFocus();
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNavigationPI::_ZoomOut()
{
if (_IsZoomedIn())
@@ -670,10 +624,6 @@ void SwNavigationPI::_ZoomOut()
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNavigationPI::_ZoomIn()
{
FloatingWindow* pFloat = pContextWin->GetFloatingWindow();
@@ -700,9 +650,6 @@ void SwNavigationPI::_ZoomIn()
aContentToolBox.CheckItem(FN_SHOW_CONTENT_BOX, sal_False);
}
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
void SwNavigationPI::Resize()
{
@@ -752,11 +699,6 @@ void SwNavigationPI::Resize()
}
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
SfxChildWindowContext* pCw,
Window* pParent) :
@@ -767,7 +709,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
aContentToolBox(this, SW_RES(TB_CONTENT)),
aGlobalToolBox(this, SW_RES(TB_GLOBAL)),
aContentImageList(SW_RES(IL_CONTENT)),
- aContentImageListH(SW_RES(ILH_CONTENT)),
aContentTree(this, SW_RES(TL_CONTENT)),
aGlobalTree(this, SW_RES(TL_GLOBAL)),
aDocListBox(this, SW_RES(LB_DOCS)),
@@ -815,8 +756,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
bPageCtrlsVisible = sal_True;
-// Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT);
-// sal_uInt16 nWidth = 2 * (sal_uInt16)aFirstRect.Left();
//doppelte Separatoren sind nicht erlaubt, also muss
//die passende Groesse anders ermittelt werden
Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SELECT_FOOTNOTE);
@@ -943,10 +882,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
aDocListBox.SetAccessibleName(aStatusArr[3]);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNavigationPI::~SwNavigationPI()
{
if(IsGlobalDoc() && !IsGlobalMode())
@@ -977,10 +912,6 @@ SwNavigationPI::~SwNavigationPI()
rBindings.Release(*this);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow )
{
pPopupWindow = pWindow;
@@ -988,10 +919,6 @@ void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow )
pPopupWindow->SetDeleteLink_Impl( LINK( this, SwNavigationPI, ClosePopupWindow ));
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwNavigationPI, PopupModeEndHdl, void *, EMPTYARG )
{
if ( pPopupWindow->IsVisible() )
@@ -1012,10 +939,6 @@ IMPL_LINK( SwNavigationPI, PopupModeEndHdl, void *, EMPTYARG )
return 1;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow )
{
if ( pWindow == pFloatingWindow )
@@ -1026,10 +949,6 @@ IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow )
return 1;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
const SfxPoolItem* /*pState*/ )
{
@@ -1069,10 +988,6 @@ NumEditAction& SwNavigationPI::GetPageEdit()
return *(NumEditAction*)aContentToolBox.GetItemWindow(FN_PAGENUMBER);
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SfxChildAlignment SwNavigationPI::CheckAlignment
(
SfxChildAlignment eActAlign,
@@ -1157,10 +1072,6 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu )
{
sal_uInt16 nMenuId = pMenu->GetCurItemId();
@@ -1174,11 +1085,6 @@ IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu )
return 0;
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwNavigationPI::UpdateListBox()
{
aDocListBox.SetUpdateMode(sal_False);
@@ -1196,7 +1102,7 @@ void SwNavigationPI::UpdateListBox()
while (pView)
{
SfxObjectShell* pDoc = pView->GetDocShell();
- // pb: #i53333# don't show help pages here
+ // #i53333# don't show help pages here
if ( !pDoc->IsHelpDocument() )
{
String sEntry = pDoc->GetTitle();
@@ -1249,14 +1155,6 @@ void SwNavigationPI::UpdateListBox()
aDocListBox.SetUpdateMode(sal_True);
}
-/*-----------------16.06.97 15:05-------------------
-
---------------------------------------------------*/
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem)
{
const SfxViewFrameItem* pFrameItem = PTR_CAST(SfxViewFrameItem, pItem );
@@ -1267,7 +1165,7 @@ IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem)
{
aContentTree.Clear();
pContentView = PTR_CAST(SwView, pFrame->GetViewShell());
- DBG_ASSERT(pContentView, "keine SwView");
+ OSL_ENSURE(pContentView, "no SwView");
if(pContentView)
pContentWrtShell = pContentView->GetWrtShellPtr();
else
@@ -1311,10 +1209,6 @@ String SwNavigationPI::CreateDropFileName( TransferableDataHelper& rData )
return sFileName;
}
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
sal_Int8 SwNavigationPI::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
{
return ( !aContentTree.IsInDrag() &&
@@ -1368,10 +1262,6 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt )
return nRet;
}
-/*-----------------27.11.96 13.00-------------------
-
---------------------------------------------------*/
-
void SwNavigationPI::SetRegionDropMode(sal_uInt16 nNewMode)
{
nRegionMode = nNewMode;
@@ -1383,18 +1273,12 @@ void SwNavigationPI::SetRegionDropMode(sal_uInt16 nNewMode)
else if(nRegionMode == REGION_MODE_EMBEDDED)
nDropId = FN_DROP_REGION_COPY;
- ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode()
- ? aContentImageListH : aContentImageList;
+ ImageList& rImgLst = aContentImageList;
- aContentToolBox.SetItemImage( FN_DROP_REGION,
- rImgLst.GetImage(nDropId));
+ aContentToolBox.SetItemImage( FN_DROP_REGION, rImgLst.GetImage(nDropId));
}
-/*-----------------12.06.97 09:47-------------------
-
---------------------------------------------------*/
-
sal_Bool SwNavigationPI::ToggleTree()
{
sal_Bool bRet = sal_True;
@@ -1428,9 +1312,6 @@ sal_Bool SwNavigationPI::ToggleTree()
return bRet;
}
-/*-----------------13.06.97 09:42-------------------
-
---------------------------------------------------*/
sal_Bool SwNavigationPI::IsGlobalDoc() const
{
sal_Bool bRet = sal_False;
@@ -1442,18 +1323,14 @@ sal_Bool SwNavigationPI::IsGlobalDoc() const
}
return bRet;
}
-/* -----------------26.10.98 08:10-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwNavigationPI, ChangePageHdl, Timer*, EMPTYARG )
{
EditAction(&GetPageEdit());
GetPageEdit().GrabFocus();
return 0;
}
-/* -----------------26.10.98 08:14-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK( SwNavigationPI, PageEditModifyHdl, Edit*, EMPTYARG )
{
if(aPageChgTimer.IsActive())
@@ -1462,9 +1339,6 @@ IMPL_LINK( SwNavigationPI, PageEditModifyHdl, Edit*, EMPTYARG )
return 0;
}
-/* -----------------------------23.04.01 07:34--------------------------------
-
- ---------------------------------------------------------------------------*/
SwView* SwNavigationPI::GetCreateView() const
{
if(!pCreateView)
@@ -1484,11 +1358,6 @@ SwView* SwNavigationPI::GetCreateView() const
return pCreateView;
}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
SwNavigationChild::SwNavigationChild( Window* pParent,
sal_uInt16 nId,
SfxBindings* _pBindings,
@@ -1516,9 +1385,7 @@ SwNavigationChild::SwNavigationChild( Window* pParent,
pNavi->_ZoomIn();
}
}
-/* -----------------------------06.05.2002 10:06------------------------------
- ---------------------------------------------------------------------------*/
void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -1532,15 +1399,12 @@ void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt )
SetBackground( aBack );
}
}
-/* -----------------------------06.05.2002 10:07------------------------------
- ---------------------------------------------------------------------------*/
void SwNavigationPI::InitImageList()
{
sal_uInt16 k;
- ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ?
- aContentImageListH : aContentImageList;
+ ImageList& rImgLst = aContentImageList;
for( k = 0; k < aContentToolBox.GetItemCount(); k++)
aContentToolBox.SetItemImage(aContentToolBox.GetItemId(k),
rImgLst.GetImage(aContentToolBox.GetItemId(k)));
@@ -1558,3 +1422,4 @@ void SwNavigationPI::InitImageList()
rImgLst.GetImage(nDropId));
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/navipi.hrc b/sw/source/ui/utlui/navipi.hrc
index 70fd1dc6e14a..bba57cf53d6b 100644
--- a/sw/source/ui/utlui/navipi.hrc
+++ b/sw/source/ui/utlui/navipi.hrc
@@ -31,7 +31,6 @@
#define BT_UP 5
#define BT_DOWN 6
#define IL_CONTENT 7
-#define ILH_CONTENT 8
#define FT_PAGE 10
#define ED_PAGE 11
#define LB_SELECT 22
diff --git a/sw/source/ui/utlui/navipi.src b/sw/source/ui/utlui/navipi.src
index fde6b82f139b..df11c6aee86a 100644
--- a/sw/source/ui/utlui/navipi.src
+++ b/sw/source/ui/utlui/navipi.src
@@ -92,12 +92,6 @@ Window DLG_NAVIGATION_PI
MaskColor = IMAGE_MASK_COLOR ;
NAVI_IDLIST
};
- ImageList ILH_CONTENT
- {
- Prefix = "sch";
- MaskColor = IMAGE_MASK_COLOR ;
- NAVI_IDLIST
- };
Toolbox TB_CONTENT
{
Pos = MAP_PIXEL ( 5 , 5 ) ;
@@ -123,7 +117,6 @@ Window DLG_NAVIGATION_PI
Identifier = FN_UP ;
// ItemBitmap = Bitmap { File = "navup.bmp"; };
HelpID = HID_NAVI_TBX2 ;
- /* ### ACHTUNG: Neuer Text in Resource? Rückwärts : R³ckwõrts */
Text [ en-US ] = "Back" ;
};
ToolBoxItem
@@ -131,14 +124,12 @@ Window DLG_NAVIGATION_PI
Identifier = FN_DOWN ;
// ItemBitmap = Bitmap { File = "navdn.bmp"; };
HelpID = HID_NAVI_TBX3 ;
- /* ### ACHTUNG: Neuer Text in Resource? Vorwärts : Vorwõrts */
Text [ en-US ] = "Forward" ;
};
ToolBoxItem
{
Identifier = FN_DROP_REGION ;
HelpID = HID_NAVI_TBX4 ;
- /* ### ACHTUNG: Neuer Text in Resource? Modus für Drag & Drop auswählen : Modus f³r Drag & Drop auswõhlen */
DropDown = TRUE ;
Text [ en-US ] = "Drag Mode" ;
};
@@ -204,9 +195,7 @@ Window DLG_NAVIGATION_PI
Identifier = FN_SELECT_FOOTER ;
// ItemBitmap = Bitmap { File = "navfoot.bmp"; };
HelpID = HID_NAVI_TBX11 ;
- /* ### ACHTUNG: Neuer Text in Resource? Fußzeile : Fu˜zeile */
Text [ en-US ] = "Footer" ;
- /* ### ACHTUNG: Neuer Text in Resource? Springen zur Fußzeile : Springen zur Fu˜zeile */
};
ToolBoxItem
{
@@ -214,7 +203,6 @@ Window DLG_NAVIGATION_PI
// ItemBitmap = Bitmap { File = "navnote.bmp"; };
HelpID = HID_NAVI_TBX12 ;
Text [ en-US ] = "Anchor<->Text" ;
- /* ### ACHTUNG: Neuer Text in Resource? Springen zwischen Fußnotenankern und dem Fußnotentext : Springen zwischen Fu˜notenankern und dem Fu˜notentext */
};
ToolBoxItem
{
@@ -224,7 +212,6 @@ Window DLG_NAVIGATION_PI
{
Identifier = FN_OUTLINE_LEVEL ;
HelpID = HID_NAVI_TBX13 ;
- /* ### ACHTUNG: Neuer Text in Resource? Angezeigte Überschriftenebenen : Angezeigte šberschriftenebenen */
Text [ en-US ] = "Heading Levels Shown" ;
DropDown = TRUE ;
};
@@ -282,7 +269,6 @@ Window DLG_NAVIGATION_PI
{
Identifier = FN_GLOBAL_OPEN ;
HelpID = HID_NAVI_TBX20 ;
- /* ### ACHTUNG: Neuer Text in Resource? Einfügen : Einf³gen */
Text [ en-US ] = "Insert" ;
};
ToolBoxItem
@@ -303,14 +289,12 @@ Window DLG_NAVIGATION_PI
{
Identifier = FN_ITEM_UP ;
HelpID = HID_NAVI_TBX22 ;
- /* ### ACHTUNG: Neuer Text in Resource? Nach oben verschieben : Nach unten verschieben */
Text [ en-US ] = "Move Up" ;
};
ToolBoxItem
{
Identifier = FN_ITEM_DOWN ;
HelpID = HID_NAVI_TBX23 ;
- /* ### ACHTUNG: Neuer Text in Resource? Nach unten verschieben : Nach oben verschieben */
Text [ en-US ] = "Move Down" ;
};
};
@@ -369,17 +353,14 @@ Window DLG_NAVIGATION_PI
};
String ST_HYPERLINK
{
- /* ### ACHTUNG: Neuer Text in Resource? Als Hyperlink einfügen : Als Hyperlink einf³gen */
Text [ en-US ] = "Insert as Hyperlink" ;
};
String ST_LINK_REGION
{
- /* ### ACHTUNG: Neuer Text in Resource? Als Verknüpfung einfügen : Als Verkn³pfung einf³gen */
Text [ en-US ] = "Insert as Link" ;
};
String ST_COPY_REGION
{
- /* ### ACHTUNG: Neuer Text in Resource? Als Kopie einfügen : Als Kopie einf³gen */
Text [ en-US ] = "Insert as Copy" ;
};
String ST_DISPLAY
@@ -420,7 +401,6 @@ Window DLG_NAVIGATION_PI
};
String ST_INSERT
{
- /* ### ACHTUNG: Neuer Text in Resource? Einfügen : Einf³gen */
Text [ en-US ] = "Insert" ;
};
String ST_INDEX
@@ -441,7 +421,6 @@ Window DLG_NAVIGATION_PI
};
String ST_DELETE
{
- /* ### ACHTUNG: Neuer Text in Resource? Löschen : L÷schen */
Text [ en-US ] = "Delete" ;
};
String ST_DELETE_ENTRY
@@ -458,7 +437,6 @@ Window DLG_NAVIGATION_PI
};
String ST_UPDATE_LINK
{
- /* ### ACHTUNG: Neuer Text in Resource? Verknüpfungen : Verkn³pfungen */
Text [ en-US ] = "Links" ;
};
String ST_UPDATE_ALL
@@ -520,8 +498,6 @@ Window DLG_NAVIGATION_PI
}; \
IdCount = { 12 ; };
-
-
ImageList IMG_NAVI_ENTRYBMP
{
Prefix = "nc";
@@ -529,12 +505,6 @@ ImageList IMG_NAVI_ENTRYBMP
NAVI_ENTRY_IDS
};
-ImageList IMG_NAVI_ENTRYBMPH
-{
- Prefix = "nch";
- MaskColor = IMAGE_MASK_COLOR ;
- NAVI_ENTRY_IDS
-};
//IAccessibility2 Implementation 2009-----
String STR_ACCESS_TL_GLOBAL
@@ -546,4 +516,3 @@ String STR_ACCESS_TL_CONTENT
Text [ en-US ] = "Content View";
};
//-----IAccessibility2 Implementation 2009
-
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index 03b3d58ec5a7..bcaa7e032894 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,10 +87,6 @@ NumFormatListBox::NumFormatListBox( Window* pWin, const ResId& rResId,
Init(nFormatType, bUsrFmts);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView,
const ResId& rResId, short nFormatType,
sal_uLong nDefFmt, sal_Bool bUsrFmts ) :
@@ -106,10 +103,6 @@ NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView,
Init(nFormatType, bUsrFmts);
}
-/* -----------------15.06.98 11:29-------------------
- *
- * --------------------------------------------------*/
-
void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts)
{
SwView *pView = GetView();
@@ -131,18 +124,11 @@ void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts)
SetSelectHdl(LINK(this, NumFormatListBox, SelectHdl));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
NumFormatListBox::~NumFormatListBox()
{
if (pOwnFormatter)
delete pOwnFormatter;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SwView* NumFormatListBox::GetView()
{
@@ -151,10 +137,6 @@ SwView* NumFormatListBox::GetView()
return ::GetActiveView();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void NumFormatListBox::SetFormatType(const short nFormatType)
{
if (nCurrFormatType == -1 ||
@@ -167,7 +149,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
else
{
SwView *pView = GetView();
- DBG_ASSERT(pView, "no view found");
+ OSL_ENSURE(pView, "no view found");
if(!pView)
return;
SwWrtShell &rSh = pView->GetWrtShell();
@@ -237,7 +219,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
break;
default:
- DBG_ERROR("what a format?");
+ OSL_FAIL("what a format?");
break;
}
@@ -298,10 +280,6 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
{
if (nDefFmt == ULONG_MAX)
@@ -316,7 +294,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
else
{
SwView *pView = GetView();
- DBG_ASSERT(pView, "no view found");
+ OSL_ENSURE(pView, "no view found");
if(!pView)
return;
SwWrtShell &rSh = pView->GetWrtShell();
@@ -357,7 +335,6 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
while ((sal_uLong)GetEntryData(nPos) == ULONG_MAX)
nPos++;
-//
sal_uLong nSysNumFmt = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, eCurLanguage);
sal_uLong nSysShortDateFmt = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_SHORT, eCurLanguage);
sal_uLong nSysLongDateFmt = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_LONG, eCurLanguage);
@@ -391,10 +368,6 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
nDefFormat = GetFormat();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uLong NumFormatListBox::GetFormat() const
{
sal_uInt16 nPos = GetSelectEntryPos();
@@ -402,10 +375,6 @@ sal_uLong NumFormatListBox::GetFormat() const
return (sal_uLong)GetEntryData(nPos);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
{
sal_uInt16 nPos = pBox->GetSelectEntryPos();
@@ -441,12 +410,12 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aCoreSet,
GetView()->GetViewFrame()->GetFrame().GetFrameInterface(),
RC_DLG_SWNUMFMTDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (RET_OK == pDlg->Execute())
{
@@ -487,10 +456,6 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
double NumFormatListBox::GetDefValue(const short nFormatType) const
{
double fDefValue = 0.0;
@@ -505,12 +470,6 @@ double NumFormatListBox::GetDefValue(const short nFormatType) const
case NUMBERFORMAT_TIME:
fDefValue = SVX_NUMVAL_TIME;
break;
-/* {
- String sValue("31.8.1997 16:57:34");
- sal_uLong nFormat = pFormatter->GetStandardFormat(nFormatType, LANGUAGE_GERMAN);
- pFormatter->IsNumberFormat( sValue, nFormat, fDefValue );
- }
- break;*/
case NUMBERFORMAT_TEXT:
case NUMBERFORMAT_UNDEFINED:
@@ -537,13 +496,10 @@ double NumFormatListBox::GetDefValue(const short nFormatType) const
return fDefValue;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void NumFormatListBox::Clear()
{
ListBox::Clear();
nCurrFormatType = -1;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx
index f439c1fe1139..cddb79dcf5dd 100644
--- a/sw/source/ui/utlui/prcntfld.cxx
+++ b/sw/source/ui/utlui/prcntfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// include ---------------------------------------------------------------
-
-
#include "prcntfld.hxx"
-// STATIC DATA -----------------------------------------------------------
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
PercentField::PercentField( Window* pWin, const ResId& rResId ) :
MetricField ( pWin, rResId ),
@@ -56,10 +48,6 @@ PercentField::PercentField( Window* pWin, const ResId& rResId ) :
SetCustomUnitText('%');
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::SetRefValue(sal_Int64 nValue)
{
sal_Int64 nRealValue = GetRealValue(eOldUnit);
@@ -70,10 +58,6 @@ void PercentField::SetRefValue(sal_Int64 nValue)
SetPrcntValue(nRealValue, eOldUnit);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::ShowPercent(sal_Bool bPercent)
{
if ((bPercent && GetUnit() == FUNIT_CUSTOM) ||
@@ -98,7 +82,7 @@ void PercentField::ShowPercent(sal_Bool bPercent)
SetDecimalDigits( 0 );
nAktWidth = ConvertValue(nOldMin, 0, nOldDigits, eOldUnit, FUNIT_TWIP);
- // Um 0.5 Prozent aufrunden
+ // round to 0.5 percent
nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10;
MetricField::SetMin(Max(static_cast< sal_Int64 >(1), nPercent));
@@ -115,7 +99,6 @@ void PercentField::ShowPercent(sal_Bool bPercent)
}
else
MetricFormatter::SetValue(nLastPercent);
-// SetValue(100, FUNIT_CUSTOM);
}
else
{
@@ -141,16 +124,11 @@ void PercentField::ShowPercent(sal_Bool bPercent)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void PercentField::SetValue(sal_Int64 nNewValue, FieldUnit eInUnit)
{
MetricFormatter::SetValue(nNewValue, eInUnit);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
void PercentField::SetPrcntValue(sal_Int64 nNewValue, FieldUnit eInUnit)
{
if (GetUnit() != FUNIT_CUSTOM || eInUnit == FUNIT_CUSTOM)
@@ -174,10 +152,6 @@ void PercentField::SetPrcntValue(sal_Int64 nNewValue, FieldUnit eInUnit)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit )
{
if (GetUnit() != FUNIT_CUSTOM || eInUnit == FUNIT_CUSTOM)
@@ -202,10 +176,6 @@ void PercentField::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit )
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::SetBaseValue(sal_Int64 nNewValue, FieldUnit eInUnit)
{
if (GetUnit() == FUNIT_CUSTOM)
@@ -214,19 +184,11 @@ void PercentField::SetBaseValue(sal_Int64 nNewValue, FieldUnit eInUnit)
MetricField::SetBaseValue(nNewValue, eInUnit);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::GetValue( FieldUnit eOutUnit )
{
return Convert(MetricField::GetValue(), GetUnit(), eOutUnit);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit)
{
if (GetUnit() != FUNIT_CUSTOM)
@@ -242,10 +204,6 @@ void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void PercentField::SetMax(sal_Int64 nNewMax, FieldUnit eInUnit)
{
if (GetUnit() != FUNIT_CUSTOM)
@@ -254,14 +212,9 @@ void PercentField::SetMax(sal_Int64 nNewMax, FieldUnit eInUnit)
{
if (eInUnit == FUNIT_NONE)
eInUnit = eOldUnit;
-// SetRefValue(Convert(nNewMax, eInUnit, FUNIT_TWIP));
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::NormalizePercent(sal_Int64 nValue)
{
if (GetUnit() != FUNIT_CUSTOM)
@@ -272,10 +225,6 @@ sal_Int64 PercentField::NormalizePercent(sal_Int64 nValue)
return nValue;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::DenormalizePercent(sal_Int64 nValue)
{
if (GetUnit() != FUNIT_CUSTOM)
@@ -289,10 +238,6 @@ sal_Int64 PercentField::DenormalizePercent(sal_Int64 nValue)
return nValue;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool PercentField::IsValueModified()
{
if (GetUnit() == FUNIT_CUSTOM)
@@ -301,10 +246,6 @@ sal_Bool PercentField::IsValueModified()
return MetricField::IsValueModified();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::ImpPower10( sal_uInt16 n )
{
sal_uInt16 i;
@@ -316,10 +257,6 @@ sal_Int64 PercentField::ImpPower10( sal_uInt16 n )
return nValue;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::GetRealValue(FieldUnit eOutUnit)
{
if (GetUnit() != FUNIT_CUSTOM)
@@ -328,10 +265,6 @@ sal_Int64 PercentField::GetRealValue(FieldUnit eOutUnit)
return Convert(GetValue(), GetUnit(), eOutUnit);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit eOutUnit)
{
if (eInUnit == eOutUnit ||
@@ -360,7 +293,7 @@ sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit e
nAktWidth = nValue;
else
nAktWidth = ConvertValue(nValue, 0, nOldDigits, eInUnit, FUNIT_TWIP);
- // Um 0.5 Prozent runden
+ // Round to 0.5 percent
return ((nAktWidth * 1000) / nRefValue + 5) / 10;
}
@@ -368,3 +301,4 @@ sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit e
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/shdwcrsr.cxx b/sw/source/ui/utlui/shdwcrsr.cxx
index 58acbd39d8ec..c785cd5edd8a 100644
--- a/sw/source/ui/utlui/shdwcrsr.cxx
+++ b/sw/source/ui/utlui/shdwcrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -133,3 +134,4 @@ Rectangle SwShadowCursor::GetRect() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 94363dfbbbcf..86c2a00b10f4 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include <utlui.hrc>
#include <unotools.hrc>
#include <unoprnms.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XScreenCursor.hpp>
@@ -94,9 +95,7 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin,
aNewNameED.SetModifyHdl(LINK(this, SwRenameXNamedDlg, ModifyHdl));
aOk.Enable(sal_False);
}
-/* -----------------09.06.99 15:34-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG)
{
try
@@ -105,14 +104,12 @@ IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG)
}
catch(uno::RuntimeException&)
{
- DBG_ERROR("Name wurde nicht geaendert");
+ OSL_FAIL("name wasn't changed");
}
EndDialog(RET_OK);
return 0;
}
-/* -----------------09.06.99 15:48-------------------
- *
- * --------------------------------------------------*/
+
IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit)
{
String sTmp(pEdit->GetText());
@@ -141,3 +138,5 @@ IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit)
);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/textcontrolcombo.cxx b/sw/source/ui/utlui/textcontrolcombo.cxx
index 629d527ca872..a613088c3f76 100644
--- a/sw/source/ui/utlui/textcontrolcombo.cxx
+++ b/sw/source/ui/utlui/textcontrolcombo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ void TextControlCombo::Arrange( FixedText& _rFTcomplete, sal_Bool /*bShow*/ )
nYCtrl += aMetricVals.Height();
// separate text parts
- const String aReplStr( RTL_CONSTASCII_STRINGPARAM( "%POSITION_OF_CONTROL" ) );
+ const String aReplStr( RTL_CONSTASCII_USTRINGPARAM( "%POSITION_OF_CONTROL" ) );
String aTxtBefore( _rFTcomplete.GetText() );
String aTxtAfter;
xub_StrLen nReplPos = aTxtBefore.Search( aReplStr );
@@ -111,3 +112,4 @@ void TextControlCombo::Enable( sal_Bool _bEnable, sal_Bool _bChild )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/tmplctrl.cxx b/sw/source/ui/utlui/tmplctrl.cxx
index bcae8fa9cd24..21028f9f4781 100644
--- a/sw/source/ui/utlui/tmplctrl.cxx
+++ b/sw/source/ui/utlui/tmplctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// include ---------------------------------------------------------------
-
-
#include <svl/style.hxx>
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
#include <svl/stritem.hxx>
#include <sfx2/dispatch.hxx>
-#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
-#endif
#include "wrtsh.hxx"
#include "view.hxx"
@@ -51,7 +45,6 @@
// STATIC DATA -----------------------------------------------------------
-
SFX_IMPL_STATUSBAR_CONTROL( SwTemplateControl, SfxStringItem );
// class TemplatePopup_Impl --------------------------------------------------
@@ -69,16 +62,12 @@ private:
virtual void Select();
};
-// -----------------------------------------------------------------------
-
TemplatePopup_Impl::TemplatePopup_Impl() :
PopupMenu(),
nCurId(USHRT_MAX)
{
}
-// -----------------------------------------------------------------------
-
void TemplatePopup_Impl::Select()
{
nCurId = GetCurItemId();
@@ -93,14 +82,10 @@ SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId,
{
}
-// -----------------------------------------------------------------------
-
SwTemplateControl::~SwTemplateControl()
{
}
-// -----------------------------------------------------------------------
-
void SwTemplateControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
@@ -113,15 +98,11 @@ void SwTemplateControl::StateChanged(
}
}
-// -----------------------------------------------------------------------
-
void SwTemplateControl::Paint( const UserDrawEvent& )
{
GetStatusBar().SetItemText( GetId(), sTemplate );
}
-// -----------------------------------------------------------------------
-
void SwTemplateControl::Command( const CommandEvent& rCEvt )
{
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU &&
@@ -172,3 +153,4 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/uiitems.cxx b/sw/source/ui/utlui/uiitems.cxx
index b539adea4353..132d8cf20a6c 100644
--- a/sw/source/ui/utlui/uiitems.cxx
+++ b/sw/source/ui/utlui/uiitems.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,16 +39,14 @@
#include "utlui.hrc"
#include "attrdesc.hrc"
-#ifndef _UNOMID_H
#include <unomid.h>
-#endif
#include <numrule.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
// Breitenangaben der Fussnotenlinien, mit TabPage abstimmen
-static const sal_uInt16 __FAR_DATA nFtnLines[] = {
+static const sal_uInt16 nFtnLines[] = {
0,
10,
50,
@@ -86,7 +85,7 @@ SfxPoolItem* SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const
int SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( Which() == rAttr.Which(), "keine gleichen Attribute" );
+ OSL_ENSURE( Which() == rAttr.Which(), "keine gleichen Attribute" );
return ( aFtnInfo == ((SwPageFtnInfoItem&)rAttr).GetPageFtnInfo());
}
@@ -122,12 +121,10 @@ SfxItemPresentation SwPageFtnInfoItem::GetPresentation
}
return SFX_ITEM_PRESENTATION_NONE;
}
-/* -----------------------------26.04.01 12:25--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
+bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch(nMemberId & ~CONVERT_TWIPS)
{
case MID_FTN_HEIGHT : rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetHeight());break;
@@ -143,18 +140,28 @@ sal_Bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
case MID_LINE_ADJUST : rVal <<= (sal_Int16)aFtnInfo.GetAdj();break;//text::HorizontalAdjust
case MID_LINE_TEXT_DIST : rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetTopDist());break;
case MID_LINE_FOOTNOTE_DIST: rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetBottomDist());break;
+ case MID_FTN_LINE_STYLE :
+ {
+ switch ( aFtnInfo.GetLineStyle( ) )
+ {
+ default:
+ case ::editeng::NO_STYLE: rVal <<= sal_Int8( 0 ); break;
+ case ::editeng::SOLID: rVal <<= sal_Int8( 1 ); break;
+ case ::editeng::DOTTED: rVal <<= sal_Int8( 2 ); break;
+ case ::editeng::DASHED: rVal <<= sal_Int8( 3 ); break;
+ }
+ break;
+ }
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-/* -----------------------------26.04.01 12:26--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
+bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
{
sal_Int32 nSet32 = 0;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch(nMemberId & ~CONVERT_TWIPS)
{
case MID_LINE_COLOR :
@@ -166,7 +173,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
case MID_LINE_FOOTNOTE_DIST:
rVal >>= nSet32;
if(nSet32 < 0)
- bRet = sal_False;
+ bRet = false;
else
{
nSet32 = MM100_TO_TWIP(nSet32);
@@ -185,7 +192,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
if(nSet >= 0)
aFtnInfo.SetLineWidth(MM100_TO_TWIP(nSet));
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_LINE_RELWIDTH :
@@ -193,7 +200,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
sal_Int8 nSet = 0;
rVal >>= nSet;
if(nSet < 0)
- bRet = sal_False;
+ bRet = false;
else
aFtnInfo.SetWidth(Fraction(nSet, 100));
}
@@ -205,11 +212,25 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId)
if(nSet >= 0 && nSet < 3) //text::HorizontalAdjust
aFtnInfo.SetAdj((SwFtnAdj)nSet);
else
- bRet = sal_False;
+ bRet = false;
+ }
+ case MID_FTN_LINE_STYLE:
+ {
+ ::editeng::SvxBorderStyle eStyle = ::editeng::NO_STYLE;
+ sal_Int8 nSet = 0;
+ rVal >>= nSet;
+ switch ( nSet )
+ {
+ case 1: eStyle = ::editeng::SOLID; break;
+ case 2: eStyle = ::editeng::DOTTED; break;
+ case 3: eStyle = ::editeng::DASHED; break;
+ default: break;
+ }
+ aFtnInfo.SetLineStyle( eStyle );
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -240,20 +261,15 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const
return new SwPtrItem( *this );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
int SwPtrItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
const SwPtrItem& rItem = (SwPtrItem&)rAttr;
return ( pMisc == rItem.pMisc );
}
-/*-----------------12.11.97 12:55-------------------------------
+/*--------------------------------------------------------------
SwUINumRuleItem fuer die NumTabPages der FormatNumRule/Stylisten
---------------------------------------------------------------*/
SwUINumRuleItem::SwUINumRuleItem( const SwNumRule& rRul, const sal_uInt16 nId )
@@ -280,17 +296,17 @@ SfxPoolItem* SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const
int SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const
{
- DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+ OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
return *pRule == *((SwUINumRuleItem&)rAttr).pRule;
}
-sal_Bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
+bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
uno::Reference< container::XIndexReplace >xRules = new SwXNumberingRules(*pRule);
rVal.setValue(&xRules, ::getCppuType((uno::Reference< container::XIndexReplace>*)0));
- return sal_True;
+ return true;
}
-sal_Bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
+bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
{
uno::Reference< container::XIndexReplace> xRulesRef;
if(rVal >>= xRulesRef)
@@ -303,18 +319,14 @@ sal_Bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*
*pRule = *pSwXRules->GetNumRule();
}
}
- return sal_True;
+ return true;
}
-/* -----------------17.06.98 17:43-------------------
- *
- * --------------------------------------------------*/
+
SwBackgroundDestinationItem::SwBackgroundDestinationItem(sal_uInt16 _nWhich, sal_uInt16 nValue) :
SfxUInt16Item(_nWhich, nValue)
{
}
-/* -----------------17.06.98 17:44-------------------
- *
- * --------------------------------------------------*/
+
SfxPoolItem* SwBackgroundDestinationItem::Clone( SfxItemPool * /*pPool*/ ) const
{
return new SwBackgroundDestinationItem(Which(), GetValue());
@@ -322,3 +334,4 @@ SfxPoolItem* SwBackgroundDestinationItem::Clone( SfxItemPool * /*pPool*/ ) c
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 915d543d71cf..bef821dff6df 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include <hintids.hxx>
+#include <osl/diagnose.h>
#include <tools/datetime.hxx>
#include <vcl/svapp.hxx>
#include <unotools/collatorwrapper.hxx>
@@ -41,17 +43,13 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <editeng/pmdlitem.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
#include <editeng/tstpitem.hxx>
-#endif
#include <editeng/boxitem.hxx>
#include <editeng/sizeitem.hxx>
#include <svx/pageitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svl/style.hxx>
-#ifndef _VCL_LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <unotools/localedatawrapper.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -66,14 +64,10 @@
#include <fmtpdsc.hxx>
#include <wview.hxx>
#include <uiitems.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <wrtsh.hxx>
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <uitool.hxx>
#include <frmatr.hxx>
#include <paratr.hxx>
@@ -81,18 +75,9 @@
#include <poolfmt.hxx>
#include "usrpref.hxx"
-#ifndef _ERROR_H
-#include <error.h>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <charfmt.hxx>
@@ -231,7 +216,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
//
SwFmtHeader aHeaderFmt(rMaster.GetHeader());
SwFrmFmt *pHeaderFmt = aHeaderFmt.GetHeaderFmt();
- ASSERT(pHeaderFmt != 0, "kein HeaderFormat");
+ OSL_ENSURE(pHeaderFmt != 0, "no header format");
::FillHdFt(pHeaderFmt, rHeaderSet);
@@ -267,7 +252,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
//
SwFmtFooter aFooterFmt(rMaster.GetFooter());
SwFrmFmt *pFooterFmt = aFooterFmt.GetFooterFmt();
- ASSERT(pFooterFmt != 0, "kein FooterFormat");
+ OSL_ENSURE(pFooterFmt != 0, "no footer format");
::FillHdFt(pFooterFmt, rFooterSet);
@@ -326,11 +311,6 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
{
const SwFrmFmt& rMaster = rPageDesc.GetMaster();
@@ -385,7 +365,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
{
const SwFmtHeader &rHeaderFmt = rMaster.GetHeader();
const SwFrmFmt *pHeaderFmt = rHeaderFmt.GetHeaderFmt();
- ASSERT(pHeaderFmt != 0, kein HeaderFormat.);
+ OSL_ENSURE(pHeaderFmt != 0, "no header format");
// HeaderInfo, Raender, Hintergrund, Umrandung
//
@@ -431,7 +411,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
{
const SwFmtFooter &rFooterFmt = rMaster.GetFooter();
const SwFrmFmt *pFooterFmt = rFooterFmt.GetFooterFmt();
- ASSERT(pFooterFmt != 0, kein FooterFormat.);
+ OSL_ENSURE(pFooterFmt != 0, "no footer format");
// FooterInfo, Raender, Hintergrund, Umrandung
//
@@ -622,9 +602,6 @@ void SetDfltMetric( FieldUnit eMetric, sal_Bool bWeb )
SW_MOD()->ApplyUserMetric(eMetric, bWeb);
}
-/*-----------------09.04.98 16:58-------------------
-
---------------------------------------------------*/
sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& rToFill, sal_uInt16 nOffset )
{
sal_uInt16 i = nOffset;
@@ -681,9 +658,6 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted
}
};
-/* -----------------27.04.98 08:26-------------------
- *
- * --------------------------------------------------*/
SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
SwWrtShell* pSh )
{
@@ -715,7 +689,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
}
else
{
- DBG_ERROR("wo soll die Breite denn herkommen?");
+ OSL_FAIL("where to get the actual width from?");
}
const SvxLRSpaceItem& rLRSpace = pFmt->GetLRSpace();
nWidth -= (rLRSpace.GetRight() + rLRSpace.GetLeft());
@@ -726,8 +700,6 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
return nWidth;
}
-/*------------------------------------------------------------------------*/
-
String GetAppLangDateTimeString( const DateTime& rDT )
{
const SvtSysLocale aSysLocale;
@@ -737,9 +709,19 @@ String GetAppLangDateTimeString( const DateTime& rDT )
return sRet;
}
-/*-- 26.01.2006 08:06:33---------------------------------------------------
+/*----------------------------------------------------------------------------
+ * add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value
+ *---------------------------------------------------------------------------*/
+sal_Bool HasCharUnit( sal_Bool bWeb)
+{
+ return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit();
+}
+
+void SetApplyCharUnit(sal_Bool bApplyChar, sal_Bool bWeb)
+{
+ SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
+}
- -----------------------------------------------------------------------*/
bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId )
{
bool bRet = false;
@@ -761,7 +743,7 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16
uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY );
util::URL aURL;
aURL.Complete = sCommand;
- uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY );
+ uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY );
xTrans->parseStrict( aURL );
uno::Reference< frame::XDispatch > xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
if( xDisp.is() )
@@ -773,3 +755,5 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 42df7d4a8dac..cbefd877ee42 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@
#include <unotools.hrc>
#include <unotools.hxx>
#include <unoprnms.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XScreenCursor.hpp>
@@ -62,21 +63,14 @@
#include <unomid.h>
-
using namespace ::com::sun::star;
using ::rtl::OUString;
const sal_Char cFrameControl[] = "com.sun.star.frame.FrameControl";
const sal_Char cFactory[] = "private:factory/swriter";
-/************************************************************************
-
-************************************************************************/
sal_Bool SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_True;
-/* -----------------27.07.99 15:26-------------------
-
- --------------------------------------------------*/
SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
sal_uInt32 nFlags,
const Link* pInitializedLink,
@@ -103,7 +97,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
// the controller is asynchronously set
aLoadedTimer.SetTimeoutHdl(LINK(this, SwOneExampleFrame, TimeoutHdl));
-// aLoadedTimer.SetTimeout(500);
aLoadedTimer.SetTimeout(200);
rWin.Enable(sal_False);
@@ -112,9 +105,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
aTopWindow.Show();
}
-/* -----------------------------08.12.99 13:44--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwOneExampleFrame::CreateErrorMessage(Window* pParent)
{
if(SwOneExampleFrame::bShowServiceNotAvailableMessage)
@@ -125,16 +115,12 @@ void SwOneExampleFrame::CreateErrorMessage(Window* pParent)
SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_False;
}
}
-/* -----------------27.07.99 15:26-------------------
- --------------------------------------------------*/
SwOneExampleFrame::~SwOneExampleFrame()
{
DisposeControl();
}
-/* -----------------------------21.12.00 10:16--------------------------------
- ---------------------------------------------------------------------------*/
void SwOneExampleFrame::CreateControl()
{
if(_xControl.is())
@@ -159,7 +145,6 @@ void SwOneExampleFrame::CreateControl()
uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
uno::Any aURL;
- //
// create new doc
String sTempURL = C2S(cFactory);
if(sArgumentURL.Len())
@@ -189,10 +174,6 @@ void SwOneExampleFrame::CreateControl()
}
}
-
-/* -----------------------------21.12.00 10:16--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwOneExampleFrame::DisposeControl()
{
_xCursor = 0;
@@ -202,9 +183,7 @@ void SwOneExampleFrame::DisposeControl()
_xModel = 0;
_xController = 0;
}
-/* -----------------27.07.99 15:26-------------------
- --------------------------------------------------*/
IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
{
if(!_xControl.is())
@@ -247,32 +226,32 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
if( !bIsInitialized )
{
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS )), aTrueSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS )), aTrueSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES )), aTrueSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER )), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS)), aTrueSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS)), aTrueSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES)), aTrueSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS)), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER)), aFalseSet);
if(0 ==(nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
{
uno::Any aZoom;
aZoom <<= (sal_Int16)view::DocumentZoomType::PAGE_WIDTH_EXACT;
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
}
else
{
uno::Any aZoom;
aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
sal_Int16 nZoomValue = 50;
if(EX_SHOW_BUSINESS_CARDS == nStyleFlags)
@@ -280,10 +259,10 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
nZoomValue = 80;
}
aZoom <<= nZoomValue;
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
}
// set onlinelayout property behind setting the zoom
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)),
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)),
(nStyleFlags&EX_SHOW_ONLINE_LAYOUT) ? aTrueSet : aFalseSet );
bIsInitialized = sal_True;
}
@@ -293,7 +272,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
_xCursor = xText->createTextCursor();
uno::Reference< beans::XPropertySet > xCrsrProp(_xCursor, uno::UNO_QUERY);
uno::Any aPageStyle = xCrsrProp->getPropertyValue(
- C2U(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME)));
+ rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME)));
OUString sPageStyle;
aPageStyle >>= sPageStyle;
@@ -309,27 +288,26 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
uno::Reference< style::XStyle > xPStyle;
aPStyle >>= xPStyle;
uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY);
- uno::Any aSize = xPProp->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE)));
+ uno::Any aSize = xPProp->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE)));
awt::Size aPSize;
aSize >>= aPSize;
//TODO: set page width to card width
aPSize.Width = 10000;
aSize.setValue(&aPSize, ::getCppuType((awt::Size*)0));
- xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize);
+ xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize);
uno::Any aZero; aZero <<= (sal_Int32)0;
- xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero);
- xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
+ xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero);
+ xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
}
// can only be done here - the SFX changes the ScrollBar values
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
if( aInitializedLink.IsSet() )
{
rWindow.Enable(sal_False, sal_True);
- //rWindow.Enable(sal_True, sal_False);
aInitializedLink.Call(this);
}
@@ -364,9 +342,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
pTimer->Start();
return 0;
}
-/* -----------------------------27.12.99 09:59--------------------------------
- ---------------------------------------------------------------------------*/
void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer )
{
uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
@@ -398,9 +374,7 @@ void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer )
}
}
}
-/* -----------------------------15.12.99 11:09--------------------------------
- ---------------------------------------------------------------------------*/
static const sal_Int16 nZoomValues[] =
{
20,
@@ -409,7 +383,7 @@ static const sal_Int16 nZoomValues[] =
75,
100
};
-//---------------------------------------------------------------------------
+
#define ITEM_UP 100
#define ITEM_DOWN 200
#define ITEM_ZOOM 300
@@ -432,7 +406,7 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt)
uno::Reference< view::XViewSettingsSupplier > xSettings(_xController, uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
- uno::Any aZoom = xViewProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)));
+ uno::Any aZoom = xViewProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)));
sal_Int16 nZoom = 0;
aZoom >>= nZoom;
@@ -451,9 +425,7 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt)
aPop.Execute( &aTopWindow, rPt );
}
-/* -----------------------------15.12.99 11:09--------------------------------
- ---------------------------------------------------------------------------*/
IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
{
sal_uInt16 nId = pMenu->GetCurItemId();
@@ -465,9 +437,9 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
uno::Any aZoom;
aZoom <<= nZoom;
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
- xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
+ xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
}
else if(ITEM_UP == nId || ITEM_DOWN == nId)
{
@@ -480,18 +452,14 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
}
return 0;
};
-/* -----------------------------15.12.99 10:37--------------------------------
- ---------------------------------------------------------------------------*/
SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits,
SwOneExampleFrame* pFrame) :
Window(pParent, nBits),
pExampleFrame(pFrame)
{
}
-/* -----------------------------15.12.99 09:57--------------------------------
- ---------------------------------------------------------------------------*/
void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
{
switch ( rCEvt.GetCommand() )
@@ -510,9 +478,7 @@ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
default:;
}
}
-/* -----------------------------15.12.99 12:57--------------------------------
- ---------------------------------------------------------------------------*/
MenuResource::MenuResource(const ResId& rResId) :
Resource(rResId),
aMenuArray(ResId(1,*rResId.GetResMgr()))
@@ -520,3 +486,4 @@ MenuResource::MenuResource(const ResId& rResId) :
FreeResource();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src
index dfa3e07f9053..db93aceacc04 100644
--- a/sw/source/ui/utlui/utlui.src
+++ b/sw/source/ui/utlui/utlui.src
@@ -319,51 +319,6 @@ ImageList ILIST_DB_DLG
MaskColor = IMAGE_MASK_COLOR;
IMGLIST_IDS;
};
-
-ImageList ILIST_DB_DLG_HC
-{
- Prefix = "sxh";
- MaskColor = IMAGE_MASK_COLOR ;
- IMGLIST_IDS;
-};
-
-Image IMG_ONE_LEFT_HC
-{
- ImageBitmap = Bitmap
- {
- File = "one_left_h.bmp" ;
- };
- MaskColor = IMAGE_MASK_COLOR ;
-};
-
-Image IMG_ONE_RIGHT_HC
-{
- ImageBitmap = Bitmap
- {
- File = "one_right_h.bmp" ;
- };
- MaskColor = IMAGE_MASK_COLOR ;
-};
-
-Image IMG_ALL_LEFT_HC
-{
- ImageBitmap = Bitmap
- {
- File = "all_left_h.bmp" ;
- };
- MaskColor = IMAGE_MASK_COLOR ;
-};
-
-Image IMG_ALL_RIGHT_HC
-{
- ImageBitmap = Bitmap
- {
- File = "all_right_h.bmp" ;
- };
- MaskColor = IMAGE_MASK_COLOR ;
-};
-
-
Image IMG_VIEWLAYOUT_AUTOMATIC
{
ImageBitmap = Bitmap
@@ -414,59 +369,6 @@ Image IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE
};
MaskColor = IMAGE_MASK_COLOR;
};
-
-Image IMG_VIEWLAYOUT_AUTOMATIC_HC
-{
- ImageBitmap = Bitmap
- {
- File = "twopages_11x25_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-Image IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC
-{
- ImageBitmap = Bitmap
- {
- File = "twopages_a_11x25_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-
-Image IMG_VIEWLAYOUT_BOOKMODE_HC
-{
- ImageBitmap = Bitmap
- {
- File = "doublepage_11x23_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-Image IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC
-{
- ImageBitmap = Bitmap
- {
- File = "doublepage_a_11x23_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-Image IMG_VIEWLAYOUT_SINGLECOLUMN_HC
-{
- ImageBitmap = Bitmap
- {
- File = "emptypage_11x15_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-Image IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC
-{
- ImageBitmap = Bitmap
- {
- File = "emptypage_a_11x15_h.png" ;
- };
- MaskColor = IMAGE_MASK_COLOR;
-};
-
-
-
String STR_HYPERCTRL_SEL
{
Text [ en-US ] = "SEL";
@@ -475,4 +377,3 @@ String STR_HYPERCTRL_HYP
{
Text [ en-US ] = "HYP";
};
-
diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx
index 1b755391c319..ac8e4a526f80 100644
--- a/sw/source/ui/utlui/viewlayoutctrl.cxx
+++ b/sw/source/ui/utlui/viewlayoutctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,31 +32,23 @@
// include ---------------------------------------------------------------
#include <viewlayoutctrl.hxx>
-#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
-#endif
#include <vcl/image.hxx>
#include <svl/eitem.hxx>
#include <svx/viewlayoutitem.hxx>
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <swtypes.hxx> // fuer Pathfinder
// STATIC DATA -----------------------------------------------------------
SFX_IMPL_STATUSBAR_CONTROL( SwViewLayoutControl, SvxViewLayoutItem );
-// -----------------------------------------------------------------------
-
const long nImageWidthSingle = 15;
const long nImageWidthAuto = 25;
const long nImageWidthBook = 23;
const long nImageWidthSum = 63;
const long nImageHeight = 11;
-// -----------------------------------------------------------------------
-
struct SwViewLayoutControl::SwViewLayoutControl_Impl
{
sal_uInt16 mnState; // 0 = single, 1 = auto, 2 = book, 3 = none
@@ -75,31 +68,26 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
{
mpImpl->mnState = 0;
- const sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode();
- mpImpl->maImageSingleColumn = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) );
- mpImpl->maImageSingleColumn_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) );
- mpImpl->maImageAutomatic = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) );
- mpImpl->maImageAutomatic_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) );
- mpImpl->maImageBookMode = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE) );
- mpImpl->maImageBookMode_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) );
+ mpImpl->maImageSingleColumn = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) );
+ mpImpl->maImageSingleColumn_Active = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) );
+ mpImpl->maImageAutomatic = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) );
+ mpImpl->maImageAutomatic_Active = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) );
+ mpImpl->maImageBookMode = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE) );
+ mpImpl->maImageBookMode_Active = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) );
}
-// -----------------------------------------------------------------------
-
SwViewLayoutControl::~SwViewLayoutControl()
{
delete mpImpl;
}
-// -----------------------------------------------------------------------
-
void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) )
GetStatusBar().SetItemText( GetId(), String() );
else
{
- DBG_ASSERT( pState->ISA( SvxViewLayoutItem ), "invalid item type" );
+ OSL_ENSURE( pState->ISA( SvxViewLayoutItem ), "invalid item type" );
const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem*>( pState )->GetValue();
const bool bBookMode = static_cast<const SvxViewLayoutItem*>( pState )->IsBookMode();
@@ -120,17 +108,10 @@ void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
GetStatusBar().SetItemData( GetId(), 0 ); // force repaint
}
-// -----------------------------------------------------------------------
-
void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt )
{
OutputDevice* pDev = rUsrEvt.GetDevice();
Rectangle aRect = rUsrEvt.GetRect();
- Color aOldLineColor = pDev->GetLineColor();
- Color aOldFillColor = pDev->GetFillColor();
-
- //pDev->SetLineColor();
- //pDev->SetFillColor( pDev->GetBackground().GetColor() );
const bool bSingleColumn = 0 == mpImpl->mnState;
const bool bAutomatic = 1 == mpImpl->mnState;
@@ -152,17 +133,6 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt )
// draw bookmode image:
aRect.Left() += nImageWidthAuto;
pDev->DrawImage( aRect.TopLeft(), bBookMode ? mpImpl->maImageBookMode_Active : mpImpl->maImageBookMode );
-
- // draw separators
- //aRect = rUsrEvt.GetRect();
- //aRect.Left() += nImageWidth;
- //aRect.setWidth( 1 );
- //pDev->DrawRect( aRect );
- //aRect.Left() += nImageWidth;
- //pDev->DrawRect( aRect );
-
- //pDev->SetLineColor( aOldLineColor );
- //pDev->SetFillColor( aOldFillColor );
}
sal_Bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
@@ -207,3 +177,5 @@ sal_Bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/zoomctrl.cxx b/sw/source/ui/utlui/zoomctrl.cxx
index 13cc237812d6..80c5bf66eddc 100644
--- a/sw/source/ui/utlui/zoomctrl.cxx
+++ b/sw/source/ui/utlui/zoomctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "hintids.hxx"
-#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
-#endif
#include <sfx2/app.hxx>
#include <svl/stritem.hxx>
#include <svx/zoomitem.hxx>
@@ -42,10 +39,8 @@
#include "swtypes.hxx"
#include "zoomctrl.hxx"
-
SFX_IMPL_STATUSBAR_CONTROL( SwZoomControl, SvxZoomItem );
-
SwZoomControl::SwZoomControl( sal_uInt16 _nSlotId,
sal_uInt16 _nId,
StatusBar& rStb ) :
@@ -53,14 +48,10 @@ SwZoomControl::SwZoomControl( sal_uInt16 _nSlotId,
{
}
-// -----------------------------------------------------------------------
-
SwZoomControl::~SwZoomControl()
{
}
-// -----------------------------------------------------------------------
-
void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
@@ -76,8 +67,6 @@ void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
}
}
-// -----------------------------------------------------------------------
-
void SwZoomControl::Paint( const UserDrawEvent& rUsrEvt )
{
if(!sPreviewZoom.Len())
@@ -86,8 +75,6 @@ void SwZoomControl::Paint( const UserDrawEvent& rUsrEvt )
GetStatusBar().SetItemText( GetId(), sPreviewZoom );
}
-// -----------------------------------------------------------------------
-
void SwZoomControl::Command( const CommandEvent& rCEvt )
{
if(!sPreviewZoom.Len())
@@ -97,3 +84,4 @@ void SwZoomControl::Command( const CommandEvent& rCEvt )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/service.cxx b/sw/source/ui/vba/service.cxx
index bff007751562..3217c4cf7385 100644
--- a/sw/source/ui/vba/service.cxx
+++ b/sw/source/ui/vba/service.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,6 +58,11 @@ namespace vbaeventshelper
extern sdecl::ServiceDecl const serviceDecl;
}
+namespace vbaeventshelper
+{
+extern sdecl::ServiceDecl const serviceDecl;
+}
+
extern "C"
{
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
@@ -78,3 +84,4 @@ extern "C"
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaaddin.cxx b/sw/source/ui/vba/vbaaddin.cxx
index 8929ae96a914..3e0873c00646 100644
--- a/sw/source/ui/vba/vbaaddin.cxx
+++ b/sw/source/ui/vba/vbaaddin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,4 @@ SwVbaAddin::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaaddin.hxx b/sw/source/ui/vba/vbaaddin.hxx
index 090f5bcc580f..9f4e8c5f797f 100644
--- a/sw/source/ui/vba/vbaaddin.hxx
+++ b/sw/source/ui/vba/vbaaddin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_ADDIN_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx
index f51e11e359b0..2e206cca07c0 100644
--- a/sw/source/ui/vba/vbaaddins.cxx
+++ b/sw/source/ui/vba/vbaaddins.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@ uno::Reference< container::XIndexAccess > lcl_getAddinCollection( const uno::Ref
// first get the autoload addins in the directory STARTUP
uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager(), uno::UNO_QUERY_THROW );
- uno::Reference< ucb::XSimpleFileAccess > xSFA( xMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), xContext), uno::UNO_QUERY_THROW );
+ uno::Reference< ucb::XSimpleFileAccess > xSFA( xMCF->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), uno::UNO_QUERY_THROW );
SvtPathOptions aPathOpt;
// FIXME: temporary the STARTUP path is located in $OO/basic3.1/program/addin
String aAddinPath = aPathOpt.GetAddinPath();
@@ -105,3 +106,5 @@ SwVbaAddins::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaaddins.hxx b/sw/source/ui/vba/vbaaddins.hxx
index 6d160f78e27b..2d5b651f76fe 100644
--- a/sw/source/ui/vba/vbaaddins.hxx
+++ b/sw/source/ui/vba/vbaaddins.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
};
#endif /* SW_VBA_ADDINS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index aa7832a54dc5..cbfbe90ef2a9 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include <editeng/acorrcfg.hxx>
#include "wordvbahelper.hxx"
#include <docsh.hxx>
+#include "vbalistgalleries.hxx"
using namespace ::ooo;
using namespace ::ooo::vba;
@@ -57,7 +59,7 @@ using ::rtl::OUString;
#define OWN_JOIN 1
// #TODO is this defined somewhere else?
-#if ( defined UNX ) || ( defined OS2 ) //unix
+#if ( defined UNX )
#define FILE_PATH_SEPERATOR "/"
#else // windows
#define FILE_PATH_SEPERATOR "\\"
@@ -153,14 +155,24 @@ SwVbaApplication::Dialogs( const uno::Any& index ) throw (uno::RuntimeException)
return uno::makeAny( xCol );
}
+uno::Any SAL_CALL
+SwVbaApplication::ListGalleries( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextDocument > xTextDoc( getCurrentDocument(), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaListGalleries( this, mxContext, xTextDoc ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
sal_Bool SAL_CALL SwVbaApplication::getDisplayAutoCompleteTips() throw (css::uno::RuntimeException)
{
- return SvxAutoCorrCfg::Get()->IsAutoTextTip();
+ return SvxAutoCorrCfg::Get().IsAutoTextTip();
}
void SAL_CALL SwVbaApplication::setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) throw (css::uno::RuntimeException)
{
- SvxAutoCorrCfg::Get()->SetAutoTextTip( _displayAutoCompleteTips );
+ SvxAutoCorrCfg::Get().SetAutoTextTip( _displayAutoCompleteTips );
}
sal_Int32 SAL_CALL SwVbaApplication::getEnableCancelKey() throw (css::uno::RuntimeException)
@@ -203,3 +215,5 @@ SwVbaApplication::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index 1261590d7c56..9d741013a7a8 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,7 @@ public:
virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL ListGalleries( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getDisplayAutoCompleteTips() throw (css::uno::RuntimeException);
virtual void SAL_CALL setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getEnableCancelKey() throw (css::uno::RuntimeException);
@@ -72,3 +74,5 @@ protected:
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException);
};
#endif /* SW_VBA_APPLICATION_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaautotextentry.cxx b/sw/source/ui/vba/vbaautotextentry.cxx
index d4c153913553..8ad0f0f45673 100644
--- a/sw/source/ui/vba/vbaautotextentry.cxx
+++ b/sw/source/ui/vba/vbaautotextentry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +27,9 @@
************************************************************************/
#include "vbaautotextentry.hxx"
#include <vbahelper/vbahelper.hxx>
+#include <com/sun/star/text/XParagraphCursor.hpp>
#include <tools/diagnose_ex.h>
+#include "wordvbahelper.hxx"
#include "vbarange.hxx"
using namespace ::ooo::vba;
@@ -41,7 +44,7 @@ SwVbaAutoTextEntry::~SwVbaAutoTextEntry()
{
}
-uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::Reference< word::XRange >& _where, const uno::Any& /*_richtext*/ ) throw ( uno::RuntimeException )
+uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::Reference< word::XRange >& _where, const uno::Any& _richtext ) throw ( uno::RuntimeException )
{
SwVbaRange* pWhere = dynamic_cast<SwVbaRange*>( _where.get() );
if( pWhere )
@@ -55,8 +58,27 @@ uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::R
uno::Reference< text::XTextCursor > xTC = xText->createTextCursorByRange( xTextRange->getStart() );
xTC->goRight( 1, sal_True );
xTC->setString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("") ) ); // remove marker
+ // remove the blank paragraph if it is a rich text
+ sal_Bool bRich = sal_False;
+ _richtext >>= bRich;
+ if( bRich )
+ {
+ // check if it is a blank paragraph
+ uno::Reference< text::XParagraphCursor > xParaCursor( xTC, uno::UNO_QUERY_THROW );
+ if( xParaCursor->isStartOfParagraph() && xParaCursor->isEndOfParagraph() )
+ {
+ //remove the blank paragraph
+ uno::Reference< frame::XModel > xModel( getCurrentWordDoc( mxContext ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextViewCursor > xTVCursor = word::getXTextViewCursor( xModel );
+ uno::Reference< text::XTextRange > xCurrentRange( xTC->getEnd(), uno::UNO_QUERY_THROW );
+ xTVCursor->gotoRange( xCurrentRange, sal_False );
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Delete"));
+ dispatchRequests( xModel,url );
+ xTVCursor->gotoRange( xEndMarker->getEnd(), sal_False );
+ }
+ }
xEndMarker->setString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("") ) ); // remove marker
- xTC->gotoRange( xEndMarker, sal_True );
+ xTC = xText->createTextCursorByRange( xEndMarker->getEnd() );
pWhere->setXTextCursor( xTC );
}
return uno::Reference< word::XRange >( pWhere );
@@ -95,8 +117,7 @@ SwVbaAutoTextEntries::getElementType() throw (uno::RuntimeException)
uno::Reference< container::XEnumeration >
SwVbaAutoTextEntries::createEnumeration() throw (uno::RuntimeException)
{
- uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
- return xEnumerationAccess->createEnumeration();
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
}
uno::Any
@@ -124,3 +145,5 @@ SwVbaAutoTextEntries::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaautotextentry.hxx b/sw/source/ui/vba/vbaautotextentry.hxx
index 4ec2d986a877..c5c22da79b56 100644
--- a/sw/source/ui/vba/vbaautotextentry.hxx
+++ b/sw/source/ui/vba/vbaautotextentry.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,3 +79,5 @@ public:
};
#endif /* SW_VBA_AUTOTEXTENTRY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbabookmark.cxx b/sw/source/ui/vba/vbabookmark.cxx
index a710682c5194..d254659ac260 100644
--- a/sw/source/ui/vba/vbabookmark.cxx
+++ b/sw/source/ui/vba/vbabookmark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,12 @@
#include <tools/diagnose_ex.h>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextViewCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
#include "vbarange.hxx"
+#include "wordvbahelper.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -65,8 +69,8 @@ void SAL_CALL SwVbaBookmark::Delete() throw ( uno::RuntimeException )
void SAL_CALL SwVbaBookmark::Select() throw ( uno::RuntimeException )
{
checkVality();
- uno::Reference< text::XTextViewCursorSupplier > xViewCursorSupplier( mxModel->getCurrentController(), uno::UNO_QUERY_THROW );
- xViewCursorSupplier->getViewCursor()->gotoRange( mxBookmark->getAnchor(),sal_False );
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( mxModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelectSupp->select( uno::makeAny( mxBookmark ) );
}
rtl::OUString SAL_CALL SwVbaBookmark::getName() throw ( uno::RuntimeException )
@@ -107,3 +111,4 @@ SwVbaBookmark::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbabookmark.hxx b/sw/source/ui/vba/vbabookmark.hxx
index 632046c935d8..42aee48ca0bb 100644
--- a/sw/source/ui/vba/vbabookmark.hxx
+++ b/sw/source/ui/vba/vbabookmark.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_BOOKMARK_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx
index 609b8f9df767..2990feaf9487 100644
--- a/sw/source/ui/vba/vbabookmarks.cxx
+++ b/sw/source/ui/vba/vbabookmarks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,9 +118,6 @@ SwVbaBookmarks::SwVbaBookmarks( const uno::Reference< XHelperInterface >& xParen
{
mxBookmarksSupplier.set( mxModel, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextDocument > xDocument( mxModel, uno::UNO_QUERY_THROW );
- // use view cursor to insert bookmark, or it will fail if insert bookmark in table
- // mxText = xDocument->getText();
- mxText = word::getXTextViewCursor( mxModel )->getText();
}
// XEnumerationAccess
uno::Type
@@ -145,16 +143,16 @@ SwVbaBookmarks::createCollectionObject( const css::uno::Any& aSource )
void SwVbaBookmarks::removeBookmarkByName( const rtl::OUString& rName ) throw (uno::RuntimeException)
{
uno::Reference< text::XTextContent > xBookmark( m_xNameAccess->getByName( rName ), uno::UNO_QUERY_THROW );
- mxText->removeTextContent( xBookmark );
+ word::getXTextViewCursor( mxModel )->getText()->removeTextContent( xBookmark );
}
-void SwVbaBookmarks::addBookmarkByName( const rtl::OUString& rName, const uno::Reference< text::XTextRange >& rTextRange ) throw (uno::RuntimeException)
+void SwVbaBookmarks::addBookmarkByName( const uno::Reference< frame::XModel >& xModel, const rtl::OUString& rName, const uno::Reference< text::XTextRange >& rTextRange ) throw (uno::RuntimeException)
{
- uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XMultiServiceFactory > xDocMSF( xModel, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextContent > xBookmark( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")) ), uno::UNO_QUERY_THROW );
uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY_THROW );
xNamed->setName( rName );
- mxText->insertTextContent( rTextRange, xBookmark, sal_False );
+ rTextRange->getText()->insertTextContent( rTextRange, xBookmark, sal_False );
}
uno::Any SAL_CALL
@@ -175,12 +173,11 @@ SwVbaBookmarks::Add( const rtl::OUString& rName, const uno::Any& rRange ) throw
}
// remove the exist bookmark
- // rtl::OUString aName = rName.toAsciiLowerCase();
rtl::OUString aName = rName;
if( m_xNameAccess->hasByName( aName ) )
removeBookmarkByName( aName );
- addBookmarkByName( aName, xTextRange );
+ addBookmarkByName( mxModel, aName, xTextRange );
return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, aName ) ) );
}
@@ -234,3 +231,5 @@ SwVbaBookmarks::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbabookmarks.hxx b/sw/source/ui/vba/vbabookmarks.hxx
index d9047b33d49c..0060bb67c357 100644
--- a/sw/source/ui/vba/vbabookmarks.hxx
+++ b/sw/source/ui/vba/vbabookmarks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,12 +48,12 @@ private:
private:
void removeBookmarkByName( const rtl::OUString& rName ) throw (css::uno::RuntimeException);
- void addBookmarkByName( const rtl::OUString& rName, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw (css::uno::RuntimeException);
public:
SwVbaBookmarks( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xBookmarks, const css::uno::Reference< css::frame::XModel >& xModel );
virtual ~SwVbaBookmarks() {}
+ static void addBookmarkByName( const css::uno::Reference< css::frame::XModel >& xModel, const rtl::OUString& rName, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw (css::uno::RuntimeException);
// XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
@@ -73,3 +74,5 @@ public:
};
#endif /* SW_VBA_BOOKMARKS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx
index 184f406c49ac..26d5a6bf18be 100644
--- a/sw/source/ui/vba/vbaborders.cxx
+++ b/sw/source/ui/vba/vbaborders.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,7 @@
#include <ooo/vba/word/XBorder.hpp>
#include <ooo/vba/word/WdBorderType.hpp>
#include <ooo/vba/word/WdLineStyle.hpp>
+#include <sal/macros.h>
#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/TableBorder.hpp>
@@ -268,7 +270,7 @@ public:
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
- return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] );
+ return SAL_N_ELEMENTS( supportedIndexTable );
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -348,14 +350,14 @@ SwVbaBorders::getItemByIntIndex( const sal_Int32 nIndex ) throw (uno::RuntimeEx
sal_Bool SAL_CALL SwVbaBorders::getShadow() throw (uno::RuntimeException)
{
- table::ShadowFormat aShadowFormat;
- m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ShadowFormat") ) ) >>= aShadowFormat;
- return ( aShadowFormat.Location != table::ShadowLocation_NONE );
+ // always return False for table border in MS Word
+ return sal_False;
}
void SAL_CALL SwVbaBorders::setShadow( sal_Bool /*_shadow*/ ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ // not support in Table border in Word
+ // TODO:
}
rtl::OUString&
@@ -376,3 +378,5 @@ SwVbaBorders::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaborders.hxx b/sw/source/ui/vba/vbaborders.hxx
index e8a5ff487b98..536960aeee84 100644
--- a/sw/source/ui/vba/vbaborders.hxx
+++ b/sw/source/ui/vba/vbaborders.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,4 @@ public:
#endif //SW_VBA_BORDERS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacell.cxx b/sw/source/ui/vba/vbacell.cxx
new file mode 100644
index 000000000000..2aada3408af2
--- /dev/null
+++ b/sw/source/ui/vba/vbacell.cxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbacell.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include "vbatable.hxx"
+#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "wordvbahelper.hxx"
+#include "vbatablehelper.hxx"
+#include "vbarow.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaCell::SwVbaCell( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nColumn, sal_Int32 nRow ) throw ( uno::RuntimeException ) :
+ SwVbaCell_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnColumn( nColumn ), mnRow( nRow )
+{
+}
+
+SwVbaCell::~SwVbaCell()
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaCell::getWidth() throw (css::uno::RuntimeException)
+{
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ return aTableHelper.GetColWidth( mnColumn, mnRow, sal_True );
+}
+
+void SAL_CALL SwVbaCell::setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException)
+{
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ aTableHelper.SetColWidth( _width, mnColumn, mnRow, sal_True );
+}
+
+uno::Any SAL_CALL SwVbaCell::getHeight() throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) );
+ return xRow->getHeight();
+}
+
+void SAL_CALL SwVbaCell::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) );
+ xRow->setHeight( _height );
+}
+
+::sal_Int32 SAL_CALL SwVbaCell::getHeightRule() throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) );
+ return xRow->getHeightRule();
+}
+
+void SAL_CALL SwVbaCell::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) );
+ xRow->setHeightRule( _heightrule );
+}
+
+void SAL_CALL SwVbaCell::SetWidth( float width, sal_Int32 /*rulestyle*/ ) throw (css::uno::RuntimeException)
+{
+ // FIXME: handle the argument: rulestyle
+ setWidth( static_cast<sal_Int32>(width) );
+}
+
+void SAL_CALL SwVbaCell::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException)
+{
+ // FIXME: handle the argument: heightrule
+ setHeightRule( heightrule );
+ setHeight( uno::makeAny( height ) );
+}
+
+rtl::OUString&
+SwVbaCell::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCell") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaCell::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Cell" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacell.hxx b/sw/source/ui/vba/vbacell.hxx
new file mode 100644
index 000000000000..1e26b79440ca
--- /dev/null
+++ b/sw/source/ui/vba/vbacell.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_CELL_HXX
+#define SW_VBA_CELL_HXX
+
+#include <ooo/vba/word/XCell.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextTable.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XCell > SwVbaCell_BASE;
+
+class SwVbaCell : public SwVbaCell_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ sal_Int32 mnColumn;
+ sal_Int32 mnRow;
+
+public:
+ SwVbaCell( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nColumn, sal_Int32 nRow ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaCell();
+
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_CELL_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacells.cxx b/sw/source/ui/vba/vbacells.cxx
new file mode 100644
index 000000000000..a104ea29c1ca
--- /dev/null
+++ b/sw/source/ui/vba/vbacells.cxx
@@ -0,0 +1,223 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbacells.hxx"
+#include "vbacell.hxx"
+#include "wordvbahelper.hxx"
+#include "vbatablehelper.hxx"
+#include "vbarow.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > CellCollectionHelper_Base;
+
+class CellsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::Reference< container::XIndexAccess > mxIndexAccess;
+ sal_Int32 nIndex;
+
+public:
+ CellsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( nIndex < mxIndexAccess->getCount() )
+ {
+ return mxIndexAccess->getByIndex( nIndex++ );
+ }
+ throw container::NoSuchElementException();
+ }
+};
+
+class CellCollectionHelper : public CellCollectionHelper_Base
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< css::text::XTextTable > mxTextTable;
+ sal_Int32 mnLeft;
+ sal_Int32 mnTop;
+ sal_Int32 mnRight;
+ sal_Int32 mnBottom;
+
+public:
+ CellCollectionHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw ( css::uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), mnLeft( nLeft ), mnTop( nTop ), mnRight( nRight ), mnBottom( nBottom )
+ {
+ }
+ virtual ~CellCollectionHelper() {}
+
+ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return ( mnRight - mnLeft + 1 ) * ( mnBottom - mnTop + 1 );
+ }
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw css::lang::IndexOutOfBoundsException();
+
+ for( sal_Int32 row = mnTop; row <= mnBottom; row++ )
+ {
+ for( sal_Int32 col = mnLeft; col <= mnRight; col++ )
+ {
+ if( Index == ( ( row - mnTop ) * ( mnRight - mnLeft + 1 ) + ( col - mnLeft ) ) )
+ return uno::makeAny( uno::Reference< word::XCell >( new SwVbaCell( mxParent, mxContext, mxTextTable, col, row ) ) );
+ }
+ }
+ throw css::lang::IndexOutOfBoundsException();
+
+ }
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return word::XCell::static_type(0);
+ }
+ virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return sal_True;
+ }
+ // XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new CellsEnumWrapper( this );
+ }
+};
+
+SwVbaCells::SwVbaCells( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw (uno::RuntimeException) : SwVbaCells_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new CellCollectionHelper( xParent, xContext, xTextTable, nLeft, nTop, nRight, nBottom ) ) ), mxTextTable( xTextTable ), mnLeft( nLeft ), mnTop( nTop ), mnRight( nRight ), mnBottom( nBottom )
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaCells::getWidth() throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( 0 ), uno::UNO_QUERY_THROW );
+ return xCell->getWidth();
+}
+
+void SAL_CALL SwVbaCells::setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ while( nIndex < m_xIndexAccess->getCount() )
+ {
+ uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW );
+ xCell->setWidth( _width );
+ }
+}
+
+uno::Any SAL_CALL SwVbaCells::getHeight() throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnTop ) );
+ return xRow->getHeight();
+}
+
+void SAL_CALL SwVbaCells::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException)
+{
+ for( sal_Int32 row = mnTop; row <= mnBottom; row++ )
+ {
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) );
+ xRow->setHeight( _height );
+ }
+}
+
+::sal_Int32 SAL_CALL SwVbaCells::getHeightRule() throw (css::uno::RuntimeException)
+{
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnTop ) );
+ return xRow->getHeightRule();
+}
+
+void SAL_CALL SwVbaCells::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException)
+{
+ for( sal_Int32 row = mnTop; row <= mnBottom; row++ )
+ {
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) );
+ xRow->setHeightRule( _heightrule );
+ }
+}
+
+void SAL_CALL SwVbaCells::SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ while( nIndex < m_xIndexAccess->getCount() )
+ {
+ uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW );
+ xCell->SetWidth( width, rulestyle );
+ }
+}
+
+void SAL_CALL SwVbaCells::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException)
+{
+ for( sal_Int32 row = mnTop; row <= mnBottom; row++ )
+ {
+ uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) );
+ xRow->SetHeight( height, heightrule );
+ }
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaCells::getElementType() throw (uno::RuntimeException)
+{
+ return word::XCell::static_type(0);
+}
+
+uno::Reference< container::XEnumeration >
+SwVbaCells::createEnumeration() throw (uno::RuntimeException)
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
+ return xEnumAccess->createEnumeration();
+}
+
+uno::Any
+SwVbaCells::createCollectionObject( const uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaCells::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCells") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+SwVbaCells::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Cells") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacells.hxx b/sw/source/ui/vba/vbacells.hxx
new file mode 100644
index 000000000000..e3fe940aa256
--- /dev/null
+++ b/sw/source/ui/vba/vbacells.hxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_CELLS_HXX
+#define SW_VBA_CELLS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XCells.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextTable.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XCells > SwVbaCells_BASE;
+
+class SwVbaCells : public SwVbaCells_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ sal_Int32 mnLeft;
+ sal_Int32 mnTop;
+ sal_Int32 mnRight;
+ sal_Int32 mnBottom;
+
+public:
+ SwVbaCells( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaCells() {}
+
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException);
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaCells_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_CELLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacheckbox.cxx b/sw/source/ui/vba/vbacheckbox.cxx
new file mode 100644
index 000000000000..65b55a3142da
--- /dev/null
+++ b/sw/source/ui/vba/vbacheckbox.cxx
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbacheckbox.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <ecmaflds.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaCheckBox::SwVbaCheckBox( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& rModel, const uno::Reference< text::XFormField >& xFormField ) throw ( uno::RuntimeException ) : SwVbaCheckBox_BASE( rParent, rContext ), mxModel( rModel ), mxFormField( xFormField )
+{
+ rtl::OUString sType = mxFormField->getFieldType();
+ if( !sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) )
+ {
+ throw uno::RuntimeException( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("It is not a CheckBox")), uno::Reference< uno::XInterface >() );
+ }
+}
+
+SwVbaCheckBox::~SwVbaCheckBox()
+{
+}
+
+sal_Bool SAL_CALL SwVbaCheckBox::getValue() throw ( uno::RuntimeException )
+{
+ sal_Bool bValue = sal_False;
+ sal_Int32 nCount = mxFormField->getParamCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ if( mxFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX_CHECKED ) )
+ {
+ if( mxFormField->getParamValue(i).equalsIgnoreAsciiCaseAscii("on") )
+ bValue = sal_True;
+ else
+ bValue = sal_False;
+ break;
+ }
+ }
+ return bValue;
+}
+
+void SAL_CALL SwVbaCheckBox::setValue( sal_Bool value ) throw ( uno::RuntimeException )
+{
+ rtl::OUString sValue = value ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("on")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("off"));
+ mxFormField->addParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ECMA_FORMCHECKBOX_CHECKED )), sValue, sal_True );
+}
+
+rtl::OUString&
+SwVbaCheckBox::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCheckBox") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaCheckBox::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.CheckBox" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacheckbox.hxx b/sw/source/ui/vba/vbacheckbox.hxx
new file mode 100644
index 000000000000..e8e4da8e2efa
--- /dev/null
+++ b/sw/source/ui/vba/vbacheckbox.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_CHECKBOX_HXX
+#define SW_VBA_CHECKBOX_HXX
+
+#include <ooo/vba/word/XCheckBox.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XFormField.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XCheckBox > SwVbaCheckBox_BASE;
+
+class SwVbaCheckBox : public SwVbaCheckBox_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::text::XFormField > mxFormField;
+
+public:
+ SwVbaCheckBox( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XFormField >& xFormField ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaCheckBox();
+
+ // Methods
+ sal_Bool SAL_CALL getValue() throw ( css::uno::RuntimeException );
+ void SAL_CALL setValue( sal_Bool value ) throw ( css::uno::RuntimeException );
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_CHECKBOX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacolumn.cxx b/sw/source/ui/vba/vbacolumn.cxx
new file mode 100644
index 000000000000..86b2f27daed5
--- /dev/null
+++ b/sw/source/ui/vba/vbacolumn.cxx
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbacolumn.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include "vbatable.hxx"
+#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "wordvbahelper.hxx"
+#include "vbatablehelper.hxx"
+
+#define RELATIVE_TABLE_WIDTH 10000
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaColumn::SwVbaColumn( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( uno::RuntimeException ) :
+ SwVbaColumn_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnIndex( nIndex )
+{
+ mxTableColumns = mxTextTable->getColumns();
+}
+
+SwVbaColumn::~SwVbaColumn()
+{
+}
+
+void SwVbaColumn::calculateAbsoluteColumnWidth( sal_Int32 nTableWidth, const css::uno::Sequence< css::text::TableColumnSeparator >& aSeparators, double* pAbsWidth )
+{
+ const text::TableColumnSeparator* pArray = aSeparators.getConstArray();
+ sal_Int32 nSepCount = aSeparators.getLength();
+ for( sal_Int32 i = 0; i <= nSepCount; i++ )
+ {
+ sal_Int32 nRelColWidth = 0;
+ if( i == 0 )
+ {
+ if( nSepCount != 0 )
+ {
+ nRelColWidth = pArray[0].Position;
+ }
+ else
+ {
+ nRelColWidth = RELATIVE_TABLE_WIDTH;
+ }
+ }
+ else
+ {
+ if( i == nSepCount )
+ {
+ nRelColWidth = RELATIVE_TABLE_WIDTH - pArray[i-1].Position;
+ }
+ else
+ {
+ nRelColWidth = pArray[i].Position - pArray[i-1].Position;
+ }
+ }
+ pAbsWidth[i] = ( (double)nRelColWidth / RELATIVE_TABLE_WIDTH ) * (double) nTableWidth;
+ }
+}
+
+void SwVbaColumn::calculateRelativeColumnWidth( const double* pAbsWidth, double* pRelWidth, sal_Int32 nCount )
+{
+ double tableWidth = 0.0;
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ tableWidth += pAbsWidth[i];
+ }
+
+ pRelWidth[ nCount - 1 ] = tableWidth;
+ for( sal_Int32 i = 0; i < nCount - 1; i++ )
+ {
+ if( i == 0 )
+ {
+ pRelWidth[i] = ( pAbsWidth[i] * RELATIVE_TABLE_WIDTH ) / tableWidth;
+ }
+ else
+ {
+ pRelWidth[i] = pRelWidth[i-1] + ( pAbsWidth[i] * RELATIVE_TABLE_WIDTH ) / tableWidth;
+ }
+ }
+}
+
+sal_Int32 SAL_CALL
+SwVbaColumn::getWidth( ) throw ( css::uno::RuntimeException )
+{
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ return aTableHelper.GetColWidth( mnIndex );
+}
+
+void SAL_CALL
+SwVbaColumn::setWidth( sal_Int32 _width ) throw ( css::uno::RuntimeException )
+{
+
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ aTableHelper.SetColWidth( _width, mnIndex );
+}
+
+void SAL_CALL
+SwVbaColumn::Select( ) throw ( uno::RuntimeException )
+{
+ SelectColumn( getCurrentWordDoc(mxContext), mxTextTable, mnIndex, mnIndex );
+}
+
+void SwVbaColumn::SelectColumn( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn ) throw ( uno::RuntimeException )
+{
+ rtl::OUStringBuffer aRangeName;
+ rtl::OUString sStartCol = SwVbaTableHelper::getColumnStr( nStartColumn );
+ aRangeName.append(sStartCol).append(sal_Int32( 1 ) );
+ rtl::OUString sEndCol = SwVbaTableHelper::getColumnStr( nEndColumn );
+ sal_Int32 nRowCount = xTextTable->getRows()->getCount();
+ aRangeName.appendAscii(":").append( sEndCol ).append( sal_Int32( nRowCount ) );
+
+ uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW );
+ rtl::OUString sSelRange = aRangeName.makeStringAndClear();
+ uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( sSelRange );
+
+ uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelection->select( uno::makeAny( xSelRange ) );
+}
+
+rtl::OUString&
+SwVbaColumn::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaColumn") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaColumn::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Column" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacolumn.hxx b/sw/source/ui/vba/vbacolumn.hxx
new file mode 100644
index 000000000000..3ab42d6491d8
--- /dev/null
+++ b/sw/source/ui/vba/vbacolumn.hxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_COLUMN_HXX
+#define SW_VBA_COLUMN_HXX
+
+#include <ooo/vba/word/XColumn.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/table/XTableColumns.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/text/TableColumnSeparator.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XColumn > SwVbaColumn_BASE;
+
+class SwVbaColumn : public SwVbaColumn_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ css::uno::Reference< css::table::XTableColumns > mxTableColumns;
+ sal_Int32 mnIndex;
+
+private:
+ void calculateAbsoluteColumnWidth( sal_Int32 nTableWidth, const css::uno::Sequence< css::text::TableColumnSeparator >& aSeparators, double* pAbsWidth );
+ void calculateRelativeColumnWidth( const double* pAbsWidth, double* pRelWidth, sal_Int32 nCount );
+
+public:
+ SwVbaColumn( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaColumn();
+
+ // Methods
+ virtual sal_Int32 SAL_CALL getWidth() throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL setWidth( sal_Int32 _width ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+
+ static void SelectColumn( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_COLUMN_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacolumns.cxx b/sw/source/ui/vba/vbacolumns.cxx
new file mode 100644
index 000000000000..1d8cc55fc406
--- /dev/null
+++ b/sw/source/ui/vba/vbacolumns.cxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbacolumns.hxx"
+#include "vbacolumn.hxx"
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <ooo/vba/word/WdConstants.hpp>
+#include <ooo/vba/word/WdRulerStyle.hpp>
+#include "wordvbahelper.hxx"
+#include "vbatablehelper.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class ColumnsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::WeakReference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< text::XTextTable > mxTextTable;
+ uno::Reference< container::XIndexAccess > mxIndexAccess;
+ sal_Int32 nIndex;
+
+public:
+ ColumnsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< text::XTextTable >& xTextTable ) : mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), nIndex( 0 )
+ {
+ mxIndexAccess.set( mxTextTable->getColumns(), uno::UNO_QUERY );
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( nIndex < mxIndexAccess->getCount() )
+ {
+ return uno::makeAny( uno::Reference< word::XColumn > ( new SwVbaColumn( mxParent, mxContext, mxTextTable, nIndex++ ) ) );
+ }
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaColumns::SwVbaColumns( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableColumns >& xTableColumns ) throw (uno::RuntimeException) : SwVbaColumns_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableColumns, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableColumns( xTableColumns )
+{
+ mnStartColumnIndex = 0;
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ mnEndColumnIndex = aTableHelper.getTabColumnsMaxCount( ) - 1;
+}
+
+SwVbaColumns::SwVbaColumns( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableColumns >& xTableColumns, sal_Int32 nStartCol, sal_Int32 nEndCol ) throw (uno::RuntimeException) : SwVbaColumns_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableColumns, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableColumns( xTableColumns ), mnStartColumnIndex( nStartCol ), mnEndColumnIndex( nEndCol )
+{
+ if( mnEndColumnIndex < mnStartColumnIndex )
+ throw uno::RuntimeException();
+}
+
+uno::Reference< word::XColumn > SwVbaColumns::getColumnAtIndex( sal_Int32 index ) throw (uno::RuntimeException)
+{
+ return uno::Reference< word::XColumn >( new SwVbaColumn( this, mxContext, mxTextTable, index ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaColumns::getWidth() throw (uno::RuntimeException)
+{
+ return getColumnAtIndex( mnStartColumnIndex )->getWidth();
+}
+
+void SAL_CALL SwVbaColumns::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException)
+{
+ for( sal_Int32 index = mnStartColumnIndex; index <= mnEndColumnIndex; index++ )
+ {
+ getColumnAtIndex( index )->setWidth( _width );
+ }
+}
+
+void SAL_CALL SwVbaColumns::Select( ) throw (uno::RuntimeException)
+{
+ SwVbaColumn::SelectColumn( getCurrentWordDoc(mxContext), mxTextTable, mnStartColumnIndex, mnEndColumnIndex );
+}
+
+::sal_Int32 SAL_CALL SwVbaColumns::getCount() throw (uno::RuntimeException)
+{
+ return ( mnEndColumnIndex - mnStartColumnIndex + 1 );
+}
+
+uno::Any SAL_CALL SwVbaColumns::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ if( ( Index1 >>= nIndex ) == sal_True )
+ {
+ if( nIndex <= 0 || nIndex > getCount() )
+ {
+ throw lang::IndexOutOfBoundsException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+ }
+ return uno::makeAny( uno::Reference< word::XColumn >( new SwVbaColumn( this, mxContext, mxTextTable, nIndex - 1 ) ) );
+ }
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaColumns::getElementType() throw (uno::RuntimeException)
+{
+ return word::XColumn::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaColumns::createEnumeration() throw (uno::RuntimeException)
+{
+ return new ColumnsEnumWrapper( this, mxContext, mxTextTable );
+}
+
+uno::Any
+SwVbaColumns::createCollectionObject( const uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaColumns::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaColumns") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+SwVbaColumns::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Columns") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbacolumns.hxx b/sw/source/ui/vba/vbacolumns.hxx
new file mode 100644
index 000000000000..f6f14ea098e3
--- /dev/null
+++ b/sw/source/ui/vba/vbacolumns.hxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_COLUMNS_HXX
+#define SW_VBA_COLUMNS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XColumns.hpp>
+#include <ooo/vba/word/XColumn.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/table/XTableColumns.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XColumns > SwVbaColumns_BASE;
+
+class SwVbaColumns : public SwVbaColumns_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ css::uno::Reference< css::table::XTableColumns > mxTableColumns;
+ sal_Int32 mnStartColumnIndex;
+ sal_Int32 mnEndColumnIndex;
+
+private:
+ css::uno::Reference< ooo::vba::word::XColumn > getColumnAtIndex( sal_Int32 index ) throw (css::uno::RuntimeException);
+
+public:
+ SwVbaColumns( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableColumns >& xTableColumns ) throw ( css::uno::RuntimeException );
+ SwVbaColumns( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableColumns >& xTableColumns, sal_Int32 nStartCol, sal_Int32 nEndCol ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaColumns() {}
+
+ virtual sal_Int32 SAL_CALL getWidth( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+
+ //XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException );
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaColumns_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_COLUMNS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadialog.cxx b/sw/source/ui/vba/vbadialog.cxx
index a62fd289ca5d..14f9a40da019 100644
--- a/sw/source/ui/vba/vbadialog.cxx
+++ b/sw/source/ui/vba/vbadialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ SwVbaDialog::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadialog.hxx b/sw/source/ui/vba/vbadialog.hxx
index 591c77bdb41c..763fc192cb04 100644
--- a/sw/source/ui/vba/vbadialog.hxx
+++ b/sw/source/ui/vba/vbadialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ public:
};
#endif /* SW_VBA_DIALOG_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadialogs.cxx b/sw/source/ui/vba/vbadialogs.cxx
index f81e66dd5488..3bebd662e0cf 100644
--- a/sw/source/ui/vba/vbadialogs.cxx
+++ b/sw/source/ui/vba/vbadialogs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ SwVbaDialogs::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadialogs.hxx b/sw/source/ui/vba/vbadialogs.hxx
index 075849c18a98..7895bbb385ea 100644
--- a/sw/source/ui/vba/vbadialogs.hxx
+++ b/sw/source/ui/vba/vbadialogs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,5 @@ public:
};
#endif /* SW_VBA_DIALOGS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index cef47c7e32dc..8c7e60e549fb 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,10 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/document/XRedlinesSupplier.hpp>
#include <ooo/vba/XControlProvider.hpp>
+#include <ooo/vba/word/WdProtectionType.hpp>
#include <vbahelper/helperdecl.hxx>
#include <wordvbahelper.hxx>
@@ -50,7 +52,14 @@
#include "vbafield.hxx"
#include "vbapagesetup.hxx"
#include "vbasections.hxx"
+#include "vbatablesofcontents.hxx"
#include <vbahelper/vbashapes.hxx>
+#include <vbahelper/vbahelper.hxx>
+#include "vbarevisions.hxx"
+#include "vbaframes.hxx"
+#include "vbaformfields.hxx"
+#include <osl/file.hxx>
+#include <tools/urlobj.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -200,7 +209,6 @@ uno::Any SAL_CALL
SwVbaDocument::Shapes( const uno::Any& index ) throw (uno::RuntimeException)
{
uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getModel(), uno::UNO_QUERY_THROW );
- //uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
uno::Reference< XCollection > xCol( new ScVbaShapes( this, mxContext, xIndexAccess, xModel ) );
@@ -220,6 +228,22 @@ SwVbaDocument::Sections( const uno::Any& index ) throw (uno::RuntimeException)
}
uno::Any SAL_CALL
+SwVbaDocument::TablesOfContents( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCollection > xCol( new SwVbaTablesOfContents( this, mxContext, mxTextDocument ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
+SwVbaDocument::FormFields( const uno::Any& /*index*/ ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCollection > xCol;
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
SwVbaDocument::PageSetup( ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xPageProps( word::getCurrentPageStyle( mxModel ), uno::UNO_QUERY_THROW );
@@ -239,16 +263,34 @@ SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException)
uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- rtl::OUString sTemplateName = xDocProps->getTemplateName();
+ rtl::OUString sTemplateUrl = xDocProps->getTemplateURL();
- xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateName );
+ xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateUrl );
return uno::makeAny( xTemplate );
}
void SAL_CALL
-SwVbaDocument::setAttachedTemplate( const css::uno::Any& /*_attachedtemplate*/ ) throw (uno::RuntimeException)
+SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException();
+ rtl::OUString sTemplate;
+ if( !( _attachedtemplate >>= sTemplate ) )
+ {
+ throw uno::RuntimeException();
+ }
+ rtl::OUString aURL;
+ INetURLObject aObj;
+ aObj.SetURL( sTemplate );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ if ( bIsURL )
+ aURL = sTemplate;
+ else
+ osl::FileBase::getFileURLFromSystemPath( sTemplate, aURL );
+
+ uno::Reference< word::XTemplate > xTemplate;
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+ xDocProps->setTemplateURL( aURL );
}
uno::Any SAL_CALL
@@ -267,6 +309,116 @@ void SAL_CALL SwVbaDocument::Activate() throw (uno::RuntimeException)
VbaDocumentBase::Activate();
}
+::sal_Int32 SAL_CALL SwVbaDocument::getProtectionType() throw (css::uno::RuntimeException)
+{
+ //TODO
+ return word::WdProtectionType::wdNoProtection;
+}
+
+void SAL_CALL SwVbaDocument::setProtectionType( ::sal_Int32 /*_protectiontype*/ ) throw (css::uno::RuntimeException)
+{
+ //TODO
+}
+
+::sal_Bool SAL_CALL SwVbaDocument::getUpdateStylesOnOpen() throw (css::uno::RuntimeException)
+{
+ //TODO
+ return sal_False;
+}
+
+void SAL_CALL SwVbaDocument::setUpdateStylesOnOpen( ::sal_Bool /*_updatestylesonopen*/ ) throw (uno::RuntimeException)
+{
+ //TODO
+}
+
+::sal_Bool SAL_CALL SwVbaDocument::getAutoHyphenation() throw (uno::RuntimeException)
+{
+ // check this property only in default paragraph style
+ sal_Bool IsAutoHyphenation = sal_False;
+ uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW );
+ xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsHyphenation")) ) >>= IsAutoHyphenation;
+ return IsAutoHyphenation;
+}
+
+void SAL_CALL SwVbaDocument::setAutoHyphenation( ::sal_Bool _autohyphenation ) throw (uno::RuntimeException)
+{
+ //TODO
+ uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW );
+ xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsHyphenation")), uno::makeAny( _autohyphenation ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaDocument::getHyphenationZone() throw (uno::RuntimeException)
+{
+ //TODO
+ return 0;
+}
+
+void SAL_CALL SwVbaDocument::setHyphenationZone( ::sal_Int32 /*_hyphenationzone*/ ) throw (uno::RuntimeException)
+{
+ //TODO
+}
+
+::sal_Int32 SAL_CALL SwVbaDocument::getConsecutiveHyphensLimit() throw (uno::RuntimeException)
+{
+ //TODO
+ sal_Int16 nHyphensLimit = 0;
+ uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW );
+ xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaHyphenationMaxHyphens")) ) >>= nHyphensLimit;
+ return nHyphensLimit;
+}
+
+void SAL_CALL SwVbaDocument::setConsecutiveHyphensLimit( ::sal_Int32 _consecutivehyphenslimit ) throw (uno::RuntimeException)
+{
+ sal_Int16 nHyphensLimit = static_cast< sal_Int16 >( _consecutivehyphenslimit );
+ uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW );
+ xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaHyphenationMaxHyphens")), uno::makeAny( nHyphensLimit ) );
+}
+
+void SAL_CALL SwVbaDocument::Protect( ::sal_Int32 /*Type*/, const uno::Any& /*NOReset*/, const uno::Any& /*Password*/, const uno::Any& /*UseIRM*/, const uno::Any& /*EnforceStyleLock*/ ) throw (uno::RuntimeException)
+{
+ // Seems not support in Writer
+ // VbaDocumentBase::Protect( Password );
+}
+
+void SAL_CALL SwVbaDocument::PrintOut( const uno::Any& /*Background*/, const uno::Any& /*Append*/, const uno::Any& /*Range*/, const uno::Any& /*OutputFileName*/, const uno::Any& /*From*/, const uno::Any& /*To*/, const uno::Any& /*Item*/, const uno::Any& /*Copies*/, const uno::Any& /*Pages*/, const uno::Any& /*PageType*/, const uno::Any& /*PrintToFile*/, const uno::Any& /*Collate*/, const uno::Any& /*FileName*/, const uno::Any& /*ActivePrinterMacGX*/, const uno::Any& /*ManualDuplexPrint*/, const uno::Any& /*PrintZoomColumn*/, const uno::Any& /*PrintZoomRow*/, const uno::Any& /*PrintZoomPaperWidth*/, const uno::Any& /*PrintZoomPaperHeight*/ ) throw (uno::RuntimeException)
+{
+ //TODO
+}
+
+void SAL_CALL SwVbaDocument::PrintPreview( ) throw (uno::RuntimeException)
+{
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrintPreview"));
+ dispatchRequests( mxModel,url );
+}
+
+void SAL_CALL SwVbaDocument::ClosePrintPreview( ) throw (uno::RuntimeException)
+{
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ClosePreview"));
+ dispatchRequests( mxModel,url );
+}
+
+uno::Any SAL_CALL
+SwVbaDocument::Revisions( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaRevisions( this, mxContext, getModel(), xRedlines ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
+SwVbaDocument::Frames( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextFramesSupplier > xTextFramesSupp( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xFrames( xTextFramesSupp->getTextFrames(), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaFrames( this, mxContext, xFrames, getModel() ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
uno::Any
SwVbaDocument::getControlShape( const ::rtl::OUString& sName )
{
@@ -379,3 +531,4 @@ extern sdecl::ServiceDecl const serviceDecl(
"ooo.vba.word.Document" );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx
index ab87798a8ded..f5fbbcb6cf39 100644
--- a/sw/source/ui/vba/vbadocument.hxx
+++ b/sw/source/ui/vba/vbadocument.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,6 +66,26 @@ public:
virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL PageSetup() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL TablesOfContents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL FormFields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getProtectionType() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setProtectionType( ::sal_Int32 _protectiontype ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getUpdateStylesOnOpen() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setUpdateStylesOnOpen( ::sal_Bool _updatestylesonopen ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAutoHyphenation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAutoHyphenation( ::sal_Bool _autohyphenation ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHyphenationZone() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHyphenationZone( ::sal_Int32 _hyphenationzone ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getConsecutiveHyphensLimit() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setConsecutiveHyphensLimit( ::sal_Int32 _consecutivehyphenslimit ) throw (css::uno::RuntimeException);
+ using VbaDocumentBase::Protect;
+ virtual void SAL_CALL Protect( ::sal_Int32 Type, const css::uno::Any& NOReset, const css::uno::Any& Password, const css::uno::Any& UseIRM, const css::uno::Any& EnforceStyleLock ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL PrintOut( const css::uno::Any& Background, const css::uno::Any& Append, const css::uno::Any& Range, const css::uno::Any& OutputFileName, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Item, const css::uno::Any& Copies, const css::uno::Any& Pages, const css::uno::Any& PageType, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& FileName, const css::uno::Any& ActivePrinterMacGX, const css::uno::Any& ManualDuplexPrint, const css::uno::Any& PrintZoomColumn, const css::uno::Any& PrintZoomRow, const css::uno::Any& PrintZoomPaperWidth, const css::uno::Any& PrintZoomPaperHeight ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL PrintPreview( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ClosePrintPreview( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Frames( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+
// XInvocation
virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
@@ -78,3 +99,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_DOCUMENT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index d68df940810b..963fca41fb7d 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,7 +136,6 @@ public:
{
// Characters, ParagraphCount & WordCount are available from
// the model ( and addtionally these also update the statics object )
- //return mxProps->getPropertyValue( rPropName );
return mxModelProps->getPropertyValue( rPropName );
}
catch( uno::Exception& )
@@ -203,16 +203,16 @@ public:
static DocPropInfo createDocPropInfo( const rtl::OUString& sDesc, const rtl::OUString& sPropName, boost::shared_ptr< PropertGetSetHelper >& rHelper )
{
- return createDocPropInfo( rtl::OUStringToOString( sDesc, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sPropName, RTL_TEXTENCODING_UTF8 ).getStr(), rHelper );
+ DocPropInfo aItem;
+ aItem.msMSODesc = sDesc;
+ aItem.msOOOPropName = sPropName;
+ aItem.mpPropGetSetHelper = rHelper;
+ return aItem;
}
static DocPropInfo createDocPropInfo( const sal_Char* sDesc, const sal_Char* sPropName, boost::shared_ptr< PropertGetSetHelper >& rHelper )
{
- DocPropInfo aItem;
- aItem.msMSODesc = rtl::OUString::createFromAscii( sDesc );
- aItem.msOOOPropName = rtl::OUString::createFromAscii( sPropName );
- aItem.mpPropGetSetHelper = rHelper;
- return aItem;
+ return createDocPropInfo( rtl::OUString::createFromAscii( sDesc ), rtl::OUString::createFromAscii( sPropName ), rHelper );
}
uno::Any getValue()
{
@@ -236,7 +236,7 @@ public:
};
-typedef std::hash_map< sal_Int32, DocPropInfo > MSOIndexToOODocPropInfo;
+typedef boost::unordered_map< sal_Int32, DocPropInfo > MSOIndexToOODocPropInfo;
class BuiltInIndexHelper
{
@@ -305,7 +305,7 @@ public:
virtual rtl::OUString SAL_CALL getLinkSource( ) throw (script::BasicErrorException, uno::RuntimeException);
virtual void SAL_CALL setLinkSource( const rtl::OUString& LinkSource ) throw (script::BasicErrorException, uno::RuntimeException);
//XDefaultProperty
- virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException) { return rtl::OUString::createFromAscii("Value"); }
+ virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException) { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual uno::Sequence<rtl::OUString> getServiceNames();
@@ -482,7 +482,7 @@ typedef ::cppu::WeakImplHelper3< com::sun::star::container::XIndexAccess
,com::sun::star::container::XEnumerationAccess
> PropertiesImpl_BASE;
-typedef std::hash_map< sal_Int32, uno::Reference< XDocumentProperty > > DocProps;
+typedef boost::unordered_map< sal_Int32, uno::Reference< XDocumentProperty > > DocProps;
typedef ::cppu::WeakImplHelper1< com::sun::star::container::XEnumeration > DocPropEnumeration_BASE;
class DocPropEnumeration : public DocPropEnumeration_BASE
@@ -504,7 +504,7 @@ public:
}
};
-typedef std::hash_map< rtl::OUString, uno::Reference< XDocumentProperty >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > DocPropsByName;
+typedef boost::unordered_map< rtl::OUString, uno::Reference< XDocumentProperty >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > DocPropsByName;
class BuiltInPropertiesImpl : public PropertiesImpl_BASE
{
@@ -762,3 +762,5 @@ SwVbaCustomDocumentProperties::getServiceImplName()
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCustomDocumentProperties") );
return sImplName;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocumentproperties.hxx b/sw/source/ui/vba/vbadocumentproperties.hxx
index 5159ea580601..3f9a6c193741 100644
--- a/sw/source/ui/vba/vbadocumentproperties.hxx
+++ b/sw/source/ui/vba/vbadocumentproperties.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <ooo/vba/XDocumentProperties.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <vbahelper/vbacollectionimpl.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
typedef CollTestImplHelper< ov::XDocumentProperties > SwVbaDocumentproperties_BASE;
@@ -65,3 +66,5 @@ public:
};
#endif /* SW_VBA_DOCUMENTPROPERTY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index 195adb2ffca4..3c977f654ccd 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,7 @@
#include "vbadocuments.hxx"
#include <vbahelper/vbahelper.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <osl/file.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -176,3 +177,5 @@ SwVbaDocuments::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbadocuments.hxx b/sw/source/ui/vba/vbadocuments.hxx
index dc0f75543979..050817e7f95f 100644
--- a/sw/source/ui/vba/vbadocuments.hxx
+++ b/sw/source/ui/vba/vbadocuments.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ public:
};
#endif /* SW_VBA_DOCUMENTS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx
index 197f02911e49..e7f4ec236625 100755..100644
--- a/sw/source/ui/vba/vbaeventshelper.cxx
+++ b/sw/source/ui/vba/vbaeventshelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,5 @@ extern sdecl::ServiceDecl const serviceDecl(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaeventshelper.hxx b/sw/source/ui/vba/vbaeventshelper.hxx
index 044eaa33885e..3c291a78b402 100755..100644
--- a/sw/source/ui/vba/vbaeventshelper.hxx
+++ b/sw/source/ui/vba/vbaeventshelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 1b4fc953b04d..0ff4295a1218 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <ooo/vba/word/WdFieldType.hpp>
#include <com/sun/star/text/FilenameDisplayFormat.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
#include <swtypes.hxx>
using namespace ::ooo::vba;
@@ -45,6 +47,17 @@ SwVbaField::SwVbaField( const uno::Reference< ooo::vba::XHelperInterface >& rPa
mxTextField.set( xTextField, uno::UNO_QUERY_THROW );
}
+sal_Bool SAL_CALL SwVbaField::Update() throw (uno::RuntimeException)
+{
+ uno::Reference< util::XUpdatable > xUpdatable( mxTextField, uno::UNO_QUERY );
+ if( xUpdatable.is() )
+ {
+ xUpdatable->update();
+ return sal_True;
+ }
+ return sal_False;
+}
+
// XHelperInterface
rtl::OUString&
SwVbaField::getServiceImplName()
@@ -113,13 +126,11 @@ _ReadFieldParams::_ReadFieldParams( const String& _rData )
nFnd = nNext;
nSavPtr = nNext;
aFieldName = aData.Copy( 0, nFnd );
-// cLastChar = aData.GetChar( nSavPtr );
}
_ReadFieldParams::~_ReadFieldParams()
{
-// aData.SetChar( nSavPtr, cLastChar );
}
@@ -368,6 +379,7 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range,
{
_ReadFieldParams aReadParam(sText);
sFieldName = aReadParam.GetFieldName();
+ OSL_TRACE("SwVbaFields::Add, the field name is %s ",rtl::OUStringToOString( sFieldName, RTL_TEXTENCODING_UTF8 ).getStr() );
}
uno::Reference< text::XTextContent > xTextField;
@@ -375,6 +387,10 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range,
{
xTextField.set( Create_Field_FileName( sText ), uno::UNO_QUERY_THROW );
}
+ else if( nType == word::WdFieldType::wdFieldDocProperty || sFieldName.EqualsIgnoreCaseAscii("DOCPROPERTY") )
+ {
+ xTextField.set( Create_Field_DocProperty( sText ), uno::UNO_QUERY_THROW );
+ }
else
{
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
@@ -389,7 +405,7 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range,
uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const rtl::OUString _text ) throw (uno::RuntimeException)
{
- uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( rtl::OUString::createFromAscii("com.sun.star.text.TextField.FileName") ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.FileName")) ), uno::UNO_QUERY_THROW );
sal_Int16 nFileFormat = text::FilenameDisplayFormat::NAME_AND_EXT;
if( _text.getLength() > 0 )
{
@@ -419,6 +435,104 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const rtl
return xTextField;
}
+struct DocPropertyTable
+{
+ const char* sDocPropertyName;
+ const char* sFieldService;
+};
+
+static const DocPropertyTable aDocPropertyTables[] =
+{
+ { "Author", "com.sun.star.text.textfield.docinfo.CreateAuthor" },
+ { "Bytes", NULL },
+ { "Category", NULL },
+ { "Characters",NULL },
+ { "CharactersWithSpaces", NULL },
+ { "Comments", "com.sun.star.text.textfield.docinfo.Description" },
+ { "Company", NULL },
+ { "CreateTime", "com.sun.star.text.textfield.docinfo.CreateDateTime" },
+ { "HyperlinkBase", NULL },
+ { "Keywords", "com.sun.star.text.textfield.docinfo.Keywords" },
+ { "LastPrinted", "com.sun.star.text.textfield.docinfo.PrintDateTime" },
+ { "LastSavedBy", "com.sun.star.text.textfield.docinfo.ChangeAuthor" },
+ { "LastSavedTime", "com.sun.star.text.textfield.docinfo.ChangeDateTime" },
+ { "Lines", NULL },
+ { "Manager", NULL },
+ { "NameofApplication", NULL },
+ { "ODMADocID", NULL },
+ { "Pages", "com.sun.star.text.textfield.PageCount" },
+ { "Paragraphs", "com.sun.star.text.textfield.ParagraphCount" },
+ { "RevisionNumber", "com.sun.star.text.textfield.docinfo.Revision" },
+ { "Security", NULL },
+ { "Subject", "com.sun.star.text.textfield.docinfo.Subject" },
+ { "Template", "com.sun.star.text.textfield.TemplateName" },
+ { "Title", "com.sun.star.text.textfield.docinfo.Title" },
+ { "TotalEditingTime", "com.sun.star.text.textfield.docinfo.EditTime" },
+ { "Words", "com.sun.star.text.textfield.WordCount" },
+ { NULL, NULL }
+};
+
+uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const rtl::OUString _text ) throw (uno::RuntimeException)
+{
+ String aDocProperty;
+ _ReadFieldParams aReadParam( _text );
+ long nRet;
+ while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
+ {
+ switch( nRet )
+ {
+ case -2:
+ if( !aDocProperty.Len() )
+ aDocProperty = aReadParam.GetResult();
+ break;
+ case '*':
+ //Skip over MERGEFORMAT
+ aReadParam.SkipToNextToken();
+ break;
+ }
+ }
+ aDocProperty.EraseAllChars('"');
+ OSL_TRACE("SwVbaFields::Create_Field_DocProperty, the document property name is %s ",rtl::OUStringToOString( aDocProperty, RTL_TEXTENCODING_UTF8 ).getStr() );
+ if( aDocProperty.Len() == 0 )
+ {
+ throw uno::RuntimeException();
+ }
+
+ sal_Bool bCustom = sal_True;
+ rtl::OUString sFieldService;
+ // find the build in document properties
+ for( const DocPropertyTable* pTable = aDocPropertyTables; pTable->sDocPropertyName != NULL; pTable++ )
+ {
+ if( aDocProperty.EqualsIgnoreCaseAscii( pTable->sDocPropertyName ) )
+ {
+ if( pTable->sFieldService != NULL )
+ sFieldService = rtl::OUString::createFromAscii(pTable->sFieldService);
+ bCustom = sal_False;
+ break;
+ }
+ }
+
+ if( bCustom )
+ {
+ sFieldService = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.textfield.docinfo.Custom" ) );
+ }
+ else if( sFieldService.getLength() == 0 )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+
+ uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( sFieldService ), uno::UNO_QUERY_THROW );
+
+ if( bCustom )
+ {
+ uno::Reference< beans::XPropertySet > xProps( xTextField, uno::UNO_QUERY_THROW );
+ rtl::OUString sDocPropertyName( aDocProperty );
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ), uno::makeAny( sDocPropertyName ) );
+ }
+
+ return xTextField;
+}
+
uno::Reference< container::XEnumeration > SAL_CALL
SwVbaFields::createEnumeration() throw (uno::RuntimeException)
{
@@ -476,3 +590,4 @@ SwVbaFields::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafield.hxx b/sw/source/ui/vba/vbafield.hxx
index 3c55acf73e9d..57bdf44bb2cf 100644
--- a/sw/source/ui/vba/vbafield.hxx
+++ b/sw/source/ui/vba/vbafield.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,6 +43,7 @@ class SwVbaField : public SwVbaField_BASE
public:
SwVbaField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextField >& xTextField) throw ( css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL Update() throw ( css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
@@ -57,6 +59,7 @@ class SwVbaFields : public SwVbaFields_BASE
css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF;
private:
css::uno::Reference< css::text::XTextField > Create_Field_FileName( const rtl::OUString _text ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::text::XTextField > Create_Field_DocProperty( const rtl::OUString _text ) throw (css::uno::RuntimeException);
public:
SwVbaFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel );
@@ -75,3 +78,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx
index fccf04181993..c995527e20a6 100644
--- a/sw/source/ui/vba/vbafind.cxx
+++ b/sw/source/ui/vba/vbafind.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,13 +81,6 @@ void SwVbaFind::SetReplace( sal_Int32 type )
mnReplaceType = type;
mbReplace = sal_True;
}
-#ifdef TOMORROW
-rtl::OUString SwVbaFind::ReplaceWildcards( const rtl::OUString& /*rText*/ ) throw ( uno::RuntimeException )
-{
- // TODO:
- return rtl::OUString();
-}
-#endif
uno::Reference< text::XTextRange > SwVbaFind::FindOneElement() throw ( uno::RuntimeException )
{
uno::Reference< text::XTextRange > xFoundOne;
@@ -426,3 +420,4 @@ SwVbaFind::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafind.hxx b/sw/source/ui/vba/vbafind.hxx
index ef971866500d..41c256391e4a 100644
--- a/sw/source/ui/vba/vbafind.hxx
+++ b/sw/source/ui/vba/vbafind.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,9 +59,6 @@ private:
void SetReplace( sal_Int32 type );
void SetReplaceWith( const rtl::OUString& rText ) throw ( css::uno::RuntimeException );
rtl::OUString GetReplaceWith() throw ( css::uno::RuntimeException );
-#ifdef TOMORROW
- rtl::OUString ReplaceWildcards( const rtl::OUString& rText ) throw ( css::uno::RuntimeException );
-#endif
css::uno::Reference< css::text::XTextRange > FindOneElement() throw ( css::uno::RuntimeException );
sal_Bool SearchReplace() throw ( css::uno::RuntimeException );
@@ -101,3 +99,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_FIND_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx
index 47f39bcbefda..89ce1801c334 100644
--- a/sw/source/ui/vba/vbafont.cxx
+++ b/sw/source/ui/vba/vbafont.cxx
@@ -1,7 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "vbafont.hxx"
#include <com/sun/star/awt/FontUnderline.hpp>
#include <ooo/vba/word/WdUnderline.hpp>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
+#include <sal/macros.h>
#include <ooo/vba/word/WdColorIndex.hpp>
using namespace ::ooo::vba;
@@ -37,7 +39,7 @@ static MapPair UnderLineTable[] = {
{ word::WdUnderline::wdUnderlineDashLongHeavy, com::sun::star::awt::FontUnderline::BOLDLONGDASH },
};
-typedef std::hash_map< sal_Int32, sal_Int32 > ConstToConst;
+typedef boost::unordered_map< sal_Int32, sal_Int32 > ConstToConst;
class UnderLineMapper
{
ConstToConst MSO2OOO;
@@ -45,7 +47,7 @@ class UnderLineMapper
private:
UnderLineMapper()
{
- sal_Int32 nLen = sizeof( UnderLineTable )/ sizeof( UnderLineTable[0] );
+ sal_Int32 nLen = SAL_N_ELEMENTS( UnderLineTable );
for ( sal_Int32 index=0; index<nLen; ++index )
{
@@ -214,3 +216,4 @@ SwVbaFont::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbafont.hxx b/sw/source/ui/vba/vbafont.hxx
index 1500c2a314dd..2e42936c345e 100644
--- a/sw/source/ui/vba/vbafont.hxx
+++ b/sw/source/ui/vba/vbafont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef VBA_FONT_HXX
#define VBA_FONT_HXX
@@ -29,3 +30,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaformfield.cxx b/sw/source/ui/vba/vbaformfield.cxx
new file mode 100644
index 000000000000..ed6bf39a6018
--- /dev/null
+++ b/sw/source/ui/vba/vbaformfield.cxx
@@ -0,0 +1,138 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbaformfield.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <ecmaflds.hxx>
+#include "vbacheckbox.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaFormField::SwVbaFormField( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& rModel, const uno::Reference< text::XFormField >& xFormField ) throw ( uno::RuntimeException ) : SwVbaFormField_BASE( rParent, rContext ), mxModel( rModel ), mxFormField( xFormField )
+{
+}
+
+SwVbaFormField::~SwVbaFormField()
+{
+}
+
+rtl::OUString SAL_CALL SwVbaFormField::getResult() throw ( uno::RuntimeException )
+{
+ rtl::OUString sResult;
+ rtl::OUString sType = mxFormField->getFieldType();
+ if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) )
+ {
+ uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor();
+ sResult = xTextRange->getString();
+ }
+ else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) )
+ {
+ sal_Int32 nValue = 0;
+ sal_Int32 nCount = mxFormField->getParamCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ if( mxFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX_CHECKED ) )
+ {
+ if( mxFormField->getParamValue(i).equalsIgnoreAsciiCaseAscii("on") )
+ nValue = 1;
+ else
+ nValue = 0;
+ break;
+ }
+
+ }
+ sResult = rtl::OUString::valueOf( nValue );
+ }
+ else
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ return sResult;
+}
+
+void SAL_CALL SwVbaFormField::setResult( const rtl::OUString& result ) throw ( uno::RuntimeException )
+{
+ rtl::OUString sType = mxFormField->getFieldType();
+ if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) )
+ {
+ uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor();
+ xTextRange->setString( result );
+ }
+ else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) )
+ {
+ // do nothing
+ }
+ else
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+}
+
+sal_Bool SAL_CALL SwVbaFormField::getEnabled() throw ( uno::RuntimeException )
+{
+ //allways return true
+ return sal_True;
+}
+
+void SAL_CALL SwVbaFormField::setEnabled( sal_Bool/* enabled */ ) throw ( uno::RuntimeException )
+{
+ // not support in Writer
+}
+
+uno::Any SAL_CALL SwVbaFormField::CheckBox() throw ( uno::RuntimeException )
+{
+ return uno::makeAny( uno::Reference< word::XCheckBox >( new SwVbaCheckBox( this, mxContext, mxModel, mxFormField ) ) );
+}
+
+rtl::OUString&
+SwVbaFormField::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFormField") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaFormField::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.FormField" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaformfield.hxx b/sw/source/ui/vba/vbaformfield.hxx
new file mode 100644
index 000000000000..00ba837443cb
--- /dev/null
+++ b/sw/source/ui/vba/vbaformfield.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_FORMFIELD_HXX
+#define SW_VBA_FORMFIELD_HXX
+
+#include <ooo/vba/word/XFormField.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XFormField.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFormField > SwVbaFormField_BASE;
+
+class SwVbaFormField : public SwVbaFormField_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::text::XFormField > mxFormField;
+
+public:
+ SwVbaFormField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XFormField >& xFormField ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaFormField();
+
+ // Methods
+ rtl::OUString SAL_CALL getResult() throw ( css::uno::RuntimeException );
+ void SAL_CALL setResult( const rtl::OUString& result ) throw ( css::uno::RuntimeException );
+ sal_Bool SAL_CALL getEnabled() throw ( css::uno::RuntimeException );
+ void SAL_CALL setEnabled( sal_Bool enabled ) throw ( css::uno::RuntimeException );
+ css::uno::Any SAL_CALL CheckBox() throw ( css::uno::RuntimeException );
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_FORMFIELD_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaformfields.cxx b/sw/source/ui/vba/vbaformfields.cxx
new file mode 100644
index 000000000000..43c8e3cd5efa
--- /dev/null
+++ b/sw/source/ui/vba/vbaformfields.cxx
@@ -0,0 +1,205 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbaformfields.hxx"
+#include "vbaformfield.hxx"
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include "wordvbahelper.hxx"
+#include <cppuhelper/implbase3.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+typedef std::vector< uno::Reference< text::XFormField > > XFormFieldVec;
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > FormFiledEnumeration_BASE;
+typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > FormFieldCollectionHelper_BASE;
+
+rtl::OUString lcl_getFormFieldName( const uno::Reference< text::XFormField >& xFormField )
+{
+ rtl::OUString sName;
+ sal_Int32 nCount = xFormField->getParamCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ if( xFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( "Name" ) )
+ {
+ sName = xFormField->getParamValue(i);
+ OSL_TRACE("lcl_getFormFieldName: %s", rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ break;
+ }
+ }
+ return sName;
+}
+
+class FormFieldsEnumeration : public FormFiledEnumeration_BASE
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< frame::XModel > mxModel;
+ XFormFieldVec mxFormFields;
+ XFormFieldVec::iterator cachePos;
+public:
+ FormFieldsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const XFormFieldVec& xFormFiels ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxFormFields( xFormFiels ), cachePos( mxFormFields.begin() )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( cachePos != mxFormFields.end() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasMoreElements() )
+ throw container::NoSuchElementException();
+ uno::Reference< text::XFormField > xFormField( *cachePos++ );
+ return uno::makeAny( uno::Reference< word::XFormField > ( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) );
+ }
+
+};
+
+class FormFieldCollectionHelper : public FormFieldCollectionHelper_BASE
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< frame::XModel > mxModel;
+ XFormFieldVec mxFormFields;
+ XFormFieldVec::iterator cachePos;
+public:
+ FormFieldCollectionHelper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel )
+ {
+ uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( xModel,uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndexAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW );
+ sal_Int32 nCount = xIndexAccess->getCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ uno::Reference< text::XFormField > xFormField( xIndexAccess->getByIndex( i ), uno::UNO_QUERY );
+ if( xFormField.is() )
+ mxFormFields.push_back( xFormField );
+ }
+ cachePos = mxFormFields.begin();
+ }
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return word::XFormField::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0 ; }
+ // XNameAcess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasByName(aName) )
+ throw container::NoSuchElementException();
+ uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) );
+ }
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > sNames( mxFormFields.size() );
+ rtl::OUString* pString = sNames.getArray();
+ XFormFieldVec::iterator it = mxFormFields.begin();
+ XFormFieldVec::iterator it_end = mxFormFields.end();
+ for ( ; it != it_end; ++it, ++pString )
+ {
+ uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
+ *pString = lcl_getFormFieldName( xFormField );
+ }
+ return sNames;
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+ {
+ cachePos = mxFormFields.begin();
+ XFormFieldVec::iterator it_end = mxFormFields.end();
+ for ( ; cachePos != it_end; ++cachePos )
+ {
+ //uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
+ if ( aName.equalsIgnoreAsciiCase( lcl_getFormFieldName( xFormField )) )
+ break;
+ }
+ return ( cachePos != it_end );
+ }
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return mxFormFields.size();
+ }
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, mxFormFields[ Index ] ) ) );
+ }
+ // XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new FormFieldsEnumeration( mxParent, mxContext, mxModel, mxFormFields );
+ }
+};
+
+SwVbaFormFields::SwVbaFormFields( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ): SwVbaFormFields_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new FormFieldCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel )
+{
+}
+// XEnumerationAccess
+uno::Type
+SwVbaFormFields::getElementType() throw (uno::RuntimeException)
+{
+ return word::XFormField::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaFormFields::createEnumeration() throw (uno::RuntimeException)
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
+ return xEnumAccess->createEnumeration();
+}
+
+uno::Any
+SwVbaFormFields::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaFormFields::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFormFields") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaFormFields::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.FormFields") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaformfields.hxx b/sw/source/ui/vba/vbaformfields.hxx
new file mode 100644
index 000000000000..335fceb74379
--- /dev/null
+++ b/sw/source/ui/vba/vbaformfields.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_FORMFIELDS_HXX
+#define SW_VBA_FORMFIELDS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XFormFields.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XBookmarksSupplier.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XFormFields > SwVbaFormFields_BASE;
+
+class SwVbaFormFields : public SwVbaFormFields_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+
+public:
+ SwVbaFormFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel );
+ virtual ~SwVbaFormFields() {}
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaFormFields_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_FORMFIELDS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaframe.cxx b/sw/source/ui/vba/vbaframe.cxx
new file mode 100644
index 000000000000..04d13a09674c
--- /dev/null
+++ b/sw/source/ui/vba/vbaframe.cxx
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbaframe.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaFrame::SwVbaFrame( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< frame::XModel >& rModel, const css::uno::Reference< text::XTextFrame >& xTextFrame ) throw ( css::uno::RuntimeException ) :
+ SwVbaFrame_BASE( rParent, rContext ), mxModel( rModel ), mxTextFrame( xTextFrame )
+{
+}
+
+SwVbaFrame::~SwVbaFrame()
+{
+}
+
+void SAL_CALL SwVbaFrame::Select() throw ( uno::RuntimeException )
+{
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( mxModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelectSupp->select( uno::makeAny( mxTextFrame ) );
+}
+
+rtl::OUString&
+SwVbaFrame::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFrame") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaFrame::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Frame" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaframe.hxx b/sw/source/ui/vba/vbaframe.hxx
new file mode 100644
index 000000000000..745d5f2096c0
--- /dev/null
+++ b/sw/source/ui/vba/vbaframe.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_FRAME_HXX
+#define SW_VBA_FRAME_HXX
+
+#include <ooo/vba/word/XFrame.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextFrame.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFrame > SwVbaFrame_BASE;
+
+class SwVbaFrame : public SwVbaFrame_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::text::XTextFrame > mxTextFrame;
+
+public:
+ SwVbaFrame( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XTextFrame >& xTextFrame ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaFrame();
+
+ // Methods
+ virtual void SAL_CALL Select() throw ( css::uno::RuntimeException );
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_FRAME_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaframes.cxx b/sw/source/ui/vba/vbaframes.cxx
new file mode 100644
index 000000000000..e3aba63cfb02
--- /dev/null
+++ b/sw/source/ui/vba/vbaframes.cxx
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbaframes.hxx"
+#include "vbaframe.hxx"
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include "wordvbahelper.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > FramesEnumeration_Base;
+class FramesEnumeration : public FramesEnumeration_Base
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< container::XIndexAccess> mxIndexAccess;
+ uno::Reference< frame::XModel > mxModel;
+ sal_Int32 nCurrentPos;
+public:
+ FramesEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : mxParent( xParent ), mxContext( xContext), mxIndexAccess( xIndexAccess ), mxModel( xModel ), nCurrentPos(0)
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nCurrentPos < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasMoreElements() )
+ throw container::NoSuchElementException();
+ uno::Reference< text::XTextFrame > xTextFrame( mxIndexAccess->getByIndex( nCurrentPos++ ), uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XFrame > ( new SwVbaFrame( mxParent, mxContext, mxModel, xTextFrame ) ) );
+ }
+
+};
+
+SwVbaFrames::SwVbaFrames( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xFrames, const uno::Reference< frame::XModel >& xModel ): SwVbaFrames_BASE( xParent, xContext, xFrames ), mxModel( xModel )
+{
+ mxFramesSupplier.set( mxModel, uno::UNO_QUERY_THROW );
+}
+// XEnumerationAccess
+uno::Type
+SwVbaFrames::getElementType() throw (uno::RuntimeException)
+{
+ return word::XFrame::static_type(0);
+}
+
+uno::Reference< container::XEnumeration >
+SwVbaFrames::createEnumeration() throw (uno::RuntimeException)
+{
+ return new FramesEnumeration( this, mxContext,m_xIndexAccess, mxModel );
+}
+
+uno::Any
+SwVbaFrames::createCollectionObject( const css::uno::Any& aSource )
+{
+ uno::Reference< text::XTextFrame > xTextFrame( aSource, uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XFrame > ( new SwVbaFrame( this, mxContext, mxModel, xTextFrame ) ) );
+}
+
+rtl::OUString&
+SwVbaFrames::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFrames") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaFrames::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Frames") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaframes.hxx b/sw/source/ui/vba/vbaframes.hxx
new file mode 100644
index 000000000000..38015fd47c44
--- /dev/null
+++ b/sw/source/ui/vba/vbaframes.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_FRAMES_HXX
+#define SW_VBA_FRAMES_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XFrames.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XFrames > SwVbaFrames_BASE;
+
+class SwVbaFrames : public SwVbaFrames_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::text::XTextFramesSupplier > mxFramesSupplier;
+
+public:
+ SwVbaFrames( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xFrames, const css::uno::Reference< css::frame::XModel >& xModel );
+ virtual ~SwVbaFrames() {}
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaFrames_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+};
+
+#endif /* SW_VBA_FRAMES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx
index b95c5e5c9e3d..19ba048b1426 100644
--- a/sw/source/ui/vba/vbaglobals.cxx
+++ b/sw/source/ui/vba/vbaglobals.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +27,7 @@
************************************************************************/
#include <vbahelper/helperdecl.hxx>
#include "vbaglobals.hxx"
-
+#include <sal/macros.h>
#include <comphelper/unwrapargs.hxx>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -49,7 +50,7 @@ SwVbaGlobals::SwVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Refere
{
OSL_TRACE("SwVbaGlobals::SwVbaGlobals()");
uno::Sequence< beans::PropertyValue > aInitArgs( 2 );
- aInitArgs[ 0 ].Name = rtl::OUString::createFromAscii("Application");
+ aInitArgs[ 0 ].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Application"));
aInitArgs[ 0 ].Value = uno::makeAny( getApplication() );
aInitArgs[ 1 ].Name = sDocCtxName;
aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) );
@@ -129,6 +130,12 @@ SwVbaGlobals::Dialogs( const uno::Any& index ) throw (uno::RuntimeException)
return getApplication()->Dialogs( index );
}
+uno::Any SAL_CALL
+SwVbaGlobals::ListGalleries( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ return getApplication()->ListGalleries( index );
+}
+
uno::Reference<word::XSelection > SAL_CALL
SwVbaGlobals::getSelection() throw (uno::RuntimeException)
{
@@ -171,7 +178,7 @@ SwVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
// #FIXME #TODO make Application a proper service
// ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.word.Application" ) ),
};
- sal_Int32 nWordServices = ( sizeof( names )/ sizeof( names[0] ) );
+ sal_Int32 nWordServices = SAL_N_ELEMENTS( names );
sal_Int32 startIndex = serviceNames.getLength();
serviceNames.realloc( serviceNames.getLength() + nWordServices );
for ( sal_Int32 index = 0; index < nWordServices; ++index )
@@ -191,3 +198,4 @@ extern sdecl::ServiceDecl const serviceDecl(
"ooo.vba.word.Globals" );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx
index 9bb2e8fa606d..3ad5cf4195e4 100644
--- a/sw/source/ui/vba/vbaglobals.hxx
+++ b/sw/source/ui/vba/vbaglobals.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,6 +70,7 @@ public:
virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL ListGalleries( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException);
// XMultiServiceFactory
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException);
@@ -78,3 +80,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_GLOBALS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheaderfooter.cxx b/sw/source/ui/vba/vbaheaderfooter.cxx
index 6fb7061c573f..0a7bd993d6d3 100644
--- a/sw/source/ui/vba/vbaheaderfooter.cxx
+++ b/sw/source/ui/vba/vbaheaderfooter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,6 +82,7 @@ uno::Reference< word::XRange > SAL_CALL SwVbaHeaderFooter::getRange() throw (uno
uno::Any SAL_CALL
SwVbaHeaderFooter::Shapes( const uno::Any& index ) throw (uno::RuntimeException)
{
+ // #FIXME: only get the shapes in the current header/footer
uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxModel, uno::UNO_QUERY_THROW );
//uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
@@ -109,3 +111,4 @@ SwVbaHeaderFooter::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheaderfooter.hxx b/sw/source/ui/vba/vbaheaderfooter.hxx
index dba10ff767d8..91c18e8958d9 100644
--- a/sw/source/ui/vba/vbaheaderfooter.hxx
+++ b/sw/source/ui/vba/vbaheaderfooter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_HEADERFOOTER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.cxx b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
index 604cc1e11d8c..c1d04f6369a9 100644
--- a/sw/source/ui/vba/vbaheaderfooterhelper.cxx
+++ b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,8 +30,12 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -38,41 +43,61 @@ using namespace ::ooo::vba;
#define FIRST_PAGE 1;
// Class HeaderFooterHelper
+sal_Bool HeaderFooterHelper::isHeaderFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+{
+ return isHeaderFooter( word::getCurrentXText( xModel ) );
+}
-sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isHeaderFooter( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException)
{
- uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW );
+ rtl::OUString aImplName = xServiceInfo->getImplementationName();
+ if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) )
+ return sal_True;
+ return sal_False;
+}
- sal_Bool isOn = sal_False;
- xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn"))) >>= isOn;
- if( !isOn )
+sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+{
+ const uno::Reference< text::XText > xCurrentText = word::getCurrentXText( xModel );
+ if( !isHeaderFooter( xCurrentText ) )
return sal_False;
- sal_Bool isShared = sal_False;
- xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsShared"))) >>= isShared;
-
+ rtl::OUString aPropIsShared = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsShared") );
rtl::OUString aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderText") );
+ uno::Reference< style::XStyle > xPageStyle = word::getCurrentPageStyle( xModel );
+ uno::Reference< beans::XPropertySet > xPageProps( xPageStyle, uno::UNO_QUERY_THROW );
+ sal_Bool isShared = sal_True;
+ xPageProps->getPropertyValue( aPropIsShared ) >>= isShared;
if( !isShared )
{
+ uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
if( 0 == xPageCursor->getPage() % 2 )
- {
aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderTextLeft") );
- }
else
- {
aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderTextRight") );
- }
}
- uno::Reference< text::XText > xText( xStyleProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW );
- //FIXME: can not compare in this way?
- return ( xText == xCurrentText );
+ uno::Reference< text::XText > xHeaderText( xPageProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRangeCompare > xTRC( xHeaderText, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTR1( xCurrentText, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTR2( xHeaderText, uno::UNO_QUERY_THROW );
+ try
+ {
+ if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
+ return sal_True;
+ }
+ catch( lang::IllegalArgumentException& )
+ {
+ return sal_False;
+ }
+
+ return sal_False;
}
-sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- if( isHeader( xModel, xCurrentText ) )
+ if( isHeader( xModel ) )
{
uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
// FIXME: getPage allways returns 1
@@ -82,9 +107,9 @@ sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XMo
return sal_False;
}
-sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- if( isHeader( xModel, xCurrentText ) )
+ if( isHeader( xModel ) )
{
uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW );
sal_Bool isShared = sal_False;
@@ -98,40 +123,47 @@ sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XMo
return sal_False;
}
-sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW );
-
- sal_Bool isOn = sal_False;
- xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn"))) >>= isOn;
- if( !isOn )
+ const uno::Reference< text::XText > xCurrentText = word::getCurrentXText( xModel );
+ if( !isHeaderFooter( xCurrentText ) )
return sal_False;
- sal_Bool isShared = sal_False;
- xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsShared"))) >>= isShared;
-
+ rtl::OUString aPropIsShared = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsShared") );
rtl::OUString aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterText") );
+ uno::Reference< style::XStyle > xPageStyle = word::getCurrentPageStyle( xModel );
+ uno::Reference< beans::XPropertySet > xPageProps( xPageStyle, uno::UNO_QUERY_THROW );
+ sal_Bool isShared = sal_True;
+ xPageProps->getPropertyValue( aPropIsShared ) >>= isShared;
if( !isShared )
{
+ uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
if( 0 == xPageCursor->getPage() % 2 )
- {
aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterTextLeft") );
- }
else
- {
aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterTextRight") );
- }
}
- uno::Reference< text::XText > xText( xStyleProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XText > xFooterText( xPageProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRangeCompare > xTRC( xFooterText, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTR1( xCurrentText, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xTR2( xFooterText, uno::UNO_QUERY_THROW );
+ try
+ {
+ if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
+ return sal_True;
+ }
+ catch( lang::IllegalArgumentException& )
+ {
+ return sal_False;
+ }
- return ( xText == xCurrentText );
+ return sal_False;
}
-sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- if( isFooter( xModel, xCurrentText ) )
+ if( isFooter( xModel ) )
{
uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
sal_Int32 nPage = xPageCursor->getPage();
@@ -140,9 +172,9 @@ sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XMo
return sal_False;
}
-sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
+sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- if( isFooter( xModel, xCurrentText ) )
+ if( isFooter( xModel ) )
{
uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW );
sal_Bool isShared = sal_False;
@@ -155,22 +187,5 @@ sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XMo
}
return sal_False;
}
-#ifdef TOMORROW
-sal_Bool HeaderFooterHelper::isPrimaryHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
-{
- if( isHeader( xModel, xCurrentText ) )
- {
- return( !( isFirstPageHeader( xModel, xCurrentText ) && isEvenPagesHeader( xModel, xCurrentText ) ) );
- }
- return sal_False;
-}
-sal_Bool HeaderFooterHelper::isPrimaryFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException)
-{
- if( isHeader( xModel, xCurrentText ) )
- {
- return( !( isFirstPageFooter( xModel, xCurrentText ) && isEvenPagesFooter( xModel, xCurrentText ) ) );
- }
- return sal_False;
-}
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.hxx b/sw/source/ui/vba/vbaheaderfooterhelper.hxx
index fd29a16015ab..cf5e2d7b28ef 100644
--- a/sw/source/ui/vba/vbaheaderfooterhelper.hxx
+++ b/sw/source/ui/vba/vbaheaderfooterhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,16 +37,18 @@
class HeaderFooterHelper
{
public:
- static sal_Bool isHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isFirstPageHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isEvenPagesHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isFirstPageFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isEvenPagesFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
-#ifdef TOMORROW
- static sal_Bool isPrimaryHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
- static sal_Bool isPrimaryFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException);
-#endif
+ static sal_Bool isHeaderFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isHeaderFooter( const css::uno::Reference< css::text::XText >& xText ) throw (css::uno::RuntimeException);
+ static sal_Bool isHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isFirstPageHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isEvenPagesHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isFirstPageFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isEvenPagesFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isPrimaryHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ static sal_Bool isPrimaryFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheadersfooters.cxx b/sw/source/ui/vba/vbaheadersfooters.cxx
new file mode 100644
index 000000000000..27b27569988b
--- /dev/null
+++ b/sw/source/ui/vba/vbaheadersfooters.cxx
@@ -0,0 +1,150 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbaheadersfooters.hxx"
+#include "vbaheaderfooter.hxx"
+#include <ooo/vba/word/WdHeaderFooterIndex.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+// I assume there is only one headersfooters in Writer
+typedef ::cppu::WeakImplHelper1<container::XIndexAccess > HeadersFootersIndexAccess_Base;
+class HeadersFootersIndexAccess : public HeadersFootersIndexAccess_Base
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< frame::XModel > mxModel;
+ uno::Reference< beans::XPropertySet > mxPageStyleProps;
+ sal_Bool mbHeader;
+
+public:
+ HeadersFootersIndexAccess( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xPageStyleProps, sal_Bool bHeader ) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( bHeader ) {}
+ ~HeadersFootersIndexAccess(){}
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ // first page, evenpages and primary page
+ return 3;
+ }
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( Index < 1 || Index > 3 )
+ throw container::NoSuchElementException();
+ return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( mxParent, mxContext, mxModel, mxPageStyleProps, mbHeader, Index ) ) );
+ }
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return word::XHeaderFooter::static_type(0);
+ }
+ virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return sal_True;
+ }
+};
+
+class HeadersFootersEnumWrapper : public EnumerationHelper_BASE
+{
+ SwVbaHeadersFooters* pHeadersFooters;
+ sal_Int32 nIndex;
+public:
+ HeadersFootersEnumWrapper( SwVbaHeadersFooters* _pHeadersFooters ) : pHeadersFooters( _pHeadersFooters ), nIndex( 0 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < pHeadersFooters->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex < pHeadersFooters->getCount() )
+ return pHeadersFooters->Item( uno::makeAny( ++nIndex ), uno::Any() );
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaHeadersFooters::SwVbaHeadersFooters( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xPageStyleProps, sal_Bool isHeader ): SwVbaHeadersFooters_BASE( xParent, xContext, new HeadersFootersIndexAccess( xParent, xContext, xModel, xPageStyleProps, isHeader ) ), mxModel( xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( isHeader )
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaHeadersFooters::getCount() throw (uno::RuntimeException)
+{
+ // wdHeaderFooterFirstPage, wdHeaderFooterPrimary and wdHeaderFooterEvenPages
+ return 3;
+}
+
+uno::Any SAL_CALL SwVbaHeadersFooters::Item( const uno::Any& Index1, const uno::Any& ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ Index1 >>= nIndex;
+ if( ( nIndex < 1 ) || ( nIndex > 3 ) )
+ {
+ throw container::NoSuchElementException();
+ }
+ return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, mxPageStyleProps, mbHeader, nIndex ) ) );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaHeadersFooters::getElementType() throw (uno::RuntimeException)
+{
+ return word::XHeaderFooter::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+
+SwVbaHeadersFooters::createEnumeration() throw (uno::RuntimeException)
+{
+ return new HeadersFootersEnumWrapper( this );
+}
+
+uno::Any
+SwVbaHeadersFooters::createCollectionObject( const uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaHeadersFooters::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaHeadersFooters") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+SwVbaHeadersFooters::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.HeadersFooters") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaheadersfooters.hxx b/sw/source/ui/vba/vbaheadersfooters.hxx
new file mode 100644
index 000000000000..253942b0b164
--- /dev/null
+++ b/sw/source/ui/vba/vbaheadersfooters.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_HEADERSFOOTERS_HXX
+#define SW_VBA_HEADERSFOOTERS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XHeadersFooters.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef CollTestImplHelper< ooo::vba::word::XHeadersFooters > SwVbaHeadersFooters_BASE;
+
+class SwVbaHeadersFooters : public SwVbaHeadersFooters_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::beans::XPropertySet > mxPageStyleProps;
+ sal_Bool mbHeader;
+
+public:
+ SwVbaHeadersFooters( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& xProps, sal_Bool isHeader );
+ virtual ~SwVbaHeadersFooters() {}
+
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& )throw (css::uno::RuntimeException);
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaHeadersFooters_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_HEADERSFOOTERS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx
index 317aa64c46ca..51fb2b7f9f3a 100644
--- a/sw/source/ui/vba/vbainformationhelper.cxx
+++ b/sw/source/ui/vba/vbainformationhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,5 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css
nCurrentPos = nCurrentPos + nTopMargin - ( DEFAULT_PAGE_DISTANCE + TWIP_TO_MM100( nPageHeight ) ) * ( nCurrentPage - 1 );
return Millimeter::getInPoints( nCurrentPos );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbainformationhelper.hxx b/sw/source/ui/vba/vbainformationhelper.hxx
index 6aeb8439812b..7212c5504e3b 100644
--- a/sw/source/ui/vba/vbainformationhelper.hxx
+++ b/sw/source/ui/vba/vbainformationhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,3 +42,5 @@ public:
};
#endif /* SW_VBA_INFORMATIONHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistformat.cxx b/sw/source/ui/vba/vbalistformat.cxx
new file mode 100644
index 000000000000..15eed9a8b421
--- /dev/null
+++ b/sw/source/ui/vba/vbalistformat.cxx
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalistformat.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <ooo/vba/word/WdListApplyTo.hpp>
+#include <ooo/vba/word/WdDefaultListBehavior.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "vbalisttemplate.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaListFormat::SwVbaListFormat( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextRange >& xTextRange ) throw ( uno::RuntimeException ) : SwVbaListFormat_BASE( rParent, rContext ), mxTextRange( xTextRange )
+{
+}
+
+SwVbaListFormat::~SwVbaListFormat()
+{
+}
+
+void SAL_CALL SwVbaListFormat::ApplyListTemplate( const css::uno::Reference< word::XListTemplate >& ListTemplate, const css::uno::Any& ContinuePreviousList, const css::uno::Any& ApplyTo, const css::uno::Any& DefaultListBehavior ) throw (css::uno::RuntimeException)
+{
+ sal_Bool bContinuePreviousList = sal_True;
+ if( ContinuePreviousList.hasValue() )
+ ContinuePreviousList >>= bContinuePreviousList;
+
+ // "applyto" must be current selection
+ sal_Int32 bApplyTo = word::WdListApplyTo::wdListApplyToSelection;
+ if( ApplyTo.hasValue() )
+ ApplyTo >>= bApplyTo;
+ if( bApplyTo != word::WdListApplyTo::wdListApplyToSelection )
+ throw uno::RuntimeException();
+
+ // default behaviour must be wdWord8ListBehavior
+ sal_Int32 nDefaultListBehavior = word::WdDefaultListBehavior::wdWord8ListBehavior;
+ if( DefaultListBehavior.hasValue() )
+ DefaultListBehavior >>= nDefaultListBehavior;
+ if( nDefaultListBehavior != word::WdDefaultListBehavior::wdWord8ListBehavior )
+ throw uno::RuntimeException();
+
+ SwVbaListTemplate* pListTemplate = dynamic_cast< SwVbaListTemplate* >( ListTemplate.get() );
+
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( mxTextRange, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration();
+ sal_Bool isFirstElement = sal_True;
+ while( xEnum->hasMoreElements() )
+ {
+ uno::Reference< beans::XPropertySet > xProps( xEnum->nextElement(), uno::UNO_QUERY_THROW );
+ if( isFirstElement )
+ {
+ sal_Bool isNumberingRestart = !bContinuePreviousList;
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart") ), uno::makeAny( isNumberingRestart ) );
+ if( isNumberingRestart )
+ {
+ sal_Int16 nStartValue = 1;
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue") ), uno::makeAny( nStartValue ) );
+ }
+ isFirstElement = sal_False;
+ }
+ else
+ {
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart") ), uno::makeAny( sal_False ) );
+ }
+ pListTemplate->applyListTemplate( xProps );
+ }
+}
+
+void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) throw (css::uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+}
+
+rtl::OUString&
+SwVbaListFormat::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListFormat") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaListFormat::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListFormat" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistformat.hxx b/sw/source/ui/vba/vbalistformat.hxx
new file mode 100644
index 000000000000..0483df54e02a
--- /dev/null
+++ b/sw/source/ui/vba/vbalistformat.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTFORMAT_HXX
+#define SW_VBA_LISTFORMAT_HXX
+
+#include <ooo/vba/word/XListFormat.hpp>
+#include <ooo/vba/word/XListTemplate.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextRange.hpp>
+#include "vbalisthelper.hxx"
+
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListFormat > SwVbaListFormat_BASE;
+
+class SwVbaListFormat : public SwVbaListFormat_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextRange > mxTextRange;
+
+public:
+ SwVbaListFormat( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaListFormat();
+
+ // Methods
+ virtual void SAL_CALL ApplyListTemplate( const css::uno::Reference< ::ooo::vba::word::XListTemplate >& ListTemplate, const css::uno::Any& ContinuePreviousList, const css::uno::Any& ApplyTo, const css::uno::Any& DefaultListBehavior ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ConvertNumbersToText( ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_LISTFORMAT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistgalleries.cxx b/sw/source/ui/vba/vbalistgalleries.cxx
new file mode 100644
index 000000000000..7ddd7145a6c2
--- /dev/null
+++ b/sw/source/ui/vba/vbalistgalleries.cxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalistgalleries.hxx"
+#include "vbalistgallery.hxx"
+#include <ooo/vba/word/WdListGalleryType.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class ListGalleriesEnumWrapper : public EnumerationHelper_BASE
+{
+ SwVbaListGalleries* pListGalleries;
+ sal_Int32 nIndex;
+public:
+ ListGalleriesEnumWrapper( SwVbaListGalleries* pGalleries ) : pListGalleries( pGalleries ), nIndex( 1 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex <= pListGalleries->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex <= pListGalleries->getCount() )
+ return pListGalleries->Item( uno::makeAny( nIndex++ ), uno::Any() );
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaListGalleries::SwVbaListGalleries( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc ) throw (uno::RuntimeException) : SwVbaListGalleries_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc )
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaListGalleries::getCount() throw (uno::RuntimeException)
+{
+ // 3 types of list( bullet, numbered and outline )
+ return 3;
+}
+
+uno::Any SAL_CALL SwVbaListGalleries::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ if( ( Index1 >>= nIndex ) == sal_True )
+ {
+ if( nIndex == word::WdListGalleryType::wdBulletGallery
+ || nIndex == word::WdListGalleryType::wdNumberGallery
+ || nIndex == word::WdListGalleryType::wdOutlineNumberGallery )
+ return uno::makeAny( uno::Reference< word::XListGallery >( new SwVbaListGallery( this, mxContext, mxTextDocument, nIndex ) ) );
+ }
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaListGalleries::getElementType() throw (uno::RuntimeException)
+{
+ return word::XListGallery::static_type(0);
+}
+
+uno::Reference< container::XEnumeration >
+SwVbaListGalleries::createEnumeration() throw (uno::RuntimeException)
+{
+ return new ListGalleriesEnumWrapper( this );
+}
+
+uno::Any
+SwVbaListGalleries::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaListGalleries::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListGalleries") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaListGalleries::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListGalleries") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistgalleries.hxx b/sw/source/ui/vba/vbalistgalleries.hxx
new file mode 100644
index 000000000000..a6e829783a27
--- /dev/null
+++ b/sw/source/ui/vba/vbalistgalleries.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTGALLERIES_HXX
+#define SW_VBA_LISTGALLERIES_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XListGalleries.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XListGalleries > SwVbaListGalleries_BASE;
+
+class SwVbaListGalleries : public SwVbaListGalleries_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+
+public:
+ SwVbaListGalleries( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc ) throw (css::uno::RuntimeException);
+ virtual ~SwVbaListGalleries() {}
+
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException );
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaListGalleries_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_LISTGALLERIES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistgallery.cxx b/sw/source/ui/vba/vbalistgallery.cxx
new file mode 100644
index 000000000000..016de8c7ba70
--- /dev/null
+++ b/sw/source/ui/vba/vbalistgallery.cxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalistgallery.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include "vbalisttemplates.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaListGallery::SwVbaListGallery( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw ( uno::RuntimeException ) : SwVbaListGallery_BASE( rParent, rContext ), mxTextDocument( xTextDoc ), mnType( nType )
+{
+}
+
+SwVbaListGallery::~SwVbaListGallery()
+{
+}
+
+uno::Any SAL_CALL
+SwVbaListGallery::ListTemplates( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCollection > xCol( new SwVbaListTemplates( mxParent, mxContext, mxTextDocument, mnType ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+rtl::OUString&
+SwVbaListGallery::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListGallery") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaListGallery::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListGallery" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistgallery.hxx b/sw/source/ui/vba/vbalistgallery.hxx
new file mode 100644
index 000000000000..6371e8613f5d
--- /dev/null
+++ b/sw/source/ui/vba/vbalistgallery.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTGALLERY_HXX
+#define SW_VBA_LISTGALLERY_HXX
+
+#include <ooo/vba/word/XListGallery.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListGallery > SwVbaListGallery_BASE;
+
+class SwVbaListGallery : public SwVbaListGallery_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+ sal_Int32 mnType;
+
+public:
+ SwVbaListGallery( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaListGallery();
+
+ // Methods
+ virtual css::uno::Any SAL_CALL ListTemplates( const css::uno::Any& index ) throw ( css::uno::RuntimeException );
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_LISTGALLERY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisthelper.cxx b/sw/source/ui/vba/vbalisthelper.cxx
new file mode 100644
index 000000000000..65949d650277
--- /dev/null
+++ b/sw/source/ui/vba/vbalisthelper.cxx
@@ -0,0 +1,705 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalisthelper.hxx"
+#include <tools/diagnose_ex.h>
+#include <ooo/vba/word/WdListGalleryType.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/container/XIndexReplace.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+static const sal_Int32 LIST_LEVEL_COUNT = 9;
+
+static const char WORD_BULLET_GALLERY[] = "WdBullet";
+static const char WORD_NUMBER_GALLERY[] = "WdNumber";
+static const char WORD_OUTLINE_NUMBER_GALLERY[] = "WdOutlineNumber";
+
+static const char UNO_NAME_ADJUST[] = "Adjust";
+static const char UNO_NAME_PARENT_NUMBERING[] = "ParentNumbering";
+static const char UNO_NAME_PREFIX[] = "Prefix";
+static const char UNO_NAME_SUFFIX[] = "Suffix";
+static const char UNO_NAME_CHAR_STYLE_NAME[] = "CharStyleName";
+static const char UNO_NAME_START_WITH[] = "StartWith";
+static const char UNO_NAME_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode";
+static const char UNO_NAME_LABEL_FOLLOWED_BY[] = "LabelFollowedBy";
+static const char UNO_NAME_LIST_TAB_STOP_POSITION[] = "ListtabStopPosition";
+static const char UNO_NAME_FIRST_LINE_INDENT[] = "FirstLineIndent";
+static const char UNO_NAME_INDENT_AT[] = "IndentAt";
+static const char UNO_NAME_NUMBERING_TYPE[] = "NumberingType";
+static const char UNO_NAME_BULLET_ID[] = "BulletId";
+static const char UNO_NAME_BULLET_CHAR[] = "BulletChar";
+static const char UNO_NAME_BULLET_FONT_NAME[] = "BulletFontName";
+static const char UNO_NAME_BULLET_FONT[] = "BulletFont";
+
+static const sal_Int16 CHAR_CLOSED_DOT = 8226;
+static const sal_Int16 CHAR_EMPTY_DOT = 111;
+static const sal_Int16 CHAR_SQUARE = 9632;
+static const sal_Int16 CHAR_STAR_SYMBOL = 10026;
+static const sal_Int16 CHAR_FOUR_DIAMONDS = 10070;
+static const sal_Int16 CHAR_DIAMOND = 10022;
+static const sal_Int16 CHAR_ARROW = 10146;
+static const sal_Int16 CHAR_CHECK_MARK = 10003;
+
+SwVbaListHelper::SwVbaListHelper( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw( css::uno::RuntimeException ) : mxTextDocument( xTextDoc ), mnGalleryType( nGalleryType ), mnTemplateType( nTemplateType )
+{
+ Init();
+}
+
+void SwVbaListHelper::Init() throw( css::uno::RuntimeException )
+{
+ // set the numbering style name
+ switch( mnGalleryType )
+ {
+ case word::WdListGalleryType::wdBulletGallery:
+ {
+ msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_BULLET_GALLERY ));
+ break;
+ }
+ case word::WdListGalleryType::wdNumberGallery:
+ {
+ msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_NUMBER_GALLERY ));
+ break;
+ }
+ case word::WdListGalleryType::wdOutlineNumberGallery:
+ {
+ msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_OUTLINE_NUMBER_GALLERY ));
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ msStyleName += rtl::OUString::valueOf( mnTemplateType );
+
+ // get the numbering style
+ uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxTextDocument, uno::UNO_QUERY_THROW );
+ mxStyleFamily.set( xStyleSupplier->getStyleFamilies()->getByName(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") ) ), uno::UNO_QUERY_THROW );
+ OSL_TRACE("SwVbaListHelper::Init: numbering style name: %s", rtl::OUStringToOString( msStyleName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ if( mxStyleFamily->hasByName( msStyleName ) )
+ {
+ mxStyleProps.set( mxStyleFamily->getByName( msStyleName ), uno::UNO_QUERY_THROW );
+ mxNumberingRules.set( mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) ), uno::UNO_QUERY_THROW );
+ }
+ else
+ {
+ // create new numbering style
+ uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxTextDocument, uno::UNO_QUERY_THROW );
+ mxStyleProps.set( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.NumberingStyle") ) ), uno::UNO_QUERY_THROW );
+ // insert this style into style family, or the property NumberingRules doesn't exist.
+ mxStyleFamily->insertByName( msStyleName, uno::makeAny( mxStyleProps ) );
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) ) >>= mxNumberingRules;
+
+ CreateListTemplate();
+
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( mxNumberingRules ) );
+ }
+}
+
+void SwVbaListHelper::CreateListTemplate() throw( css::uno::RuntimeException )
+{
+ switch( mnGalleryType )
+ {
+ case word::WdListGalleryType::wdBulletGallery:
+ {
+ CreateBulletListTemplate();
+ break;
+ }
+ case word::WdListGalleryType::wdNumberGallery:
+ {
+ CreateNumberListTemplate();
+ break;
+ }
+ case word::WdListGalleryType::wdOutlineNumberGallery:
+ {
+ CreateOutlineNumberListTemplate();
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+}
+
+void SwVbaListHelper::CreateBulletListTemplate() throw( css::uno::RuntimeException )
+{
+ // there is only 1 level for each bullet list in MSWord
+ sal_Int32 nLevel = 0;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ rtl::OUString sCharStyleName( RTL_CONSTASCII_USTRINGPARAM("Bullet Symbols") );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_CHAR_STYLE_NAME )), uno::makeAny( sCharStyleName ) );
+ sal_Int16 nNumberingType = style::NumberingType::CHAR_SPECIAL;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+
+ rtl::OUString aBulletChar;
+ switch( mnTemplateType )
+ {
+ case 1:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_CLOSED_DOT ) );
+ break;
+ }
+ case 2:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_EMPTY_DOT ) );
+ break;
+ }
+ case 3:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_SQUARE ) );
+ break;
+ }
+ case 4:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_STAR_SYMBOL ) );
+ break;
+ }
+ case 5:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) );
+ break;
+ }
+ case 6:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_ARROW ) );
+ break;
+ }
+ case 7:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_CHECK_MARK ) );
+ break;
+ }
+ default:
+ {
+ // we only support 7 types template now
+ throw css::uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_BULLET_CHAR )), uno::makeAny( aBulletChar ) );
+
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+}
+
+void SwVbaListHelper::CreateNumberListTemplate() throw( css::uno::RuntimeException )
+{
+ // there is only 1 level for each bullet list in MSWord
+ sal_Int32 nLevel = 0;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+
+ sal_Int16 nNumberingType = 0;
+ rtl::OUString sSuffix;
+ switch( mnTemplateType )
+ {
+ case 1:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 2:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 3:
+ {
+ nNumberingType = style::NumberingType::ROMAN_UPPER;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 4:
+ {
+ nNumberingType = style::NumberingType::CHARS_UPPER_LETTER;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 5:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 6:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 7:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ default:
+ {
+ // we only support 7 types template now
+ throw css::uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) );
+
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+}
+
+void SwVbaListHelper::CreateOutlineNumberListTemplate() throw( css::uno::RuntimeException )
+{
+ switch( mnTemplateType )
+ {
+ case 1:
+ {
+ CreateOutlineNumberForType1();
+ break;
+ }
+ case 2:
+ {
+ CreateOutlineNumberForType2();
+ break;
+ }
+ case 3:
+ {
+ CreateOutlineNumberForType3();
+ break;
+ }
+ case 4:
+ {
+ CreateOutlineNumberForType4();
+ break;
+ }
+ case 5:
+ {
+ CreateOutlineNumberForType5();
+ break;
+ }
+ case 6:
+ {
+ CreateOutlineNumberForType6();
+ break;
+ }
+ case 7:
+ {
+ CreateOutlineNumberForType7();
+ break;
+ }
+ default:
+ {
+ // we only support 7 types template now
+ throw css::uno::RuntimeException();
+ }
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType1() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = 0;
+ rtl::OUString sPrefix;
+ rtl::OUString sSuffix;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ switch( nLevel )
+ {
+ case 0:
+ case 1:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 2:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 3:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 4:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 5:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 6:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 7:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 8:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType2() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = style::NumberingType::ARABIC;
+ sal_Int16 nParentNumbering = 0;
+ rtl::OUString sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) );
+ if( nLevel != 0 )
+ {
+ nParentNumbering = sal_Int16( nLevel - 1 );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) );
+ }
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType3() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = style::NumberingType::CHAR_SPECIAL;
+ rtl::OUString sCharStyleName( RTL_CONSTASCII_USTRINGPARAM("Bullet Symbols") );
+ rtl::OUString aBulletChar;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_CHAR_STYLE_NAME )), uno::makeAny( sCharStyleName ) );
+ switch( nLevel )
+ {
+ case 0:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) );
+ break;
+ }
+ case 1:
+ case 5:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_ARROW ) );
+ break;
+ }
+ case 2:
+ case 6:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_SQUARE ) );
+ break;
+ }
+ case 3:
+ case 7:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_CLOSED_DOT ) );
+ break;
+ }
+ case 4:
+ case 8:
+ {
+ aBulletChar = rtl::OUString( sal_Unicode( CHAR_DIAMOND ) );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_BULLET_CHAR )), uno::makeAny( aBulletChar ) );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType4() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = 0;
+ rtl::OUString sPrefix;
+ rtl::OUString sSuffix;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ switch( nLevel )
+ {
+ case 0:
+ {
+ nNumberingType = style::NumberingType::ROMAN_UPPER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 1:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ sal_Int16 nParentNumbering = 0;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) );
+ break;
+ }
+ case 2:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 3:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 4:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 5:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 6:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 7:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 8:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType5() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = style::NumberingType::ARABIC;
+ sal_Int16 nParentNumbering = 0;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ if( nLevel != 0 )
+ {
+ nParentNumbering = sal_Int16( nLevel - 1 );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) );
+ }
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType6() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = 0;
+ rtl::OUString sPrefix;
+ rtl::OUString sSuffix;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ switch( nLevel )
+ {
+ case 0:
+ {
+ nNumberingType = style::NumberingType::ROMAN_UPPER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 1:
+ {
+ nNumberingType = style::NumberingType::CHARS_UPPER_LETTER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 2:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 3:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString();
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 4:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 5:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 6:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode(')') );
+ break;
+ }
+ case 7:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ case 8:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ sPrefix = rtl::OUString::valueOf( sal_Unicode('(') );
+ sSuffix = rtl::OUString::valueOf( sal_Unicode('.') );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+void SwVbaListHelper::CreateOutlineNumberForType7() throw( css::uno::RuntimeException )
+{
+ sal_Int16 nNumberingType = style::NumberingType::ARABIC;
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+ rtl::OUString sPrefix(RTL_CONSTASCII_USTRINGPARAM("Chapter "));
+
+ for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ )
+ {
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) );
+ setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ }
+}
+
+uno::Any SwVbaListHelper::getPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName ) throw( css::uno::RuntimeException )
+{
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ return getPropertyValue( aPropertyValues, sName );
+}
+
+void SwVbaListHelper::setPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName, const css::uno::Any& aValue ) throw( css::uno::RuntimeException )
+{
+ uno::Sequence< beans::PropertyValue > aPropertyValues;
+ mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues;
+ setOrAppendPropertyValue( aPropertyValues, sName, aValue );
+ mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) );
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( mxNumberingRules ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisthelper.hxx b/sw/source/ui/vba/vbalisthelper.hxx
new file mode 100644
index 000000000000..0e862fa0dd2c
--- /dev/null
+++ b/sw/source/ui/vba/vbalisthelper.hxx
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SW_VBA_LISTHELPER_HXX
+#define SW_VBA_LISTHELPER_HXX
+
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <boost/shared_ptr.hpp>
+
+
+class SwVbaListHelper;
+typedef ::boost::shared_ptr< SwVbaListHelper > SwVbaListHelperRef;
+
+class SwVbaListHelper
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+ css::uno::Reference< css::container::XIndexReplace > mxNumberingRules;
+ css::uno::Reference< css::container::XNameContainer > mxStyleFamily;
+ css::uno::Reference< css::beans::XPropertySet > mxStyleProps;
+ sal_Int32 mnGalleryType;
+ sal_Int32 mnTemplateType;
+ rtl::OUString msStyleName;
+
+ void Init() throw( css::uno::RuntimeException );
+ void CreateListTemplate() throw( css::uno::RuntimeException );
+ void CreateBulletListTemplate() throw( css::uno::RuntimeException );
+ void CreateNumberListTemplate() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberListTemplate() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType1() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType2() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType3() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType4() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType5() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType6() throw( css::uno::RuntimeException );
+ void CreateOutlineNumberForType7() throw( css::uno::RuntimeException );
+
+public:
+ SwVbaListHelper( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw( css::uno::RuntimeException );
+
+ sal_Int32 getGalleryType() const { return mnGalleryType; }
+ css::uno::Reference< css::container::XIndexReplace > getNumberingRules() const { return mxNumberingRules; }
+ css::uno::Any getPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName ) throw( css::uno::RuntimeException );
+ void setPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName, const css::uno::Any& aValue ) throw( css::uno::RuntimeException );
+
+};
+
+#endif//SW_VBA_LISTHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistlevel.cxx b/sw/source/ui/vba/vbalistlevel.cxx
new file mode 100644
index 000000000000..b35f7b52f590
--- /dev/null
+++ b/sw/source/ui/vba/vbalistlevel.cxx
@@ -0,0 +1,400 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalistlevel.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/style/NumberingType.hpp>
+#include <ooo/vba/word/WdListNumberStyle.hpp>
+#include <ooo/vba/word/WdTrailingCharacter.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <ooo/vba/word/WdListLevelAlignment.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaListLevel::SwVbaListLevel( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper, sal_Int32 nLevel ) throw ( uno::RuntimeException ) : SwVbaListLevel_BASE( rParent, rContext ), pListHelper( pHelper ), mnLevel( nLevel )
+{
+}
+
+SwVbaListLevel::~SwVbaListLevel()
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getAlignment() throw (uno::RuntimeException)
+{
+ sal_Int16 nAlignment = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Adjust") ) ) >>= nAlignment;
+ switch( nAlignment )
+ {
+ case text::HoriOrientation::LEFT:
+ {
+ nAlignment = word::WdListLevelAlignment::wdListLevelAlignLeft;
+ break;
+ }
+ case text::HoriOrientation::RIGHT:
+ {
+ nAlignment = word::WdListLevelAlignment::wdListLevelAlignRight;
+ break;
+ }
+ case text::HoriOrientation::CENTER:
+ {
+ nAlignment = word::WdListLevelAlignment::wdListLevelAlignCenter;
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ return nAlignment;
+}
+
+void SAL_CALL SwVbaListLevel::setAlignment( ::sal_Int32 _alignment ) throw (uno::RuntimeException)
+{
+ sal_Int16 nAlignment = text::HoriOrientation::LEFT;
+ switch( _alignment )
+ {
+ case word::WdListLevelAlignment::wdListLevelAlignLeft:
+ {
+ nAlignment = text::HoriOrientation::LEFT;
+ break;
+ }
+ case word::WdListLevelAlignment::wdListLevelAlignRight:
+ {
+ nAlignment = text::HoriOrientation::RIGHT;
+ break;
+ }
+ case word::WdListLevelAlignment::wdListLevelAlignCenter:
+ {
+ nAlignment = text::HoriOrientation::CENTER;
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException();
+ }
+ }
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Adjust") ), uno::makeAny( nAlignment ) );
+}
+
+uno::Reference< ::ooo::vba::word::XFont > SAL_CALL SwVbaListLevel::getFont() throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ return uno::Reference< word::XFont >();
+}
+
+void SAL_CALL SwVbaListLevel::setFont( const uno::Reference< ::ooo::vba::word::XFont >& /*_font*/ ) throw (uno::RuntimeException)
+{
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getIndex() throw (uno::RuntimeException)
+{
+ return mnLevel + 1;
+}
+
+::rtl::OUString SAL_CALL SwVbaListLevel::getLinkedStyle() throw (uno::RuntimeException)
+{
+ // TODO:
+ return rtl::OUString();
+}
+
+void SAL_CALL SwVbaListLevel::setLinkedStyle( const ::rtl::OUString& /*_linkedstyle*/ ) throw (uno::RuntimeException)
+{
+ // TODO:
+}
+
+::rtl::OUString SAL_CALL SwVbaListLevel::getNumberFormat() throw (uno::RuntimeException)
+{
+ // TODO::
+ return rtl::OUString();
+}
+
+void SAL_CALL SwVbaListLevel::setNumberFormat( const ::rtl::OUString& /*_numberformat*/ ) throw (uno::RuntimeException)
+{
+ // TODO::
+}
+
+float SAL_CALL SwVbaListLevel::getNumberPosition() throw (uno::RuntimeException)
+{
+ // indentAt + firstlineindent
+ sal_Int32 nIndentAt = 0;
+ sal_Int32 nFirstLineIndent = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ) ) >>= nFirstLineIndent;
+
+ sal_Int32 nResult = nIndentAt + nFirstLineIndent;
+
+ return static_cast< float >( Millimeter::getInPoints( nResult ) );
+}
+
+void SAL_CALL SwVbaListLevel::setNumberPosition( float _numberposition ) throw (uno::RuntimeException)
+{
+ sal_Int32 nNumberPosition = Millimeter::getInHundredthsOfOneMillimeter( _numberposition );
+
+ sal_Int32 nIndentAt = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt;
+
+ sal_Int32 nFirstLineIndent = nNumberPosition - nIndentAt;
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ), uno::makeAny( nFirstLineIndent ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getNumberStyle() throw (uno::RuntimeException)
+{
+ sal_Int16 nNumberingType = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingType") ) ) >>= nNumberingType;
+ switch( nNumberingType )
+ {
+ case style::NumberingType::CHAR_SPECIAL:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleBullet;
+ break;
+ }
+ case style::NumberingType::CHARS_UPPER_LETTER:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleUppercaseLetter;
+ break;
+ }
+ case style::NumberingType::CHARS_LOWER_LETTER:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleLowercaseLetter;
+ break;
+ }
+ case style::NumberingType::ROMAN_UPPER:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleUppercaseRoman;
+ break;
+ }
+ case style::NumberingType::ROMAN_LOWER:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleLowercaseRoman;
+ break;
+ }
+ case style::NumberingType::ARABIC:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleArabic;
+ break;
+ }
+ case style::NumberingType::NUMBER_NONE:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleNone;
+ break;
+ }
+ case style::NumberingType::FULLWIDTH_ARABIC:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleArabicFullWidth;
+ break;
+ }
+ case style::NumberingType::CIRCLE_NUMBER:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleNumberInCircle;
+ break;
+ }
+ case style::NumberingType::CHARS_ARABIC:
+ {
+ nNumberingType = word::WdListNumberStyle::wdListNumberStyleCardinalText;
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ }
+ return nNumberingType;
+}
+
+void SAL_CALL SwVbaListLevel::setNumberStyle( ::sal_Int32 _numberstyle ) throw (uno::RuntimeException)
+{
+ sal_Int16 nNumberingType = 0;
+ switch( _numberstyle )
+ {
+ case word::WdListNumberStyle::wdListNumberStyleBullet:
+ {
+ nNumberingType = style::NumberingType::CHAR_SPECIAL;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleUppercaseLetter:
+ {
+ nNumberingType = style::NumberingType::CHARS_UPPER_LETTER_N;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleLowercaseLetter:
+ {
+ nNumberingType = style::NumberingType::CHARS_LOWER_LETTER_N;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleUppercaseRoman:
+ {
+ nNumberingType = style::NumberingType::ROMAN_UPPER;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleLowercaseRoman:
+ {
+ nNumberingType = style::NumberingType::ROMAN_LOWER;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleArabic:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleNone:
+ {
+ nNumberingType = style::NumberingType::NUMBER_NONE;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleArabicFullWidth:
+ {
+ nNumberingType = style::NumberingType::FULLWIDTH_ARABIC;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleNumberInCircle:
+ {
+ nNumberingType = style::NumberingType::CIRCLE_NUMBER;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleCardinalText:
+ {
+ nNumberingType = style::NumberingType::CHARS_ARABIC;
+ break;
+ }
+ case word::WdListNumberStyle::wdListNumberStyleOrdinal:
+ case word::WdListNumberStyle::wdListNumberStyleOrdinalText:
+ case word::WdListNumberStyle::wdListNumberStyleKanji:
+ case word::WdListNumberStyle::wdListNumberStyleKanjiDigit:
+ case word::WdListNumberStyle::wdListNumberStyleAiueoHalfWidth:
+ case word::WdListNumberStyle::wdListNumberStyleIrohaHalfWidth:
+ {
+ nNumberingType = style::NumberingType::ARABIC;
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ }
+
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingType") ), uno::makeAny( nNumberingType ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getResetOnHigher() throw (uno::RuntimeException)
+{
+ //seems not support?
+ return 0;
+}
+
+void SAL_CALL SwVbaListLevel::setResetOnHigher( ::sal_Int32 /*_resetonhigher*/ ) throw (uno::RuntimeException)
+{
+ //seems not support?
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getStartAt() throw (uno::RuntimeException)
+{
+ sal_Int16 nStartWith = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StartWith") ) ) >>= nStartWith;
+ return nStartWith;
+}
+
+void SAL_CALL SwVbaListLevel::setStartAt( ::sal_Int32 _startat ) throw (uno::RuntimeException)
+{
+ sal_Int16 nStartWith = (sal_Int16)_startat;
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StartWith") ), uno::makeAny( nStartWith ) );
+}
+
+float SAL_CALL SwVbaListLevel::getTabPosition() throw (uno::RuntimeException)
+{
+ sal_Int32 nTabPosition = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ListtabStopPosition") ) ) >>= nTabPosition;
+
+ return static_cast< float >( Millimeter::getInPoints( nTabPosition ) );
+}
+
+void SAL_CALL SwVbaListLevel::setTabPosition( float _tabposition ) throw (uno::RuntimeException)
+{
+ sal_Int32 nTabPosition = Millimeter::getInHundredthsOfOneMillimeter( _tabposition );
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ListtabStopPosition") ), uno::makeAny( nTabPosition ) );
+}
+
+float SAL_CALL SwVbaListLevel::getTextPosition() throw (uno::RuntimeException)
+{
+ // indentAt
+ sal_Int32 nIndentAt = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt;
+
+ return static_cast< float >( Millimeter::getInPoints( nIndentAt ) );
+}
+
+void SAL_CALL SwVbaListLevel::setTextPosition( float _textposition ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndentAt = 0;
+ sal_Int32 nFirstLineIndent = 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ) ) >>= nFirstLineIndent;
+
+ sal_Int32 nAlignedAt = nIndentAt + nFirstLineIndent;
+
+ nIndentAt = Millimeter::getInHundredthsOfOneMillimeter( _textposition );
+ nFirstLineIndent = nAlignedAt - nIndentAt;
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ), uno::makeAny( nIndentAt ) );
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ), uno::makeAny( nFirstLineIndent ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevel::getTrailingCharacter() throw (uno::RuntimeException)
+{
+ sal_Int16 nLabelFollowedBy= 0;
+ pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LabelFollowedBy") ) ) >>= nLabelFollowedBy;
+
+ return nLabelFollowedBy;
+}
+
+void SAL_CALL SwVbaListLevel::setTrailingCharacter( ::sal_Int32 _trailingcharacter ) throw (uno::RuntimeException)
+{
+ sal_Int16 nLabelFollowedBy = (sal_Int16)_trailingcharacter;
+ pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LabelFollowedBy") ), uno::makeAny( nLabelFollowedBy ) );
+}
+
+rtl::OUString&
+SwVbaListLevel::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListLevel") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaListLevel::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListLevel" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistlevel.hxx b/sw/source/ui/vba/vbalistlevel.hxx
new file mode 100644
index 000000000000..9be001ae3ecc
--- /dev/null
+++ b/sw/source/ui/vba/vbalistlevel.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTLEVEL_HXX
+#define SW_VBA_LISTLEVEL_HXX
+
+#include <ooo/vba/word/XListLevel.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include "vbalisthelper.hxx"
+
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListLevel > SwVbaListLevel_BASE;
+
+class SwVbaListLevel : public SwVbaListLevel_BASE
+{
+private:
+ SwVbaListHelperRef pListHelper;
+ sal_Int32 mnLevel;
+
+public:
+ SwVbaListLevel( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper, sal_Int32 nLevel ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaListLevel();
+
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getAlignment() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAlignment( ::sal_Int32 _alignment ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFont( const css::uno::Reference< ::ooo::vba::word::XFont >& _font ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getIndex() throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLinkedStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLinkedStyle( const ::rtl::OUString& _linkedstyle ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getNumberFormat() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setNumberFormat( const ::rtl::OUString& _numberformat ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getNumberPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setNumberPosition( float _numberposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setNumberStyle( ::sal_Int32 _numberstyle ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getResetOnHigher() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setResetOnHigher( ::sal_Int32 _resetonhigher ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getStartAt() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStartAt( ::sal_Int32 _startat ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getTabPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTabPosition( float _tabposition ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getTextPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTextPosition( float _textposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTrailingCharacter() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTrailingCharacter( ::sal_Int32 _trailingcharacter ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_LISTLEVEL_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistlevels.cxx b/sw/source/ui/vba/vbalistlevels.cxx
new file mode 100644
index 000000000000..2c1301127dd1
--- /dev/null
+++ b/sw/source/ui/vba/vbalistlevels.cxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalistlevels.hxx"
+#include "vbalistlevel.hxx"
+#include <ooo/vba/word/WdListGalleryType.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class ListLevelsEnumWrapper : public EnumerationHelper_BASE
+{
+ SwVbaListLevels* pListLevels;
+ sal_Int32 nIndex;
+public:
+ ListLevelsEnumWrapper( SwVbaListLevels* pLevels ) : pListLevels( pLevels ), nIndex( 1 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex <= pListLevels->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex <= pListLevels->getCount() )
+ return pListLevels->Item( uno::makeAny( nIndex++ ), uno::Any() );
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaListLevels::SwVbaListLevels( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, SwVbaListHelperRef pHelper ) throw (uno::RuntimeException) : SwVbaListLevels_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), pListHelper( pHelper )
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaListLevels::getCount() throw (uno::RuntimeException)
+{
+ sal_Int32 nGalleryType = pListHelper->getGalleryType();
+ if( nGalleryType == word::WdListGalleryType::wdBulletGallery
+ || nGalleryType == word::WdListGalleryType::wdNumberGallery )
+ return 1;
+ else if( nGalleryType == word::WdListGalleryType::wdOutlineNumberGallery )
+ return 9;
+ return 0;
+}
+
+uno::Any SAL_CALL SwVbaListLevels::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ if( ( Index1 >>= nIndex ) == sal_False )
+ throw uno::RuntimeException();
+ if( nIndex <=0 || nIndex > getCount() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+
+ return uno::makeAny( uno::Reference< word::XListLevel >( new SwVbaListLevel( this, mxContext, pListHelper, nIndex - 1 ) ) );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaListLevels::getElementType() throw (uno::RuntimeException)
+{
+ return word::XListLevel::static_type(0);
+}
+
+uno::Reference< container::XEnumeration >
+SwVbaListLevels::createEnumeration() throw (uno::RuntimeException)
+{
+ return new ListLevelsEnumWrapper( this );
+}
+
+uno::Any
+SwVbaListLevels::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaListLevels::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListLevels") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaListLevels::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListLevels") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalistlevels.hxx b/sw/source/ui/vba/vbalistlevels.hxx
new file mode 100644
index 000000000000..595c0fb34bf2
--- /dev/null
+++ b/sw/source/ui/vba/vbalistlevels.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTLEVELS_HXX
+#define SW_VBA_LISTLEVELS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XListLevels.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include "vbalisthelper.hxx"
+
+
+typedef CollTestImplHelper< ooo::vba::word::XListLevels > SwVbaListLevels_BASE;
+
+class SwVbaListLevels : public SwVbaListLevels_BASE
+{
+private:
+ SwVbaListHelperRef pListHelper;
+
+public:
+ SwVbaListLevels( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaListLevels() {}
+
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException );
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaListLevels_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_LISTLEVELS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisttemplate.cxx b/sw/source/ui/vba/vbalisttemplate.cxx
new file mode 100644
index 000000000000..49305c74e5a5
--- /dev/null
+++ b/sw/source/ui/vba/vbalisttemplate.cxx
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalisttemplate.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include "vbalistlevels.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaListTemplate::SwVbaListTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw ( uno::RuntimeException ) : SwVbaListTemplate_BASE( rParent, rContext )
+{
+ pListHelper.reset( new SwVbaListHelper( xTextDoc, nGalleryType, nTemplateType ) );
+}
+
+SwVbaListTemplate::~SwVbaListTemplate()
+{
+}
+
+uno::Any SAL_CALL
+SwVbaListTemplate::ListLevels( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCollection > xCol( new SwVbaListLevels( mxParent, mxContext, pListHelper ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+void SwVbaListTemplate::applyListTemplate( uno::Reference< beans::XPropertySet >& xProps ) throw (uno::RuntimeException)
+{
+ uno::Reference< container::XIndexReplace > xNumberingRules = pListHelper->getNumberingRules();
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( xNumberingRules ) );
+}
+
+rtl::OUString&
+SwVbaListTemplate::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListTemplate") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaListTemplate::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListTemplate" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisttemplate.hxx b/sw/source/ui/vba/vbalisttemplate.hxx
new file mode 100644
index 000000000000..d876cffb0300
--- /dev/null
+++ b/sw/source/ui/vba/vbalisttemplate.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTTEMPLATE_HXX
+#define SW_VBA_LISTTEMPLATE_HXX
+
+#include <ooo/vba/word/XListTemplate.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include "vbalisthelper.hxx"
+
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListTemplate > SwVbaListTemplate_BASE;
+
+class SwVbaListTemplate : public SwVbaListTemplate_BASE
+{
+private:
+ SwVbaListHelperRef pListHelper;
+
+public:
+ SwVbaListTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaListTemplate();
+
+ void applyListTemplate( css::uno::Reference< css::beans::XPropertySet >& xProps ) throw ( css::uno::RuntimeException );
+
+ // Methods
+ virtual css::uno::Any SAL_CALL ListLevels( const css::uno::Any& index ) throw ( css::uno::RuntimeException );
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_LISTTEMPLATE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisttemplates.cxx b/sw/source/ui/vba/vbalisttemplates.cxx
new file mode 100644
index 000000000000..e54aa1637291
--- /dev/null
+++ b/sw/source/ui/vba/vbalisttemplates.cxx
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbalisttemplates.hxx"
+#include "vbalisttemplate.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class ListTemplatesEnumWrapper : public EnumerationHelper_BASE
+{
+ SwVbaListTemplates* pListTemplates;
+ sal_Int32 nIndex;
+public:
+ ListTemplatesEnumWrapper( SwVbaListTemplates* pTemplates ) : pListTemplates( pTemplates ), nIndex( 1 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex <= pListTemplates->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex <= pListTemplates->getCount() )
+ return pListTemplates->Item( uno::makeAny( nIndex++ ), uno::Any() );
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaListTemplates::SwVbaListTemplates( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw (uno::RuntimeException) : SwVbaListTemplates_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc ), mnGalleryType( nType )
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaListTemplates::getCount() throw (uno::RuntimeException)
+{
+ // 3 types of list( bullet, numbered and outline )
+ return 7;
+}
+
+uno::Any SAL_CALL SwVbaListTemplates::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ if( ( Index1 >>= nIndex ) == sal_False )
+ throw uno::RuntimeException();
+ if( nIndex <=0 || nIndex > getCount() )
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+
+ return uno::makeAny( uno::Reference< word::XListTemplate >( new SwVbaListTemplate( this, mxContext, mxTextDocument, mnGalleryType, nIndex ) ) );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaListTemplates::getElementType() throw (uno::RuntimeException)
+{
+ return word::XListTemplate::static_type(0);
+}
+
+uno::Reference< container::XEnumeration >
+SwVbaListTemplates::createEnumeration() throw (uno::RuntimeException)
+{
+ return new ListTemplatesEnumWrapper( this );
+}
+
+uno::Any
+SwVbaListTemplates::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaListTemplates::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListTemplates") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaListTemplates::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListTemplates") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbalisttemplates.hxx b/sw/source/ui/vba/vbalisttemplates.hxx
new file mode 100644
index 000000000000..a42137984899
--- /dev/null
+++ b/sw/source/ui/vba/vbalisttemplates.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_LISTTEMPLATES_HXX
+#define SW_VBA_LISTTEMPLATES_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XListTemplates.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XListTemplates > SwVbaListTemplates_BASE;
+
+class SwVbaListTemplates : public SwVbaListTemplates_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+ sal_Int32 mnGalleryType;
+
+public:
+ SwVbaListTemplates( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw (css::uno::RuntimeException);
+ virtual ~SwVbaListTemplates() {}
+
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException );
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaListTemplates_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_LISTTEMPLATES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaoptions.cxx b/sw/source/ui/vba/vbaoptions.cxx
index d59d0326cf5e..47a81de0da0f 100644
--- a/sw/source/ui/vba/vbaoptions.cxx
+++ b/sw/source/ui/vba/vbaoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,7 +104,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value )
value >>= sNewPath;
rtl::OUString sNewPathUrl;
::osl::File::getFileURLFromSystemPath( sNewPath, sNewPathUrl );
- uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) ), uno::UNO_QUERY_THROW );
rtl::OUString sOldPathUrl;
xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sOldPathUrl;
// path could be a multipath, Microsoft doesn't support this feature in Word currently
@@ -118,7 +119,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value )
uno::Any SwVbaOptions::getValueEvent()
{
- uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) ), uno::UNO_QUERY_THROW );
rtl::OUString sPathUrl;
xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sPathUrl;
// path could be a multipath, Microsoft doesn't support this feature in Word currently
@@ -282,3 +283,5 @@ SwVbaOptions::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaoptions.hxx b/sw/source/ui/vba/vbaoptions.hxx
index ec1f70068e48..7ef21fd3b406 100644
--- a/sw/source/ui/vba/vbaoptions.hxx
+++ b/sw/source/ui/vba/vbaoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,3 +86,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_OPTIONS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapagesetup.cxx b/sw/source/ui/vba/vbapagesetup.cxx
index 1cdda8152207..c0f1bf6dad20 100644
--- a/sw/source/ui/vba/vbapagesetup.cxx
+++ b/sw/source/ui/vba/vbapagesetup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -144,7 +145,7 @@ void SAL_CALL SwVbaPageSetup::setFooterDistance( double _footerdistance ) throw
sal_Bool SAL_CALL SwVbaPageSetup::getDifferentFirstPageHeaderFooter() throw (uno::RuntimeException)
{
rtl::OUString pageStyle = getStyleOfFirstPage();
- if( pageStyle.equalsAscii( "First Page" ) )
+ if( pageStyle.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "First Page" ) ) )
return sal_True;
return sal_False;
@@ -236,10 +237,9 @@ rtl::OUString SwVbaPageSetup::getStyleOfFirstPage() throw (uno::RuntimeException
sal_Int32 wdSectionStart = word::WdSectionStart::wdSectionNewPage;
uno::Reference< container::XNamed > xNamed( mxPageProps, uno::UNO_QUERY_THROW );
rtl::OUString sStyleName = xNamed->getName();
- //mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sStyleName;
- if( sStyleName.equalsAscii("Left Page") )
+ if( sStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Left Page")) )
wdSectionStart = word::WdSectionStart::wdSectionEvenPage;
- else if( sStyleName.equalsAscii("Right Page") )
+ else if( sStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Right Page")) )
wdSectionStart = word::WdSectionStart::wdSectionOddPage;
else
wdSectionStart = word::WdSectionStart::wdSectionNewPage;
@@ -270,3 +270,5 @@ SwVbaPageSetup::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapagesetup.hxx b/sw/source/ui/vba/vbapagesetup.hxx
index df7c59a728ce..243ffca33e28 100644
--- a/sw/source/ui/vba/vbapagesetup.hxx
+++ b/sw/source/ui/vba/vbapagesetup.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx
index 12554e792e5e..3639d0e63638 100644
--- a/sw/source/ui/vba/vbapalette.cxx
+++ b/sw/source/ui/vba/vbapalette.cxx
@@ -1,8 +1,10 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "vbapalette.hxx"
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <ooo/vba/word/WdColor.hpp>
#include <ooo/vba/word/WdColorIndex.hpp>
+#include <sal/macros.h>
using namespace ::ooo::vba;
using namespace ::ooo::vba::word;
@@ -39,7 +41,7 @@ public:
// Methods XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException)
{
- return sizeof(ColorTable) / sizeof(ColorTable[0]);
+ return SAL_N_ELEMENTS(ColorTable);
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
@@ -73,3 +75,4 @@ VbaPalette::getPalette() const
return mxPalette;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapalette.hxx b/sw/source/ui/vba/vbapalette.hxx
index 6179f1723c0b..8d6d63f2dd3a 100644
--- a/sw/source/ui/vba/vbapalette.hxx
+++ b/sw/source/ui/vba/vbapalette.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef VBAPALETTE_HXX
#define VBAPALETTE_HXX
#include <vbahelper/vbahelper.hxx>
@@ -13,3 +14,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapane.cxx b/sw/source/ui/vba/vbapane.cxx
index dc5d5ccff882..2db1d8a27850 100644
--- a/sw/source/ui/vba/vbapane.cxx
+++ b/sw/source/ui/vba/vbapane.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ SwVbaPane::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapane.hxx b/sw/source/ui/vba/vbapane.hxx
index b8a6fff38da3..e496272bbed6 100644
--- a/sw/source/ui/vba/vbapane.hxx
+++ b/sw/source/ui/vba/vbapane.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_PANE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapanes.cxx b/sw/source/ui/vba/vbapanes.cxx
index b536c800a854..a69eb236a219 100644
--- a/sw/source/ui/vba/vbapanes.cxx
+++ b/sw/source/ui/vba/vbapanes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,3 +123,5 @@ SwVbaPanes::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbapanes.hxx b/sw/source/ui/vba/vbapanes.hxx
index 76c24166cfa7..82fa5391bb25 100644
--- a/sw/source/ui/vba/vbapanes.hxx
+++ b/sw/source/ui/vba/vbapanes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ public:
};
#endif /* SW_VBA_PANES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaparagraph.cxx b/sw/source/ui/vba/vbaparagraph.cxx
index 333fd4ca9a98..1861f316cf87 100644
--- a/sw/source/ui/vba/vbaparagraph.cxx
+++ b/sw/source/ui/vba/vbaparagraph.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,20 @@ SwVbaParagraph::getRange( ) throw ( uno::RuntimeException )
return uno::Reference< word::XRange >( new SwVbaRange( this, mxContext, mxTextDocument, mxTextRange->getStart(), mxTextRange->getEnd(), mxTextRange->getText(), sal_True ) );
}
+uno::Any SAL_CALL
+SwVbaParagraph::getStyle( ) throw ( uno::RuntimeException )
+{
+ uno::Reference< word::XRange > xRange = getRange();
+ return xRange->getStyle();
+}
+
+void SAL_CALL
+SwVbaParagraph::setStyle( const uno::Any& style ) throw ( uno::RuntimeException )
+{
+ uno::Reference< word::XRange > xRange = getRange();
+ xRange->setStyle( style );
+}
+
rtl::OUString&
SwVbaParagraph::getServiceImplName()
{
@@ -67,8 +82,6 @@ SwVbaParagraph::getServiceNames()
return aServiceNames;
}
-
-//typedef ::cppu::WeakImplHelper1< container::XEnumeration > ParagraphEnumeration_BASE;
typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > ParagraphCollectionHelper_BASE;
class ParagraphCollectionHelper : public ParagraphCollectionHelper_BASE
@@ -172,3 +185,5 @@ SwVbaParagraphs::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaparagraph.hxx b/sw/source/ui/vba/vbaparagraph.hxx
index 894ac61cc7e6..c7b185690cfc 100644
--- a/sw/source/ui/vba/vbaparagraph.hxx
+++ b/sw/source/ui/vba/vbaparagraph.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,6 +51,8 @@ public:
// XParagraph
virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL getRange() throw ( css::uno::RuntimeException );
+ virtual css::uno::Any SAL_CALL getStyle() throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL setStyle( const css::uno::Any& style ) throw ( css::uno::RuntimeException );
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
@@ -79,3 +82,5 @@ public:
};
#endif /* SW_VBA_PARAGRAPH_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaparagraphformat.cxx b/sw/source/ui/vba/vbaparagraphformat.cxx
index 07a822ad5752..1fcd264b129a 100644
--- a/sw/source/ui/vba/vbaparagraphformat.cxx
+++ b/sw/source/ui/vba/vbaparagraphformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <ooo/vba/word/WdOutlineLevel.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/style/BreakType.hpp>
+#include "vbatabstops.hxx"
using namespace ::ooo::vba;
@@ -200,9 +202,12 @@ sal_Int32 SAL_CALL SwVbaParagraphFormat::getOutlineLevel() throw (uno::RuntimeEx
return nLevel;
}
-void SAL_CALL SwVbaParagraphFormat::setOutlineLevel( sal_Int32 /*_outlinelevel*/ ) throw (uno::RuntimeException)
+void SAL_CALL SwVbaParagraphFormat::setOutlineLevel( sal_Int32 _outlinelevel ) throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ if( _outlinelevel != getOutlineLevel() )
+ {
+ // TODO: in my test in msword, there is no effect for this function.
+ }
}
uno::Any SAL_CALL SwVbaParagraphFormat::getPageBreakBefore() throw (uno::RuntimeException)
@@ -296,7 +301,7 @@ void SAL_CALL SwVbaParagraphFormat::setRightIndent( float _rightindent ) throw (
uno::Any SAL_CALL SwVbaParagraphFormat::getTabStops() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ return uno::makeAny( uno::Reference< word::XTabStops >( new SwVbaTabStops( this, mxContext, mxParaProps ) ) );
}
void SAL_CALL SwVbaParagraphFormat::setTabStops( const uno::Any& /*_tabstops*/ ) throw (uno::RuntimeException)
@@ -571,3 +576,4 @@ SwVbaParagraphFormat::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaparagraphformat.hxx b/sw/source/ui/vba/vbaparagraphformat.hxx
index 684390820e13..c827cd40bffa 100644
--- a/sw/source/ui/vba/vbaparagraphformat.hxx
+++ b/sw/source/ui/vba/vbaparagraphformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_PARAGRAPHFORMAT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index 647aedb34791..f58f7ab89be3 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,12 +33,21 @@
#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "wordvbahelper.hxx"
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XWordCursor.hpp>
+#include <com/sun/star/text/XParagraphCursor.hpp>
+#include <ooo/vba/word/WdUnits.hpp>
+#include <ooo/vba/word/WdMovementType.hpp>
#include "vbaparagraphformat.hxx"
#include "vbastyle.hxx"
#include "vbafont.hxx"
#include "vbapalette.hxx"
#include "vbapagesetup.hxx"
+#include "vbalistformat.hxx"
+#include "vbarevisions.hxx"
+#include "vbabookmarks.hxx"
+#include "vbasections.hxx"
+#include "vbafield.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -70,6 +80,8 @@ void SwVbaRange::initialize( const uno::Reference< text::XTextRange >& rStart, c
}
mxTextCursor = SwVbaRangeHelper::initCursor( rStart, mxText );
+ if( !mxTextCursor.is() )
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fails to create text cursor") ), uno::Reference< uno::XInterface >() );
mxTextCursor->collapseToStart();
if( rEnd.is() )
@@ -84,13 +96,7 @@ SwVbaRange::getXTextRange() throw (uno::RuntimeException)
uno::Reference< text::XTextRange > xTextRange( mxTextCursor, uno::UNO_QUERY_THROW );
return xTextRange;
}
-#ifdef TOMORROW
-void SwVbaRange::setXTextRange( const uno::Reference< text::XTextRange >& xRange ) throw (uno::RuntimeException)
-{
- mxTextCursor->gotoRange( xRange->getStart(), sal_False );
- mxTextCursor->gotoRange( xRange->getEnd(), sal_True );
-}
-#endif
+
/**
* The complexity in this method is because we need to workaround
* an issue that the last paragraph in a document does not have a trailing CRLF.
@@ -128,17 +134,46 @@ SwVbaRange::getText() throw ( uno::RuntimeException )
void SAL_CALL
SwVbaRange::setText( const rtl::OUString& rText ) throw ( uno::RuntimeException )
{
+ // Emulate the MSWord behavior, Don't delete the bookmark
+ // which contains no text string in current inserting position,
+ rtl::OUString sName;
+ uno::Reference< text::XTextRange > xRange( mxTextCursor, uno::UNO_QUERY_THROW );
+ try
+ {
+ uno::Reference< text::XTextContent > xBookmark = SwVbaRangeHelper::findBookmarkByPosition( mxTextDocument, xRange->getStart() );
+ if( xBookmark.is() )
+ {
+ uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY_THROW );
+ sName = xNamed->getName();
+ }
+ }
+ catch( uno::Exception& )
+ {
+ // do nothing
+ }
+
if( rText.indexOf( '\n' ) != -1 )
{
mxTextCursor->setString( rtl::OUString() );
// process CR in strings
- uno::Reference< text::XTextRange > xRange( mxTextCursor, uno::UNO_QUERY_THROW );
SwVbaRangeHelper::insertString( xRange, mxText, rText, sal_True );
}
else
{
mxTextCursor->setString( rText );
}
+
+ // insert the bookmark if the bookmark is deleted during setting text string
+ if( sName.getLength() )
+ {
+ uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xNameAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW );
+ if( !xNameAccess->hasByName( sName ) )
+ {
+ uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
+ SwVbaBookmarks::addBookmarkByName( xModel, sName, xRange->getStart() );
+ }
+ }
}
// FIXME: test is not pass
@@ -229,11 +264,8 @@ SwVbaRange::setParagraphFormat( const uno::Reference< word::XParagraphFormat >&
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
}
-uno::Reference< word::XStyle > SAL_CALL
-SwVbaRange::getStyle() throw ( uno::RuntimeException )
+void SwVbaRange::GetStyleInfo(rtl::OUString& aStyleName, rtl::OUString& aStyleType ) throw ( uno::RuntimeException )
{
- rtl::OUString aStyleName;
- rtl::OUString aStyleType;
uno::Reference< beans::XPropertySet > xProp( mxTextCursor, uno::UNO_QUERY_THROW );
if( ( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharStyleName") ) ) >>= aStyleName ) && aStyleName.getLength() )
{
@@ -247,14 +279,23 @@ SwVbaRange::getStyle() throw ( uno::RuntimeException )
{
DebugHelper::exception( SbERR_INTERNAL_ERROR, rtl::OUString() );
}
+}
+
+uno::Any SAL_CALL
+SwVbaRange::getStyle() throw ( uno::RuntimeException )
+{
+ rtl::OUString aStyleName;
+ rtl::OUString aStyleType;
+ GetStyleInfo( aStyleName, aStyleType );
uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxTextDocument, uno::UNO_QUERY_THROW);
uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName( aStyleType ), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xStyleProps( xStylesAccess->getByName( aStyleName ), uno::UNO_QUERY_THROW );
- return uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProps ) );
+ uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xModel, xStyleProps ) ) );
}
void SAL_CALL
-SwVbaRange::setStyle( const uno::Reference< word::XStyle >& rStyle ) throw ( uno::RuntimeException )
+SwVbaRange::setStyle( const uno::Any& rStyle ) throw ( uno::RuntimeException )
{
uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW );
SwVbaStyle::setStyle( xParaProps, rStyle );
@@ -267,6 +308,12 @@ SwVbaRange::getFont() throw ( uno::RuntimeException )
return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), uno::Reference< beans::XPropertySet >( getXTextRange(), uno::UNO_QUERY_THROW ) );
}
+uno::Reference< word::XListFormat > SAL_CALL
+SwVbaRange::getListFormat() throw ( uno::RuntimeException )
+{
+ return uno::Reference< word::XListFormat >( new SwVbaListFormat( this, mxContext, getXTextRange() ) );
+}
+
::sal_Int32 SAL_CALL SwVbaRange::getLanguageID() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW );
@@ -324,6 +371,50 @@ void SAL_CALL SwVbaRange::setEnd( ::sal_Int32 _end ) throw (uno::RuntimeExceptio
mxTextCursor->gotoRange( xEnd, sal_True );
}
+::sal_Bool SAL_CALL SwVbaRange::InRange( const uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (uno::RuntimeException)
+{
+ SwVbaRange* pRange = dynamic_cast< SwVbaRange* >( Range.get() );
+ if( !pRange )
+ throw uno::RuntimeException();
+ uno::Reference< text::XTextRange > xTextRange = pRange->getXTextRange();
+ uno::Reference< text::XTextRangeCompare > xTRC( mxTextCursor->getText(), uno::UNO_QUERY_THROW );
+ if( xTRC->compareRegionStarts( xTextRange, getXTextRange() ) >= 0 && xTRC->compareRegionEnds( xTextRange, getXTextRange() ) <= 0 )
+ return sal_True;
+ return sal_False;
+}
+
+uno::Any SAL_CALL
+SwVbaRange::Revisions( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextRange > xTextRange = getXTextRange();
+ uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaRevisions( mxParent, mxContext, xModel, xTextRange ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
+SwVbaRange::Sections( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextRange > xTextRange = getXTextRange();
+ uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaSections( mxParent, mxContext, xModel, xTextRange ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
+SwVbaRange::Fields( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ //FIXME: should be get the field in current range
+ uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaFields( mxParent, mxContext, xModel ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
rtl::OUString&
SwVbaRange::getServiceImplName()
{
@@ -343,3 +434,4 @@ SwVbaRange::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx
index 1f1b3a3bbc8b..e2a623630cb8 100644
--- a/sw/source/ui/vba/vbarange.hxx
+++ b/sw/source/ui/vba/vbarange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,8 @@
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <ooo/vba/word/XStyle.hpp>
+#include <ooo/vba/word/XListFormat.hpp>
+#include "wordvbahelper.hxx"
typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRange > SwVbaRange_BASE;
@@ -48,29 +51,29 @@ private:
private:
void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd ) throw (css::uno::RuntimeException);
+ void GetStyleInfo(rtl::OUString& aStyleName, rtl::OUString& aStyleType ) throw ( css::uno::RuntimeException );
public:
SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException);
SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException);
SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, const css::uno::Reference< css::text::XText >& rText, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException);
virtual ~SwVbaRange();
- css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; }
+ css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; }
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() throw (css::uno::RuntimeException);
-#ifdef TOMORROW
- void setXTextRange( const css::uno::Reference< css::text::XTextRange >& xRange ) throw (css::uno::RuntimeException);
-#endif
- css::uno::Reference< css::text::XText > getXText() { return mxText; }
+ css::uno::Reference< css::text::XText > getXText() const { return mxText; }
void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; }
+ void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException);
// Attribute
virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
virtual void SAL_CALL setText( const rtl::OUString& rText ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException);
virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException);
- virtual css::uno::Reference< ooo::vba::word::XStyle > SAL_CALL getStyle() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setStyle( const css::uno::Reference< ooo::vba::word::XStyle >& _xStyle ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() throw (css::uno::RuntimeException);
// Methods
virtual void SAL_CALL InsertBreak( const css::uno::Any& _breakType ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
@@ -84,9 +87,15 @@ public:
virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_RANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarangehelper.cxx b/sw/source/ui/vba/vbarangehelper.cxx
index 4fd9e5f143f1..8e4d1f348e02 100644
--- a/sw/source/ui/vba/vbarangehelper.cxx
+++ b/sw/source/ui/vba/vbarangehelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,6 +28,7 @@
#include "vbarangehelper.hxx"
#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XBookmarksSupplier.hpp>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -111,7 +113,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
DebugHelper::exception(e);
}
- if( !bGotTextCursor )
+ if( !bGotTextCursor || !xTextCursor.is() )
{
try
{
@@ -125,7 +127,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
}
}
- if( !bGotTextCursor )
+ if( !bGotTextCursor || !xTextCursor.is() )
{
try
{
@@ -169,3 +171,30 @@ sal_Int32 SwVbaRangeHelper::getPosition( const uno::Reference< text::XText >& rT
return nPosition;
}
+
+uno::Reference< text::XTextContent > SwVbaRangeHelper::findBookmarkByPosition( const uno::Reference< text::XTextDocument >& xTextDoc, const uno::Reference< text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException )
+{
+ uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( xTextDoc, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndexAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW );
+ for( sal_Int32 index = 0; index < xIndexAccess->getCount(); index++ )
+ {
+ uno::Reference< text::XTextContent > xBookmark( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xBkAnchor = xBookmark->getAnchor();
+ uno::Reference< text::XTextRangeCompare > xCompare( xBkAnchor->getText(), uno::UNO_QUERY_THROW );
+ if( xCompare->compareRegionStarts( xBkAnchor->getStart(), xBkAnchor->getEnd() ) == 0 )
+ {
+ try
+ {
+ if( xCompare->compareRegionStarts( xTextRange, xBkAnchor->getStart() ) == 0 )
+ return xBookmark;
+ }
+ catch( uno::Exception& )
+ {
+ continue;
+ }
+ }
+ }
+ return uno::Reference< text::XTextContent >();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarangehelper.hxx b/sw/source/ui/vba/vbarangehelper.hxx
index 71bdf20f94a2..29758fd5a55b 100644
--- a/sw/source/ui/vba/vbarangehelper.hxx
+++ b/sw/source/ui/vba/vbarangehelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include <vbahelper/vbahelperinterface.hxx>
#include <com/sun/star/text/XTextViewCursor.hpp>
#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
class SwVbaRangeHelper
{
@@ -38,6 +41,9 @@ public:
static void insertString( css::uno::Reference< css::text::XTextRange >& rTextRange, css::uno::Reference< css::text::XText >& rText, const rtl::OUString& rStr, sal_Bool _bAbsorb ) throw ( css::uno::RuntimeException );
static css::uno::Reference< css::text::XTextCursor > initCursor( const css::uno::Reference< css::text::XTextRange >& rTextRange, const css::uno::Reference< css::text::XText >& rText ) throw ( css::uno::RuntimeException );
static sal_Int32 getPosition( const css::uno::Reference< css::text::XText >& rText, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw ( css::uno::RuntimeException );
+ static css::uno::Reference< css::text::XTextContent > findBookmarkByPosition( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, const css::uno::Reference< css::text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException );
};
#endif /* SW_VBA_RANGEHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbareplacement.cxx b/sw/source/ui/vba/vbareplacement.cxx
index 81f2bb193412..2cc874f17ed6 100644
--- a/sw/source/ui/vba/vbareplacement.cxx
+++ b/sw/source/ui/vba/vbareplacement.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,6 +51,12 @@ void SAL_CALL SwVbaReplacement::setText( const ::rtl::OUString& _text ) throw (u
mxPropertyReplace->setReplaceString( _text );
}
+void SAL_CALL SwVbaReplacement::ClearFormatting( ) throw (uno::RuntimeException)
+{
+ uno::Sequence< beans::PropertyValue > aPropValues;
+ mxPropertyReplace->setReplaceAttributes( aPropValues );
+}
+
rtl::OUString&
SwVbaReplacement::getServiceImplName()
{
@@ -69,3 +76,4 @@ SwVbaReplacement::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbareplacement.hxx b/sw/source/ui/vba/vbareplacement.hxx
index b257fb7a3abc..020265cf2c41 100644
--- a/sw/source/ui/vba/vbareplacement.hxx
+++ b/sw/source/ui/vba/vbareplacement.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,8 +48,13 @@ public:
virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
+ //Methods
+ virtual void SAL_CALL ClearFormatting() throw (css::uno::RuntimeException);
+
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_REPLACEMENT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarevision.cxx b/sw/source/ui/vba/vbarevision.cxx
new file mode 100644
index 000000000000..5c1f0e841bce
--- /dev/null
+++ b/sw/source/ui/vba/vbarevision.cxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbarevision.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/document/XRedlinesSupplier.hpp>
+#include "wordvbahelper.hxx"
+#include <docsh.hxx>
+#include <doc.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaRevision::SwVbaRevision( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xRedlineProps ) throw ( uno::RuntimeException ) : SwVbaRevision_BASE( rParent, rContext ), mxModel( xModel ), mxRedlineProps( xRedlineProps )
+{
+}
+
+SwVbaRevision::~SwVbaRevision()
+{
+}
+
+sal_Int32 SwVbaRevision::GetPosition() throw (css::uno::RuntimeException)
+{
+ sal_Int32 nPos = -1;
+ uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW );
+ sal_Int32 nCount = xRedlines->getCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ uno::Reference< beans::XPropertySet > xProps( xRedlines->getByIndex( i ), uno::UNO_QUERY_THROW );
+ if( xProps == mxRedlineProps )
+ {
+ nPos = i;
+ OSL_TRACE(" SwVbaRevision::SwVbaRevision, the redline position is %d, ", nPos );
+ break;
+ }
+ }
+ if( nPos == -1 )
+ throw uno::RuntimeException();
+
+ return nPos;
+}
+
+void SAL_CALL
+SwVbaRevision::Accept() throw ( css::uno::RuntimeException )
+{
+ SwDoc* pDoc = word::getDocShell( mxModel )->GetDoc();
+ if( pDoc )
+ pDoc->AcceptRedline( GetPosition(), sal_True );
+}
+
+void SAL_CALL
+SwVbaRevision::Reject( ) throw ( css::uno::RuntimeException )
+{
+ SwDoc* pDoc = word::getDocShell( mxModel )->GetDoc();
+ if( pDoc )
+ pDoc->RejectRedline( GetPosition(), sal_True );
+}
+
+rtl::OUString&
+SwVbaRevision::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRevision") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaRevision::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Revision" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarevision.hxx b/sw/source/ui/vba/vbarevision.hxx
new file mode 100644
index 000000000000..1ecadcd1f6bc
--- /dev/null
+++ b/sw/source/ui/vba/vbarevision.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_REVISION_HXX
+#define SW_VBA_REVISION_HXX
+
+#include <ooo/vba/word/XRevision.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRevision > SwVbaRevision_BASE;
+
+class SwVbaRevision : public SwVbaRevision_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::beans::XPropertySet > mxRedlineProps;
+
+private:
+ sal_Int32 GetPosition() throw (css::uno::RuntimeException);
+
+public:
+ SwVbaRevision( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& xRedlineProps ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaRevision();
+
+ // Methods
+ virtual void SAL_CALL Accept( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Reject( ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_REVISION_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarevisions.cxx b/sw/source/ui/vba/vbarevisions.cxx
new file mode 100644
index 000000000000..e9ebc7e3b473
--- /dev/null
+++ b/sw/source/ui/vba/vbarevisions.cxx
@@ -0,0 +1,188 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbarevisions.hxx"
+#include "vbarevision.hxx"
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/document/XRedlinesSupplier.hpp>
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > RevisionEnumeration_BASE;
+typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > RevisionCollectionHelper_BASE;
+typedef std::vector< uno::Reference< beans::XPropertySet > > RevisionMap;
+
+class RedlinesEnumeration : public RevisionEnumeration_BASE
+{
+ RevisionMap mRevisionMap;
+ RevisionMap::iterator mIt;
+public:
+ RedlinesEnumeration( const RevisionMap& sMap ) : mRevisionMap( sMap ), mIt( mRevisionMap.begin() ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( mIt != mRevisionMap.end() );
+ }
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasMoreElements() )
+ throw container::NoSuchElementException();
+ uno::Reference< beans::XPropertySet > xRevision( *mIt++ );
+ return uno::makeAny( xRevision ) ;
+ }
+};
+
+class RevisionCollectionHelper : public RevisionCollectionHelper_BASE
+{
+ RevisionMap mRevisionMap;
+public:
+RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException);
+
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return beans::XPropertySet::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return ( !mRevisionMap.empty() ); }
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return mRevisionMap.size(); }
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw lang::IndexOutOfBoundsException();
+
+ return uno::makeAny( mRevisionMap[ Index ] );
+
+ }
+ // XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new RedlinesEnumeration( mRevisionMap );
+ }
+};
+
+RevisionCollectionHelper::RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException)
+ {
+ uno::Reference< text::XTextRangeCompare > xTRC( xTextRange->getText(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW );
+ sal_Int32 nCount = xRedlines->getCount();
+ for( sal_Int32 index = 0; index < nCount; index++ )
+ {
+ uno::Reference< text::XTextRange > xRedlineRange( xRedlines->getByIndex( index ), uno::UNO_QUERY_THROW );
+ if( xTRC->compareRegionStarts( xTextRange, xRedlineRange ) >= 0 && xTRC->compareRegionEnds( xTextRange, xRedlineRange ) <= 0 )
+ {
+ uno::Reference< beans::XPropertySet > xRedlineProps( xRedlineRange, uno::UNO_QUERY_THROW );
+ mRevisionMap.push_back( xRedlineProps );
+ }
+ }
+ }
+class RevisionsEnumeration : public EnumerationHelperImpl
+{
+ uno::Reference< frame::XModel > m_xModel;
+public:
+ RevisionsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ), m_xModel( xModel ) {}
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ uno::Reference< beans::XPropertySet > xRevision( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XRevision > ( new SwVbaRevision( m_xParent, m_xContext, m_xModel, xRevision ) ) );
+ }
+
+};
+
+SwVbaRevisions::SwVbaRevisions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ): SwVbaRevisions_BASE( xParent, xContext, new RevisionCollectionHelper( xModel, xTextRange ) ), mxModel( xModel )
+{
+}
+
+SwVbaRevisions::SwVbaRevisions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< container::XIndexAccess >& xIndexAccess ): SwVbaRevisions_BASE( xParent, xContext, xIndexAccess ), mxModel( xModel )
+{
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaRevisions::getElementType() throw (uno::RuntimeException)
+{
+ return word::XRevision::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaRevisions::createEnumeration() throw (uno::RuntimeException)
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
+ return new RevisionsEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel );
+}
+
+uno::Any
+SwVbaRevisions::createCollectionObject( const css::uno::Any& aSource )
+{
+ uno::Reference< beans::XPropertySet > xRevision( aSource, uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XRevision > ( new SwVbaRevision( this, mxContext, mxModel, xRevision ) ) );
+}
+
+void SAL_CALL SwVbaRevisions::AcceptAll( ) throw (css::uno::RuntimeException)
+{
+ // First we need to put all the redline into a vector, because if the redline is accepted,
+ // it will auto delete in the document.
+ std::vector< uno::Reference< word::XRevision > > aRevisions;
+ uno::Reference< container::XEnumeration > xEnumeration = createEnumeration();
+ while( xEnumeration->hasMoreElements() )
+ {
+ uno::Reference< word::XRevision > xRevision( xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ aRevisions.push_back( xRevision );
+ }
+
+ std::vector< uno::Reference< word::XRevision > >::iterator it = aRevisions.begin();
+ for( ; it != aRevisions.end(); ++it )
+ {
+ uno::Reference< word::XRevision > xRevision( *it );
+ xRevision->Accept();
+ }
+}
+
+void SAL_CALL SwVbaRevisions::RejectAll( ) throw (css::uno::RuntimeException)
+{
+ throw uno::RuntimeException();
+}
+
+rtl::OUString&
+SwVbaRevisions::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRevisions") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaRevisions::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Revisions") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarevisions.hxx b/sw/source/ui/vba/vbarevisions.hxx
new file mode 100644
index 000000000000..142bf8987b48
--- /dev/null
+++ b/sw/source/ui/vba/vbarevisions.hxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_PANES_HXX
+#define SW_VBA_PANES_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XRevisions.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextRange.hpp>
+
+
+typedef CollTestImplHelper< ooo::vba::word::XRevisions > SwVbaRevisions_BASE;
+
+class SwVbaRevisions : public SwVbaRevisions_BASE
+{
+private:
+ css::uno::Reference< css::frame::XModel > mxModel;
+
+public:
+ SwVbaRevisions( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange );
+
+ SwVbaRevisions( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+ virtual ~SwVbaRevisions() {}
+
+ // Methods
+ virtual void SAL_CALL AcceptAll( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL RejectAll( ) throw (css::uno::RuntimeException);
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaRevisions_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_PANES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarow.cxx b/sw/source/ui/vba/vbarow.cxx
new file mode 100644
index 000000000000..7199b99f4ba7
--- /dev/null
+++ b/sw/source/ui/vba/vbarow.cxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbarow.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <ooo/vba/word/WdRowHeightRule.hpp>
+#include <ooo/vba/word/WdConstants.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "wordvbahelper.hxx"
+#include "vbatablehelper.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaRow::SwVbaRow( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext,const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( uno::RuntimeException ) :
+ SwVbaRow_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnIndex( nIndex )
+{
+ mxTableRows = mxTextTable->getRows();
+ mxRowProps.set( mxTableRows->getByIndex( mnIndex ), uno::UNO_QUERY_THROW );
+}
+
+SwVbaRow::~SwVbaRow()
+{
+}
+
+uno::Any SAL_CALL SwVbaRow::getHeight() throw (css::uno::RuntimeException)
+{
+ if( getHeightRule() == word::WdRowHeightRule::wdRowHeightAuto )
+ return uno::makeAny( sal_Int32( word::WdConstants::wdUndefined ) );
+
+ sal_Int32 nHeight = 0;
+ mxRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ) ) >>= nHeight;
+ return uno::makeAny( (float)Millimeter::getInPoints( nHeight ) );
+}
+
+void SAL_CALL SwVbaRow::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException)
+{
+ float height = 0;
+ _height >>= height;
+
+ sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( height );
+ mxRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ), uno::makeAny( nHeight ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaRow::getHeightRule() throw (css::uno::RuntimeException)
+{
+ sal_Bool isAutoHeight = sal_False;
+ mxRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoHeight") ) ) >>= isAutoHeight;
+ return isAutoHeight ? word::WdRowHeightRule::wdRowHeightAuto : word::WdRowHeightRule::wdRowHeightExactly;
+}
+
+void SAL_CALL SwVbaRow::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException)
+{
+ sal_Bool isAutoHeight = ( _heightrule == word::WdRowHeightRule::wdRowHeightAuto );
+ mxRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoHeight") ), uno::makeAny( isAutoHeight ) );
+}
+
+void SAL_CALL
+SwVbaRow::Select( ) throw ( uno::RuntimeException )
+{
+ SelectRow( getCurrentWordDoc(mxContext), mxTextTable, mnIndex, mnIndex );
+}
+
+void SwVbaRow::SelectRow( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow ) throw ( uno::RuntimeException )
+{
+ rtl::OUStringBuffer aRangeName;
+ aRangeName.appendAscii("A").append(sal_Int32( nStartRow + 1 ) );
+ SwVbaTableHelper aTableHelper( xTextTable );
+ sal_Int32 nColCount = aTableHelper.getTabColumnsCount( nEndRow );
+ // FIXME: the column count > 26
+ //sal_Char cCol = 'A' + nColCount - 1;
+ rtl::OUString sCol = aTableHelper.getColumnStr( nColCount - 1);
+ aRangeName.appendAscii(":").append( sCol ).append( sal_Int32( nEndRow + 1 ) );
+
+ uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW );
+ rtl::OUString sSelRange = aRangeName.makeStringAndClear();
+ uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( sSelRange );
+
+ uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelection->select( uno::makeAny( xSelRange ) );
+}
+
+void SAL_CALL SwVbaRow::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException)
+{
+ setHeightRule( heightrule );
+ setHeight( uno::makeAny( height ) );
+}
+
+rtl::OUString&
+SwVbaRow::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRow") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaRow::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Row" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarow.hxx b/sw/source/ui/vba/vbarow.hxx
new file mode 100644
index 000000000000..e4cf51f4e99a
--- /dev/null
+++ b/sw/source/ui/vba/vbarow.hxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_ROW_HXX
+#define SW_VBA_ROW_HXX
+
+#include <ooo/vba/word/XRow.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/table/XTableRows.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRow > SwVbaRow_BASE;
+
+class SwVbaRow : public SwVbaRow_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ css::uno::Reference< css::table::XTableRows > mxTableRows;
+ css::uno::Reference< css::beans::XPropertySet > mxRowProps;
+ sal_Int32 mnIndex;
+
+public:
+ SwVbaRow( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaRow();
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException);
+
+ static void SelectRow( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_ROW_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
new file mode 100644
index 000000000000..7b1f93925106
--- /dev/null
+++ b/sw/source/ui/vba/vbarows.cxx
@@ -0,0 +1,368 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbarows.hxx"
+#include "vbarow.hxx"
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <ooo/vba/word/WdRowAlignment.hpp>
+#include <ooo/vba/word/WdConstants.hpp>
+#include <ooo/vba/word/WdRulerStyle.hpp>
+#include "wordvbahelper.hxx"
+#include "vbacolumns.hxx"
+#include "vbatablehelper.hxx"
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+class RowsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::WeakReference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< text::XTextTable > mxTextTable;
+ uno::Reference< container::XIndexAccess > mxIndexAccess;
+ sal_Int32 nIndex;
+
+public:
+ RowsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< text::XTextTable >& xTextTable ) : mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), nIndex( 0 )
+ {
+ mxIndexAccess.set( mxTextTable->getRows(), uno::UNO_QUERY );
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( nIndex < mxIndexAccess->getCount() )
+ {
+ return uno::makeAny( uno::Reference< word::XRow > ( new SwVbaRow( mxParent, mxContext, mxTextTable, nIndex++ ) ) );
+ }
+ throw container::NoSuchElementException();
+ }
+};
+
+SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows )
+{
+ mnStartRowIndex = 0;
+ mnEndRowIndex = m_xIndexAccess->getCount() - 1;
+}
+
+SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows, sal_Int32 nStarIndex, sal_Int32 nEndIndex ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows ), mnStartRowIndex( nStarIndex ), mnEndRowIndex( nEndIndex )
+{
+ if( mnEndRowIndex < mnStartRowIndex )
+ throw uno::RuntimeException();
+}
+
+/**
+ * get the alignment of the rows: SO format com.sun.star.text.HoriOrientation
+ * is mapped to WdRowAlignment in Word
+ * @return the alignment
+ */
+::sal_Int32 SAL_CALL SwVbaRows::getAlignment() throw (uno::RuntimeException)
+{
+ sal_Int16 nAlignment = text::HoriOrientation::LEFT;
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ) ) >>= nAlignment;
+ sal_Int32 nRet = 0;
+ switch( nAlignment )
+ {
+ case text::HoriOrientation::CENTER:
+ {
+ nRet = word::WdRowAlignment::wdAlignRowCenter;
+ break;
+ }
+ case text::HoriOrientation::RIGHT:
+ {
+ nRet = word::WdRowAlignment::wdAlignRowRight;
+ break;
+ }
+ default:
+ {
+ nRet = word::WdRowAlignment::wdAlignRowLeft;
+ }
+ }
+ return nRet;
+}
+
+void SAL_CALL SwVbaRows::setAlignment( ::sal_Int32 _alignment ) throw (uno::RuntimeException)
+{
+ sal_Int16 nAlignment = text::HoriOrientation::LEFT;
+ switch( _alignment )
+ {
+ case word::WdRowAlignment::wdAlignRowCenter:
+ {
+ nAlignment = text::HoriOrientation::CENTER;
+ break;
+ }
+ case word::WdRowAlignment::wdAlignRowRight:
+ {
+ nAlignment = text::HoriOrientation::RIGHT;
+ break;
+ }
+ default:
+ {
+ nAlignment = text::HoriOrientation::LEFT;
+ }
+ }
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ), uno::makeAny( nAlignment ) );
+}
+
+uno::Any SAL_CALL SwVbaRows::getAllowBreakAcrossPages() throw (uno::RuntimeException)
+{
+ sal_Bool bAllowBreak = sal_False;
+ uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW );
+ for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index )
+ {
+ uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
+ sal_Bool bSplit = sal_False;
+ xRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ) ) >>= bSplit;
+ if( index == 0 )
+ {
+ bAllowBreak = bSplit;
+ }
+ if( bSplit != bAllowBreak )
+ {
+ sal_Int32 nRet = word::WdConstants::wdUndefined;
+ return uno::makeAny( nRet );
+ }
+ }
+ return uno::makeAny( bAllowBreak );
+}
+
+void SAL_CALL SwVbaRows::setAllowBreakAcrossPages( const uno::Any& _allowbreakacrosspages ) throw (uno::RuntimeException)
+{
+ sal_Bool bAllowBreak = sal_False;
+ _allowbreakacrosspages >>= bAllowBreak;
+ uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW );
+ for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index )
+ {
+ uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
+ xRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ), uno::makeAny( bAllowBreak ) );
+ }
+}
+
+float SAL_CALL SwVbaRows::getSpaceBetweenColumns() throw (uno::RuntimeException)
+{
+ // just get the first spacing of the first cell
+ uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( 0, mnStartRowIndex ), uno::UNO_QUERY_THROW );
+ sal_Int32 nLeftBorderDistance = 0;
+ sal_Int32 nRightBorderDistance = 0;
+ xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ) ) >>= nLeftBorderDistance;
+ xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ) ) >>= nRightBorderDistance;
+ return static_cast< float >( Millimeter::getInPoints( nLeftBorderDistance + nRightBorderDistance ) );
+}
+
+void SAL_CALL SwVbaRows::setSpaceBetweenColumns( float _spacebetweencolumns ) throw (uno::RuntimeException)
+{
+ sal_Int32 nSpace = Millimeter::getInHundredthsOfOneMillimeter( _spacebetweencolumns ) / 2;
+ uno::Reference< container::XIndexAccess > xColumnAccess( mxTextTable->getColumns(), uno::UNO_QUERY_THROW );
+ uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW );
+ SwVbaTableHelper aTableHelper( mxTextTable );
+ for( sal_Int32 row = mnStartRowIndex; row <= mnEndRowIndex; ++row )
+ {
+ sal_Int32 nColumns = aTableHelper.getTabColumnsCount( row );
+ for( sal_Int32 column = 0; column < nColumns; ++column )
+ {
+ uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( column, row ), uno::UNO_QUERY_THROW );
+ xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ), uno::makeAny( nSpace ) );
+ xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ), uno::makeAny( nSpace ) );
+ }
+ }
+}
+
+void SAL_CALL SwVbaRows::Delete( ) throw (uno::RuntimeException)
+{
+ mxTableRows->removeByIndex( mnStartRowIndex, getCount() );
+}
+
+void SAL_CALL SwVbaRows::SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle ) throw (uno::RuntimeException)
+{
+ uno::Reference< word::XColumns > xColumns( new SwVbaColumns( getParent(), mxContext, mxTextTable, mxTextTable->getColumns() ) );
+ sal_Int32 nIndent = (sal_Int32)( LeftIndent );
+ switch( RulerStyle )
+ {
+ case word::WdRulerStyle::wdAdjustFirstColumn:
+ {
+ setIndentWithAdjustFirstColumn( xColumns, nIndent );
+ break;
+ }
+ case word::WdRulerStyle::wdAdjustNone:
+ {
+ setIndentWithAdjustNone( nIndent );
+ break;
+ }
+ case word::WdRulerStyle::wdAdjustProportional:
+ {
+ setIndentWithAdjustProportional( xColumns, nIndent );
+ break;
+ }
+ case word::WdRulerStyle::wdAdjustSameWidth:
+ {
+ setIndentWithAdjustSameWidth( xColumns, nIndent );
+ break;
+ }
+ default:
+ {
+ DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
+ }
+ }
+}
+
+void SwVbaRows::setIndentWithAdjustNone( sal_Int32 indent ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ sal_Int32 nMargin = 0;
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ) ) >>= nMargin;
+ nMargin += indent;
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ), uno::makeAny( nMargin ) );
+}
+
+ void SwVbaRows::setIndentWithAdjustFirstColumn( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException)
+ {
+ sal_Int32 nIndex = 1;
+ uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
+ uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( nIndex ), uno::Any() ), uno::UNO_QUERY_THROW );
+ sal_Int32 nWidth = xColumn->getWidth();
+ nWidth -= indent;
+ xColumn->setWidth( nWidth );
+ setIndentWithAdjustNone( indent );
+ }
+
+ void SwVbaRows::setIndentWithAdjustProportional( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException)
+ {
+ // calculate the new width and get the proportion between old and new
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ sal_Int32 nWidth = 0;
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
+ sal_Int32 nNewWidth = nWidth - indent;
+ double propFactor = (double)nNewWidth/(double)nWidth;
+
+ // get all columns, calculate and set the new width of the columns
+ uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
+ sal_Int32 nColCount = xCol->getCount();
+ for( sal_Int32 i = 0; i < nColCount; i++ )
+ {
+ uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW );
+ sal_Int32 nColWidth = xColumn->getWidth();
+ sal_Int32 nNewColWidth = ( sal_Int32 )( propFactor * nColWidth );
+ xColumn->setWidth( nNewColWidth );
+ }
+
+ // set the width and position of the table
+ setIndentWithAdjustNone( indent );
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) );
+ }
+
+ void SwVbaRows::setIndentWithAdjustSameWidth( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException)
+ {
+ // calculate the new width and get the width of all columns
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ sal_Int32 nWidth = 0;
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
+ sal_Int32 nNewWidth = nWidth - indent;
+
+ // get all columns, calculate and set the new width of the columns
+ uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
+ sal_Int32 nColCount = xCol->getCount();
+ sal_Int32 nNewColWidth = (sal_Int32)( double( nNewWidth )/nColCount );
+ for( sal_Int32 i = 0; i < nColCount; i++ )
+ {
+ uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW );
+ xColumn->setWidth( nNewColWidth );
+ }
+
+ // set the width and position of the table
+ setIndentWithAdjustNone( indent );
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) );
+ }
+
+void SAL_CALL SwVbaRows::Select( ) throw (uno::RuntimeException)
+{
+ SwVbaRow::SelectRow( getCurrentWordDoc(mxContext), mxTextTable, mnStartRowIndex, mnEndRowIndex );
+}
+
+::sal_Int32 SAL_CALL SwVbaRows::getCount() throw (uno::RuntimeException)
+{
+ return ( mnEndRowIndex - mnStartRowIndex + 1 );
+}
+
+uno::Any SAL_CALL SwVbaRows::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
+{
+ sal_Int32 nIndex = 0;
+ if( ( Index1 >>= nIndex ) == sal_True )
+ {
+ if( nIndex <= 0 || nIndex > getCount() )
+ {
+ throw lang::IndexOutOfBoundsException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+ }
+ return uno::makeAny( uno::Reference< word::XRow >( new SwVbaRow( this, mxContext, mxTextTable, nIndex - 1 ) ) );
+ }
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaRows::getElementType() throw (uno::RuntimeException)
+{
+ return word::XRow::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaRows::createEnumeration() throw (uno::RuntimeException)
+{
+ return new RowsEnumWrapper( this, mxContext, mxTextTable );
+}
+
+uno::Any
+SwVbaRows::createCollectionObject( const uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaRows::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRows") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+SwVbaRows::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Rows") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbarows.hxx b/sw/source/ui/vba/vbarows.hxx
new file mode 100644
index 000000000000..eb310dc0e1e6
--- /dev/null
+++ b/sw/source/ui/vba/vbarows.hxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_ROWS_HXX
+#define SW_VBA_ROWS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XRows.hpp>
+#include <ooo/vba/word/XColumns.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/table/XTableRows.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XRows > SwVbaRows_BASE;
+
+class SwVbaRows : public SwVbaRows_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ css::uno::Reference< css::table::XTableRows > mxTableRows;
+ sal_Int32 mnStartRowIndex;
+ sal_Int32 mnEndRowIndex;
+
+private:
+ void setIndentWithAdjustNone( sal_Int32 indent ) throw (css::uno::RuntimeException);
+ void setIndentWithAdjustFirstColumn( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException);
+ void setIndentWithAdjustProportional( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException);
+ void setIndentWithAdjustSameWidth( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException);
+
+public:
+ SwVbaRows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableRows >& xTableRows ) throw ( css::uno::RuntimeException );
+ SwVbaRows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableRows >& xTableRows, sal_Int32 nStarIndex, sal_Int32 nEndIndex ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaRows() {}
+
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getAlignment() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAlignment( ::sal_Int32 _alignment ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getAllowBreakAcrossPages() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAllowBreakAcrossPages( const css::uno::Any& _allowbreakacrosspages ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getSpaceBetweenColumns() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSpaceBetweenColumns( float _spacebetweencolumns ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+
+ //XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException );
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaRows_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_ROWS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasection.cxx b/sw/source/ui/vba/vbasection.cxx
index 2e685fbb1676..6ca39e55dbfd 100644
--- a/sw/source/ui/vba/vbasection.cxx
+++ b/sw/source/ui/vba/vbasection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,7 @@
#include <vbahelper/vbahelper.hxx>
#include <tools/diagnose_ex.h>
#include "vbapagesetup.hxx"
+#include "vbaheadersfooters.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -50,14 +52,20 @@ void SAL_CALL SwVbaSection::setProtectedForForms( ::sal_Bool /*_protectedforform
{
}
-uno::Any SAL_CALL SwVbaSection::Headers( ) throw (uno::RuntimeException)
+uno::Any SAL_CALL SwVbaSection::Headers( const uno::Any& index ) throw (uno::RuntimeException)
{
- return uno::Any();
+ uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, sal_True ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
}
-uno::Any SAL_CALL SwVbaSection::Footers( ) throw (uno::RuntimeException)
+uno::Any SAL_CALL SwVbaSection::Footers( const uno::Any& index ) throw (uno::RuntimeException)
{
- return uno::Any();
+ uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, sal_False ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
}
uno::Any SAL_CALL
@@ -85,3 +93,4 @@ SwVbaSection::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasection.hxx b/sw/source/ui/vba/vbasection.hxx
index 90a2972c2f52..648d03cfbe00 100644
--- a/sw/source/ui/vba/vbasection.hxx
+++ b/sw/source/ui/vba/vbasection.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,8 +49,8 @@ public:
virtual void SAL_CALL setProtectedForForms( ::sal_Bool _protectedforforms ) throw (css::uno::RuntimeException);
// Methods
- virtual css::uno::Any SAL_CALL Headers( ) throw (css::uno::RuntimeException);
- virtual css::uno::Any SAL_CALL Footers( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Headers( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Footers( const css::uno::Any& index ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
// XHelperInterface
@@ -57,3 +58,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_SECTION_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasections.cxx b/sw/source/ui/vba/vbasections.cxx
index c0f887f0f249..ab1a4cd04787 100644
--- a/sw/source/ui/vba/vbasections.cxx
+++ b/sw/source/ui/vba/vbasections.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,6 +88,15 @@ public:
}
}
+ SectionCollectionHelper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel )
+ {
+ // Hacky implementation of Range.Sections, only support 1 secction
+ uno::Reference< beans::XPropertySet > xRangeProps( xTextRange, uno::UNO_QUERY_THROW );
+ uno::Reference< style::XStyle > xStyle = word::getCurrentPageStyle( mxModel, xRangeProps );
+ uno::Reference< beans::XPropertySet > xPageProps( xStyle, uno::UNO_QUERY_THROW );
+ mxSections.push_back( xPageProps );
+ }
+
~SectionCollectionHelper(){}
// XIndexAccess
@@ -134,6 +144,10 @@ SwVbaSections::SwVbaSections( const uno::Reference< XHelperInterface >& xParent,
{
}
+SwVbaSections::SwVbaSections( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ): SwVbaSections_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new SectionCollectionHelper( xParent, xContext, xModel, xTextRange ) ) ), mxModel( xModel )
+{
+}
+
uno::Any SAL_CALL
SwVbaSections::PageSetup( ) throw (uno::RuntimeException)
{
@@ -184,3 +198,5 @@ SwVbaSections::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasections.hxx b/sw/source/ui/vba/vbasections.hxx
index 3204689af5d8..6aa6fd83dced 100644
--- a/sw/source/ui/vba/vbasections.hxx
+++ b/sw/source/ui/vba/vbasections.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include <ooo/vba/word/XSections.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
#include <vbahelper/vbahelperinterface.hxx>
typedef CollTestImplHelper< ooo::vba::word::XSections > SwVbaSections_BASE;
@@ -42,6 +44,7 @@ private:
public:
SwVbaSections( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel );
+ SwVbaSections( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange );
virtual ~SwVbaSections() {}
// XEnumerationAccess
@@ -57,3 +60,5 @@ public:
};
#endif /* SW_VBA_SECTIONS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index 2143cd079a93..3b115ad4c7bd 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include <tools/diagnose_ex.h>
#include "vbarange.hxx"
#include "vbafind.hxx"
-#include "wordvbahelper.hxx"
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTableCursor.hpp>
@@ -41,14 +41,19 @@
#include <ooo/vba/word/WdGoToDirection.hpp>
#include <ooo/vba/word/XBookmark.hpp>
#include <ooo/vba/word/XApplication.hpp>
+#include <ooo/vba/word/WdCollapseDirection.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include "unotbl.hxx"
#include "unocoll.hxx"
#include "vbatable.hxx"
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/view/XViewCursor.hpp>
+#include <com/sun/star/view/XLineCursor.hpp>
+#include <com/sun/star/text/XWordCursor.hpp>
+#include <com/sun/star/text/XParagraphCursor.hpp>
#include <ooo/vba/word/WdInformation.hpp>
#include <ooo/vba/word/WdHeaderFooterIndex.hpp>
+#include <ooo/vba/word/WdSeekView.hpp>
#include "vbainformationhelper.hxx"
#include "vbafield.hxx"
#include "vbaheaderfooter.hxx"
@@ -56,6 +61,16 @@
#include <vbahelper/vbashaperange.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
+#include "vbarows.hxx"
+#include "vbacolumns.hxx"
+#include "vbatablehelper.hxx"
+#include "vbacells.hxx"
+#include "vbaview.hxx"
+#include "vbaparagraph.hxx"
+#include "vbastyle.hxx"
+#include <docsh.hxx>
+#include <tblenum.hxx>
+#include <fesh.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -123,23 +138,25 @@ SwVbaSelection::HomeKey( const uno::Any& _unit, const uno::Any& _extend ) throw
sal_Int32 nExtend = word::WdMovementType::wdMove;
_unit >>= nUnit;
_extend >>= nExtend;
+ sal_Bool bExtend = ( nExtend == word::WdMovementType::wdExtend ) ? sal_True : sal_False;
switch( nUnit )
{
case word::WdUnits::wdStory:
{
+ // go to the valid text first so that the current view cursor is valid to call gotoRange.
+ word::gotoSelectedObjectAnchor(mxModel);
// go to the begin of the document
- rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToStartOfDoc"));
- dispatchRequests( mxModel,url );
- // If something is selected, it needs to go twice
- dispatchRequests( mxModel,url );
+ uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel );
+ uno::Reference< text::XTextRange > xFirstRange = word::getFirstObjectPosition( xCurrentText );
+ mxTextViewCursor->gotoRange( xFirstRange, bExtend );
break;
}
case word::WdUnits::wdLine:
{
// go to the begin of the Line
- rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToStartOfLine"));
- dispatchRequests( mxModel,url );
+ uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ xLineCursor->gotoStartOfLine( bExtend );
break;
}
default:
@@ -157,23 +174,25 @@ SwVbaSelection::EndKey( const uno::Any& _unit, const uno::Any& _extend ) throw (
sal_Int32 nExtend = word::WdMovementType::wdMove;
_unit >>= nUnit;
_extend >>= nExtend;
+ sal_Bool bExtend = ( nExtend == word::WdMovementType::wdExtend ) ? sal_True : sal_False;
switch( nUnit )
{
case word::WdUnits::wdStory:
{
+ // go to the valid text first so that the current view cursor is valid to call gotoRange.
+ word::gotoSelectedObjectAnchor(mxModel);
// go to the end of the document
- rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToEndOfDoc"));
- dispatchRequests( mxModel,url );
- // If something is selected, it needs to go twice
- dispatchRequests( mxModel,url );
+ uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel );
+ uno::Reference< text::XTextRange > xEnd = xCurrentText->getEnd();
+ mxTextViewCursor->gotoRange( xEnd, bExtend );
break;
}
case word::WdUnits::wdLine:
{
// go to the end of the Line
- rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToEndOfLine"));
- dispatchRequests( mxModel,url );
+ uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ xLineCursor->gotoEndOfLine( bExtend );
break;
}
default:
@@ -185,14 +204,161 @@ SwVbaSelection::EndKey( const uno::Any& _unit, const uno::Any& _extend ) throw (
}
void SAL_CALL
-SwVbaSelection::Delete( const uno::Any& /*_unit*/, const uno::Any& /*_count*/ ) throw ( uno::RuntimeException )
+SwVbaSelection::Delete( const uno::Any& _unit, const uno::Any& _count ) throw ( uno::RuntimeException )
{
- // FIXME: handle the arguments: _unit and _count
+ sal_Int32 nUnit = word::WdUnits::wdLine;
+ sal_Int32 nCount = 0;
+ if( _count.hasValue() )
+ _count >>= nCount;
+ if( _unit.hasValue() && ( nCount > 0 ) )
+ {
+ _unit >>= nUnit;
+ switch( nUnit )
+ {
+ case word::WdUnits::wdCharacter:
+ {
+ if( HasSelection() )
+ nCount--;
+ mxTextViewCursor->goRight( nCount, sal_True );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ }
+ }
rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Delete"));
dispatchRequests( mxModel,url );
}
-void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw ( uno::RuntimeException )
+void
+SwVbaSelection::Move( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend, word::E_DIRECTION eDirection ) throw ( uno::RuntimeException )
+{
+ sal_Int32 nUnit = word::WdUnits::wdCharacter;
+ sal_Int32 nCount = 1;
+ sal_Int32 nExtend = word::WdMovementType::wdMove;
+
+ if( _unit.hasValue() )
+ _unit >>= nUnit;
+ if( _count.hasValue() )
+ _count >>= nCount;
+ if( _extend.hasValue() )
+ _extend >>= nExtend;
+
+ if( nCount == 0 )
+ return;
+
+ sal_Bool bExpand = ( nExtend == word::WdMovementType::wdMove ) ? sal_False : sal_True;
+
+ switch( nUnit )
+ {
+ case word::WdUnits::wdCell:
+ {
+ if( nExtend == word::WdMovementType::wdExtend )
+ {
+ DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
+ return;
+ }
+ NextCell( nCount, eDirection );
+ break;
+ }
+ case word::WdUnits::wdLine:
+ {
+ if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ if( eDirection == word::MOVE_UP )
+ xViewCursor->goUp( nCount, bExpand );
+ else if( eDirection == word::MOVE_DOWN )
+ xViewCursor->goDown( nCount, bExpand );
+ break;
+ }
+ case word::WdUnits::wdCharacter:
+ {
+ if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ if( word::gotoSelectedObjectAnchor( mxModel ) )
+ {
+ nCount--;
+ }
+ uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ if( eDirection == word::MOVE_LEFT )
+ {
+ // if current select is a cellrange or table,
+ // the first count of move should move to the first selected cell.
+ uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
+ if ( xTextTableCursor.is() )
+ {
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextTable > xTextTable;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable;
+ if( xTextTable.is() )
+ {
+ uno::Reference< text::XTextRange > xRange( xTextTable->getCellByName( xTextTableCursor->getRangeName()), uno::UNO_QUERY_THROW );
+ mxTextViewCursor->gotoRange( xRange->getStart(), bExpand );
+ nCount--;
+ }
+ }
+ xViewCursor->goLeft( nCount, bExpand );
+ }
+ else if( eDirection == word::MOVE_RIGHT )
+ xViewCursor->goRight( nCount, bExpand );
+ break;
+ }
+ case word::WdUnits::wdWord:
+ case word::WdUnits::wdParagraph:
+ {
+ uno::Reference< text::XTextRange > xRange = GetSelectedRange();
+ uno::Reference< text::XText > xText = xRange->getText();
+ uno::Reference< text::XTextCursor > xTextCursor = xText->createTextCursorByRange( xRange );
+ if( nUnit == word::WdUnits::wdParagraph )
+ {
+ if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ uno::Reference< text::XParagraphCursor > xParagraphCursor( xTextCursor, uno::UNO_QUERY_THROW );
+ for( sal_Int32 i=0; i<nCount; i++ )
+ {
+ if( ( eDirection == word::MOVE_UP ) && ( xParagraphCursor->gotoPreviousParagraph( bExpand ) == sal_False ) )
+ break;
+ else if( ( eDirection == word::MOVE_DOWN ) && ( xParagraphCursor->gotoNextParagraph( bExpand ) == sal_False ) )
+ break;
+ }
+ }
+ else if( nUnit == word::WdUnits::wdWord )
+ {
+ if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ }
+ uno::Reference< text::XWordCursor > xWordCursor( xTextCursor, uno::UNO_QUERY_THROW );
+ for( sal_Int32 i=0; i<nCount; i++ )
+ {
+ if( (eDirection == word::MOVE_LEFT ) && ( xWordCursor->gotoPreviousWord( bExpand ) == sal_False ) )
+ break;
+ else if( ( eDirection == word::MOVE_RIGHT ) && ( xWordCursor->gotoNextWord( bExpand ) == sal_False ) )
+ break;
+ }
+ }
+ mxTextViewCursor->gotoRange( xTextCursor->getStart(), sal_False );
+ mxTextViewCursor->gotoRange( xTextCursor->getEnd(), sal_True );
+ break;
+ }
+ default:
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ break;
+ }
+ }
+}
+
+void SwVbaSelection::NextCell( sal_Int32 nCount, word::E_DIRECTION eDirection ) throw ( uno::RuntimeException )
{
uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextTable > xTextTable;
@@ -211,22 +377,22 @@ void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw
// move the table cursor
switch( eDirection )
{
- case MOVE_LEFT:
+ case word::MOVE_LEFT:
{
xTextTableCursor->goLeft( nCount, sal_False );
break;
}
- case MOVE_RIGHT:
+ case word::MOVE_RIGHT:
{
xTextTableCursor->goRight( nCount, sal_False );
break;
}
- case MOVE_UP:
+ case word::MOVE_UP:
{
xTextTableCursor->goUp( nCount, sal_False );
break;
}
- case MOVE_DOWN:
+ case word::MOVE_DOWN:
{
xTextTableCursor->goDown( nCount, sal_False );
break;
@@ -245,61 +411,29 @@ void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw
void SAL_CALL
SwVbaSelection::MoveRight( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException )
{
- sal_Int32 nUnit = word::WdUnits::wdCharacter;
sal_Int32 nCount = 1;
- sal_Int32 nExtend = word::WdMovementType::wdMove;
- if( _unit.hasValue() )
- _unit >>= nUnit;
if( _count.hasValue() )
_count >>= nCount;
- if( _extend.hasValue() )
- _extend >>= nExtend;
if( nCount == 0 )
return;
if( nCount < 0 )
{
- // TODO: call MoveLeft;
MoveLeft( _unit, uno::makeAny( -nCount ), _extend );
return;
}
- switch( nUnit )
- {
- case word::WdUnits::wdCell:
- {
- if( nExtend == word::WdMovementType::wdExtend )
- {
- DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
- return;
- }
- NextCell( nCount, MOVE_RIGHT );
- break;
- }
- default:
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
- break;
- }
- }
-
+ Move( _unit, _count, _extend, word::MOVE_RIGHT );
}
void SAL_CALL
SwVbaSelection::MoveLeft( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException )
{
- sal_Int32 nUnit = word::WdUnits::wdCharacter;
sal_Int32 nCount = 1;
- sal_Int32 nExtend = word::WdMovementType::wdMove;
-
- if( _unit.hasValue() )
- _unit >>= nUnit;
if( _count.hasValue() )
_count >>= nCount;
- if( _extend.hasValue() )
- _extend >>= nExtend;
if( nCount == 0 )
return;
@@ -310,67 +444,47 @@ SwVbaSelection::MoveLeft( const uno::Any& _unit, const uno::Any& _count, const u
return;
}
- switch( nUnit )
- {
- case word::WdUnits::wdCell:
- {
- if( nExtend == word::WdMovementType::wdExtend )
- {
- DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
- return;
- }
- NextCell( nCount, MOVE_LEFT );
- break;
- }
- default:
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
- break;
- }
- }
-
+ Move( _unit, _count, _extend, word::MOVE_LEFT );
}
void SAL_CALL
SwVbaSelection::MoveDown( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException )
{
- sal_Int32 nUnit = word::WdUnits::wdCharacter;
sal_Int32 nCount = 1;
- sal_Int32 nExtend = word::WdMovementType::wdMove;
- if( _unit.hasValue() )
- _unit >>= nUnit;
if( _count.hasValue() )
_count >>= nCount;
- if( _extend.hasValue() )
- _extend >>= nExtend;
if( nCount == 0 )
return;
if( nCount < 0 )
{
- // TODO: call MoveLeft;
- //MoveUp( _unit, uno::makeAny( -nCount ), _extend );
+ MoveUp( _unit, uno::makeAny( -nCount ), _extend );
return;
}
- switch( nUnit )
+ Move( _unit, _count, _extend, word::MOVE_DOWN );
+}
+
+void SAL_CALL
+SwVbaSelection::MoveUp( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException )
+{
+ sal_Int32 nCount = 1;
+
+ if( _count.hasValue() )
+ _count >>= nCount;
+
+ if( nCount == 0 )
+ return;
+
+ if( nCount < 0 )
{
- case word::WdUnits::wdLine:
- {
- uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
- sal_Bool bExpand = ( nExtend == word::WdMovementType::wdMove ) ? sal_False : sal_True;
- xViewCursor->goDown( nCount, bExpand );
- break;
- }
- default:
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
- break;
- }
+ MoveDown( _unit, uno::makeAny( -nCount ), _extend );
+ return;
}
+ Move( _unit, _count, _extend, word::MOVE_UP );
}
void SAL_CALL
@@ -422,16 +536,17 @@ SwVbaSelection::getFind() throw ( uno::RuntimeException )
return uno::Reference< word::XFind >( new SwVbaFind( this, mxContext, mxModel, xTextRange ) );
}
-uno::Reference< word::XStyle > SAL_CALL
+uno::Any SAL_CALL
SwVbaSelection::getStyle() throw ( uno::RuntimeException )
{
return getRange()->getStyle();
}
void SAL_CALL
-SwVbaSelection::setStyle( const uno::Reference< word::XStyle >& rStyle ) throw ( uno::RuntimeException )
+SwVbaSelection::setStyle( const uno::Any& rStyle ) throw ( uno::RuntimeException )
{
- return getRange()->setStyle( rStyle );
+ uno::Reference< beans::XPropertySet > xParaProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ return SwVbaStyle::setStyle( xParaProps, rStyle );
}
uno::Reference< word::XFont > SAL_CALL
@@ -460,7 +575,6 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w
uno::Reference< word::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
uno::Reference< word::XBookmark > xBookmark( xApplication->getActiveDocument()->Bookmarks(_name), uno::UNO_QUERY_THROW );
xBookmark->Select();
- //return uno::Reference< word::XRange >( xBookmark->Range(), uno::UNO_QUERY_THROW );
break;
}
case word::WdGoToItem::wdGoToPage:
@@ -474,39 +588,79 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w
sal_Int32 nWhich = 0;
if( _which.hasValue() )
_which >>= nWhich;
- sal_Int32 nPage = 0;
- switch( nWhich )
- {
- case word::WdGoToDirection::wdGoToLast:
- {
- nPage = nLastPage;
- break;
- }
- case word::WdGoToDirection::wdGoToNext:
- {
- nPage = nCurrPage + 1;
- break;
- }
- case word::WdGoToDirection::wdGoToPrevious:
- {
- nPage = nCurrPage - 1;
- break;
- }
- default:
- {
- nPage = nCount;
- }
- }
- if( nPage <= 0 )
- nPage = 1;
- if( nPage > nLastPage )
- nPage = nLastPage;
- xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) );
- break;
+ sal_Int32 nPage = 0;
+ switch( nWhich )
+ {
+ case word::WdGoToDirection::wdGoToLast:
+ {
+ nPage = nLastPage;
+ break;
+ }
+ case word::WdGoToDirection::wdGoToNext:
+ {
+ if( nCount !=0 )
+ nPage = nCurrPage + nCount;
+ else
+ nPage = nCurrPage + 1;
+ break;
+ }
+ case word::WdGoToDirection::wdGoToPrevious:
+ {
+ if( nCount !=0 )
+ nPage = nCurrPage - nCount;
+ else
+ nPage = nCurrPage - 1;
+ break;
+ }
+ default:
+ {
+ nPage = nCount;
+ }
+ }
+ if( _name.hasValue() )
+ {
+ rtl::OUString sName;
+ _name >>= sName;
+ sal_Int32 nName = sName.toInt32();
+ if( nName !=0 )
+ nPage = nName;
+ }
+ if( nPage <= 0 )
+ nPage = 1;
+ if( nPage > nLastPage )
+ nPage = nLastPage;
+ xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) );
+ break;
}
case word::WdGoToItem::wdGoToSection:
{
- // TODO: implement Section object
+ uno::Reference< text::XPageCursor > xPageCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ sal_Int32 nCount = 0;
+ if( _count.hasValue() )
+ _count >>= nCount;
+ sal_Int32 nWhich = 0;
+ if( _which.hasValue() )
+ _which >>= nWhich;
+ sal_Int32 nPage = 0;
+ switch( nWhich )
+ {
+ case word::WdGoToDirection::wdGoToAbsolute:
+ {
+ // currently only support this type
+ if( nCount == 1 )
+ nPage = 1;
+ break;
+ }
+ default:
+ {
+ nPage = 0;
+ }
+ }
+ if( nPage != 0 )
+ xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) );
+ else
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ break;
}
default:
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
@@ -527,8 +681,6 @@ void SAL_CALL SwVbaSelection::setLanguageID( ::sal_Int32 _languageid ) throw (un
uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::RuntimeException)
{
uno::Any result;
- //uno::Reference< view::XSelectionSupplier > xSel( mxModel->getCurrentController(), uno::UNO_QUERY_THROW );
- //uno::Any aSelectedObject = xSel->getSelection();
switch( _type )
{
case word::WdInformation::wdActiveEndPageNumber:
@@ -546,11 +698,85 @@ uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::Run
result = uno::makeAny( SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( mxModel, mxTextViewCursor ) );
break;
}
+ case word::WdInformation::wdWithInTable:
+ {
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextTable > xTextTable;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable;
+ if( xTextTable.is() )
+ result = uno::makeAny( sal_True );
+ else
+ result = uno::makeAny( sal_False );
+ break;
+ }
+ case word::WdInformation::wdHeaderFooterType:
+ {
+ uno::Reference< word::XView > xView( new SwVbaView( this, mxContext, mxModel ) );
+ sal_Int32 nView = xView->getSeekView();
+ sal_Int32 nHeaderFooterType = 0;
+ switch( nView )
+ {
+ case word::WdSeekView::wdSeekMainDocument:
+ {
+ nHeaderFooterType = -1; // not in a header or footer
+ break;
+ }
+ case word::WdSeekView::wdSeekEvenPagesHeader:
+ {
+ nHeaderFooterType = 0; // even page header
+ break;
+ }
+ case word::WdSeekView::wdSeekPrimaryHeader:
+ {
+ nHeaderFooterType = 1; // odd page header
+ break;
+ }
+ case word::WdSeekView::wdSeekEvenPagesFooter:
+ {
+ nHeaderFooterType = 2; // even page footer
+ break;
+ }
+ case word::WdSeekView::wdSeekPrimaryFooter:
+ {
+ nHeaderFooterType = 3; // odd page footer
+ break;
+ }
+ case word::WdSeekView::wdSeekFirstPageHeader:
+ case word::WdSeekView::wdSeekFirstPageFooter:
+ {
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ rtl::OUString aPageStyleName;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName;
+ sal_Bool bFirstPage = sal_False;
+ if( aPageStyleName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "First Page" ) ) )
+ bFirstPage = sal_True;
+ if( nView == word::WdSeekView::wdSeekFirstPageHeader )
+ {
+ if( bFirstPage )
+ nHeaderFooterType = 4;
+ else
+ nHeaderFooterType = 1;
+ }
+ else
+ {
+ if( bFirstPage )
+ nHeaderFooterType = 5;
+ else
+ nHeaderFooterType = 3;
+ }
+ break;
+ }
+ default:
+ {
+ nHeaderFooterType = -1;
+ }
+ }
+ result = uno::makeAny( nHeaderFooterType );
+ break;
+ }
default:
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
}
- // This method fails to restore the previouse selection
- //xSel->select( aSelectedObject );
return result;
}
@@ -566,11 +792,6 @@ SwVbaSelection::Tables( const uno::Any& aIndex ) throw (uno::RuntimeException)
// we can only support a selection that is a single table
if ( !aIndex.hasValue() ) // currently we can't support multiple tables in a selection
throw uno::RuntimeException();
- // if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw
- uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
-
- if ( !xTextTableCursor.is() )
- throw uno::RuntimeException();
sal_Int32 nIndex = 0;
aIndex >>= nIndex;
@@ -579,6 +800,24 @@ SwVbaSelection::Tables( const uno::Any& aIndex ) throw (uno::RuntimeException)
if ( nIndex != 1 )
throw uno::RuntimeException();
+
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextTable > xTextTable;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable;
+ if( xTextTable.is() )
+ {
+ uno::Reference< css::text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< word::XTable > xVBATbl = new SwVbaTable( mxParent, mxContext, xTextDoc, xTextTable );
+ aRet <<= xVBATbl;
+ return aRet;
+ }
+
+ // if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw
+ uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
+
+ if ( !xTextTableCursor.is() )
+ throw uno::RuntimeException();
+
SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() );
if ( pTTCursor )
{
@@ -608,15 +847,14 @@ SwVbaSelection::Fields( const uno::Any& index ) throw (uno::RuntimeException)
uno::Reference< word::XHeaderFooter > SAL_CALL
SwVbaSelection::getHeaderFooter() throw ( uno::RuntimeException )
{
- uno::Reference< text::XText > xCurrentText = word::getXTextViewCursor( mxModel )->getText();
- if( HeaderFooterHelper::isHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isFooter( mxModel, xCurrentText ) )
+ if( HeaderFooterHelper::isHeaderFooter( mxModel ) )
{
uno::Reference< beans::XPropertySet > xPageStyleProps( word::getCurrentPageStyle( mxModel ), uno::UNO_QUERY_THROW );
sal_Int32 nIndex = word::WdHeaderFooterIndex::wdHeaderFooterPrimary;
- sal_Bool isHeader = HeaderFooterHelper::isHeader( mxModel, xCurrentText );
- if( HeaderFooterHelper::isEvenPagesHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isEvenPagesFooter( mxModel, xCurrentText ) )
+ sal_Bool isHeader = HeaderFooterHelper::isHeader( mxModel );
+ if( HeaderFooterHelper::isEvenPagesHeader( mxModel ) || HeaderFooterHelper::isEvenPagesFooter( mxModel ) )
nIndex = word::WdHeaderFooterIndex::wdHeaderFooterEvenPages;
- else if( HeaderFooterHelper::isFirstPageHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isFirstPageFooter( mxModel, xCurrentText ) )
+ else if( HeaderFooterHelper::isFirstPageHeader( mxModel ) || HeaderFooterHelper::isFirstPageFooter( mxModel ) )
nIndex = word::WdHeaderFooterIndex::wdHeaderFooterFirstPage;
return uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, xPageStyleProps, isHeader, nIndex ) );
@@ -629,9 +867,13 @@ uno::Any SAL_CALL
SwVbaSelection::ShapeRange( ) throw (uno::RuntimeException)
{
uno::Reference< drawing::XShapes > xShapes( mxModel->getCurrentSelection(), uno::UNO_QUERY );
-
if ( !xShapes.is() )
- throw uno::RuntimeException();
+ {
+ uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW );
+ xShapes->add( xShape );
+ }
uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxModel, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XDrawPage > xDrawPage = xDrawPageSupplier->getDrawPage();
@@ -658,6 +900,281 @@ void SAL_CALL SwVbaSelection::setEnd( ::sal_Int32 _end ) throw (uno::RuntimeExce
getRange()->setEnd( _end );
}
+void SAL_CALL SwVbaSelection::SelectRow() throw (uno::RuntimeException)
+{
+ uno::Reference< word::XRows > xRows( Rows( uno::Any() ), uno::UNO_QUERY_THROW );
+ xRows->Select();
+}
+
+void SAL_CALL SwVbaSelection::SelectColumn() throw (uno::RuntimeException)
+{
+ uno::Reference< word::XColumns > xColumns( Columns( uno::Any() ), uno::UNO_QUERY_THROW );
+ xColumns->Select();
+}
+
+uno::Any SAL_CALL SwVbaSelection::Rows( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ rtl::OUString sTLName;
+ rtl::OUString sBRName;
+ GetSelectedCellRange( sTLName, sBRName );
+
+ sal_Int32 nStartRow = 0;
+ sal_Int32 nEndRow = 0;
+ uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
+ SwVbaTableHelper aTableHelper( xTextTable );
+ nStartRow = aTableHelper.getTabRowIndex( sTLName );
+ if( sBRName.getLength() > 0 )
+ {
+ nEndRow = aTableHelper.getTabRowIndex( sBRName );
+ }
+ else
+ {
+ nEndRow = nStartRow;
+ }
+
+ uno::Reference< XCollection > xCol( new SwVbaRows( this, mxContext, xTextTable, xTextTable->getRows(), nStartRow, nEndRow ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL SwVbaSelection::Columns( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ rtl::OUString sTLName;
+ rtl::OUString sBRName;
+ GetSelectedCellRange( sTLName, sBRName );
+ sal_Int32 nStartColumn = 0;
+ sal_Int32 nEndColumn = 0;
+
+ uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
+ SwVbaTableHelper aTableHelper( xTextTable );
+ nStartColumn = aTableHelper.getTabColIndex( sTLName );
+ if( sBRName.getLength() > 0 )
+ {
+ nEndColumn = aTableHelper.getTabColIndex( sBRName );
+ }
+ else
+ {
+ nEndColumn = nStartColumn;
+ }
+
+ uno::Reference< XCollection > xCol( new SwVbaColumns( this, mxContext, xTextTable, xTextTable->getColumns(), nStartColumn, nEndColumn ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Reference< text::XTextTable > SwVbaSelection::GetXTextTable() throw( uno::RuntimeException )
+{
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextTable > xTextTable;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable;
+ return xTextTable;
+}
+
+sal_Bool SwVbaSelection::IsInTable() throw( uno::RuntimeException )
+{
+ uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
+ if( xTextTable.is() )
+ return sal_True;
+ return sal_False;
+}
+
+sal_Bool SwVbaSelection::HasSelection() throw( uno::RuntimeException )
+{
+ uno::Reference< text::XTextRange > xStart = mxTextViewCursor->getStart();
+ uno::Reference< text::XTextRange > xEnd = mxTextViewCursor->getEnd();
+ uno::Reference< text::XTextRangeCompare > xTRC( mxTextViewCursor->getText(), uno::UNO_QUERY_THROW );
+ if( xTRC->compareRegionStarts( xStart, xEnd ) == 0 && xTRC->compareRegionEnds( xStart, xEnd ) == 0 )
+ return sal_False;
+ return sal_True;
+}
+
+void SwVbaSelection::GetSelectedCellRange( rtl::OUString& sTLName, rtl::OUString& sBRName ) throw( uno::RuntimeException )
+{
+ uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextTable > xTextTable;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable;
+ if( !xTextTable.is() )
+ throw uno::RuntimeException( );
+
+ uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
+ if( xTextTableCursor.is() )
+ {
+ String sRange( xTextTableCursor->getRangeName() );
+ if( sRange.GetTokenCount(':') > 0 )
+ {
+ sTLName = sRange.GetToken(0, ':');
+ sBRName = sRange.GetToken(1, ':');
+ }
+ }
+ if( !sTLName.getLength() )
+ {
+ uno::Reference< table::XCell > xCell;
+ xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cell") ) ) >>= xCell;
+ if( !xCell.is() )
+ {
+ throw uno::RuntimeException( );
+ }
+ uno::Reference< beans::XPropertySet > xCellProps( xCell, uno::UNO_QUERY_THROW );
+ xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellName") ) ) >>= sTLName;
+ }
+}
+
+uno::Any SAL_CALL SwVbaSelection::Cells( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ rtl::OUString sTLName;
+ rtl::OUString sBRName;
+ GetSelectedCellRange( sTLName, sBRName );
+ sal_Int32 nLeft = 0;
+ sal_Int32 nTop = 0;
+ sal_Int32 nRight = 0;
+ sal_Int32 nBottom = 0;
+
+ uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
+ SwVbaTableHelper aTableHelper( xTextTable );
+ nLeft = aTableHelper.getTabColIndex( sTLName );
+ nTop = aTableHelper.getTabRowIndex( sTLName );
+ if( sBRName.getLength() > 0 )
+ {
+ nRight = aTableHelper.getTabColIndex( sBRName );
+ nBottom = aTableHelper.getTabRowIndex( sBRName );
+ }
+ else
+ {
+ nRight = nLeft;
+ nBottom = nTop;
+ }
+
+ uno::Reference< XCollection > xCol( new SwVbaCells( this, mxContext, xTextTable, nLeft, nTop, nRight, nBottom ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+void SAL_CALL SwVbaSelection::Copy( ) throw (uno::RuntimeException)
+{
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Copy"));
+ dispatchRequests( mxModel,url );
+}
+
+void SAL_CALL SwVbaSelection::CopyAsPicture( ) throw (uno::RuntimeException)
+{
+ // seems not support in Writer
+ Copy();
+}
+
+void SAL_CALL SwVbaSelection::Paste( ) throw (uno::RuntimeException)
+{
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Paste"));
+ dispatchRequests( mxModel,url );
+}
+
+void SAL_CALL SwVbaSelection::Collapse( const uno::Any& Direction ) throw (uno::RuntimeException)
+{
+ if( word::gotoSelectedObjectAnchor( mxModel ) )
+ return;
+
+ sal_Int32 nDirection = word::WdCollapseDirection::wdCollapseStart;
+ if( Direction.hasValue() )
+ Direction >>= nDirection;
+
+ uno::Reference< text::XTextViewCursor > xTextViewCursor = word::getXTextViewCursor( mxModel );
+ if( nDirection == word::WdCollapseDirection::wdCollapseStart )
+ {
+ // it is inaccurate if current seleciton is multipul cells, so it needs to go to start
+ uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart();
+ xTextViewCursor->gotoRange( xTextRange, sal_False );
+ xTextViewCursor->collapseToStart();
+ }
+ else if( nDirection == word::WdCollapseDirection::wdCollapseEnd )
+ {
+ uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getEnd();
+ xTextViewCursor->gotoRange( xTextRange, sal_False );
+ xTextViewCursor->collapseToEnd();
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+void SAL_CALL SwVbaSelection::WholeStory( ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XText > xText = word::getCurrentXText( mxModel );
+ // FIXME: for i#7747,if the first line is a table, it fails to select all the contents in the story.
+ // Temporary solution, insert an empty line before the table so that it could select all the contents.
+ uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration();
+ if( xParaEnum->hasMoreElements() )
+ {
+ uno::Reference< text::XTextTable > xTextTable( xParaEnum->nextElement(), uno::UNO_QUERY );
+ if( xTextTable.is() )
+ {
+ // insert an empty line
+ uno::Reference< text::XTextRange > xFirstCellRange = word::getFirstObjectPosition( xText );
+ mxTextViewCursor->gotoRange( xFirstCellRange, sal_False );
+ rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPara"));
+ dispatchRequests( mxModel,url );
+ }
+ }
+ uno::Reference< text::XTextRange > xStart = xText->getStart();
+ uno::Reference< text::XTextRange > xEnd = xText->getEnd();
+ mxTextViewCursor->gotoRange( xStart, sal_False );
+ mxTextViewCursor->gotoRange( xEnd, sal_True );
+}
+
+::sal_Bool SAL_CALL SwVbaSelection::InRange( const uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (uno::RuntimeException)
+{
+ return getRange()->InRange( Range );
+}
+
+void SAL_CALL SwVbaSelection::SplitTable( ) throw (uno::RuntimeException)
+{
+ if( !IsInTable() )
+ throw uno::RuntimeException();
+
+ SwDocShell* pDocShell = word::getDocShell( mxModel );
+ if( pDocShell )
+ {
+ SwFEShell* pFEShell = pDocShell->GetFEShell();
+ if( pFEShell )
+ {
+ pFEShell->SplitTable( HEADLINE_CNTNTCOPY );
+ }
+ }
+}
+
+uno::Any SAL_CALL
+SwVbaSelection::Paragraphs( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ // Hacky implementation due to missing api ( and lack of knowledge )
+ // we can only support a selection that is a single paragraph
+ if ( !aIndex.hasValue() ) // currently we can't support multiple paragraphs in a selection
+ throw uno::RuntimeException();
+
+ sal_Int32 nIndex = 0;
+ aIndex >>= nIndex;
+
+ uno::Any aRet;
+
+ if ( nIndex != 1 )
+ throw uno::RuntimeException();
+
+ uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart();
+ uno::Reference< text::XText > xText = xTextRange->getText();
+ uno::Reference< text::XParagraphCursor > xParaCursor( xText->createTextCursor(), uno::UNO_QUERY_THROW );
+ xParaCursor->gotoStartOfParagraph( sal_False );
+ xParaCursor->gotoStartOfParagraph( sal_True );
+
+ uno::Reference< text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextRange > xParaRange( xParaCursor, uno::UNO_QUERY_THROW );
+ uno::Reference< word::XParagraph > xParagraph = new SwVbaParagraph( mxParent, mxContext, xTextDoc, xParaRange );
+
+ aRet <<= xParagraph;
+ return aRet;
+}
+
rtl::OUString&
SwVbaSelection::getServiceImplName()
{
@@ -677,3 +1194,4 @@ SwVbaSelection::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaselection.hxx b/sw/source/ui/vba/vbaselection.hxx
index a5079340ee19..c1a089a48a9d 100644
--- a/sw/source/ui/vba/vbaselection.hxx
+++ b/sw/source/ui/vba/vbaselection.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,11 +32,13 @@
#include <ooo/vba/word/XRange.hpp>
#include <vbahelper/vbahelperinterface.hxx>
#include <com/sun/star/text/XTextViewCursor.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
#include <ooo/vba/word/XParagraphFormat.hpp>
#include <ooo/vba/word/XFind.hpp>
#include <ooo/vba/word/XStyle.hpp>
#include <ooo/vba/word/XFont.hpp>
#include <ooo/vba/word/XHeaderFooter.hpp>
+#include "wordvbahelper.hxx"
typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XSelection > SwVbaSelection_BASE;
@@ -46,17 +49,14 @@ private:
css::uno::Reference< css::text::XTextViewCursor > mxTextViewCursor;
css::uno::Reference< ooo::vba::word::XRange > mxRange;
- enum E_DIRECTION
- {
- MOVE_LEFT = 1,
- MOVE_RIGHT,
- MOVE_UP,
- MOVE_DOWN
- };
-
private:
- void NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw ( css::uno::RuntimeException );
+ void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException);
+ void NextCell( sal_Int32 nCount, ooo::vba::word::E_DIRECTION eDirection ) throw ( css::uno::RuntimeException );
css::uno::Reference< css::text::XTextRange > GetSelectedRange() throw ( css::uno::RuntimeException );
+ void GetSelectedCellRange( rtl::OUString& sTLName, rtl::OUString& sBRName ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< css::text::XTextTable > GetXTextTable() throw ( css::uno::RuntimeException );
+ sal_Bool IsInTable() throw ( css::uno::RuntimeException );
+ sal_Bool HasSelection() throw ( css::uno::RuntimeException );
public:
SwVbaSelection( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel ) throw ( css::uno::RuntimeException );
@@ -73,6 +73,7 @@ public:
virtual void SAL_CALL MoveRight( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException);
virtual void SAL_CALL MoveLeft( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException);
virtual void SAL_CALL MoveDown( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL MoveUp( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException);
virtual void SAL_CALL TypeParagraph() throw (css::uno::RuntimeException);
virtual void SAL_CALL InsertParagraph() throw (css::uno::RuntimeException);
virtual void SAL_CALL InsertParagraphBefore() throw (css::uno::RuntimeException);
@@ -80,8 +81,8 @@ public:
virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException);
virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() throw (css::uno::RuntimeException);
- virtual css::uno::Reference< ooo::vba::word::XStyle > SAL_CALL getStyle() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setStyle( const css::uno::Reference< ooo::vba::word::XStyle >& _xStyle ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
virtual void SAL_CALL TypeBackspace() throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL GoTo( const css::uno::Any& _what, const css::uno::Any& _which, const css::uno::Any& _count, const css::uno::Any& _name ) throw (css::uno::RuntimeException);
@@ -97,9 +98,24 @@ public:
virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SelectRow() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SelectColumn() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Columns( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Cells( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Copy( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL CopyAsPicture( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Paste( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Collapse( const css::uno::Any& Direction ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL WholeStory( ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL SplitTable( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Paragraphs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_SELECTION_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx
index cf49da020284..fe701565f146 100644
--- a/sw/source/ui/vba/vbastyle.cxx
+++ b/sw/source/ui/vba/vbastyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,18 @@
#include "vbastyle.hxx"
#include <ooo/vba/word/WdStyleType.hpp>
#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
#include <i18npool/mslangid.hxx>
#include "vbafont.hxx"
#include "vbapalette.hxx"
+#include "vbaparagraphformat.hxx"
+#include "vbastyles.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-SwVbaStyle::SwVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet ) throw ( script::BasicErrorException, uno::RuntimeException ) : SwVbaStyle_BASE( xParent, xContext ) , mxStyleProps( _xPropertySet )
+SwVbaStyle::SwVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel>& xModel, const uno::Reference< beans::XPropertySet >& _xPropertySet ) throw ( script::BasicErrorException, uno::RuntimeException ) : SwVbaStyle_BASE( xParent, xContext ) , mxModel( xModel ), mxStyleProps( _xPropertySet )
{
mxStyle.set( _xPropertySet, uno::UNO_QUERY_THROW );
}
@@ -84,7 +88,7 @@ void SAL_CALL SwVbaStyle::setLanguageID( ::sal_Int32 _languageid ) throw (uno::R
nType = word::WdStyleType::wdStyleTypeParagraph;
else if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.CharacterStyle") ) ) )
nType = word::WdStyleType::wdStyleTypeCharacter;
- else // if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.NumberingStyle") ) ) )
+ else
nType = word::WdStyleType::wdStyleTypeList;
return nType;
}
@@ -96,10 +100,31 @@ SwVbaStyle::getFont() throw ( uno::RuntimeException )
return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), mxStyleProps );
}
-void SwVbaStyle::setStyle( const uno::Reference< beans::XPropertySet >& xTCProps, const uno::Reference< ooo::vba::word::XStyle >& xStyle )throw (uno::RuntimeException)
+
+void SAL_CALL SwVbaStyle::LinkToListTemplate( const uno::Reference< word::XListTemplate >& /*ListTemplate*/, const uno::Any& /*ListLevelNumber*/ ) throw (uno::RuntimeException)
+{
+}
+
+void SwVbaStyle::setStyle( const uno::Reference< beans::XPropertySet >& xParaProps, const uno::Any& rStyle )throw (uno::RuntimeException)
{
- rtl::OUString aStyleType = getOOoStyleTypeFromMSWord( xStyle->getType() );
- xTCProps->setPropertyValue( aStyleType, uno::makeAny( xStyle->getName() ) );
+ rtl::OUString sStyle;
+ uno::Reference< word::XStyle > xStyle;
+ if( rStyle >>= xStyle )
+ {
+ sStyle = xStyle->getName();
+ }
+ else
+ {
+ rStyle >>= sStyle;
+ }
+
+ if( sStyle.getLength() )
+ {
+ xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaStyleName") ), uno::makeAny( sStyle ) );
+ return;
+ }
+
+ throw uno::RuntimeException();
}
rtl::OUString SwVbaStyle::getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType )
@@ -129,6 +154,115 @@ rtl::OUString SwVbaStyle::getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType )
return aStyleType;
}
+::rtl::OUString SAL_CALL SwVbaStyle::getNameLocal() throw (uno::RuntimeException)
+{
+ rtl::OUString sNameLocal;
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName") ) ) >>= sNameLocal;
+ return sNameLocal;
+}
+
+void SAL_CALL SwVbaStyle::setNameLocal( const ::rtl::OUString& _namelocal ) throw (uno::RuntimeException)
+{
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName") ), uno::makeAny( _namelocal ) );
+}
+
+uno::Reference< word::XParagraphFormat > SAL_CALL SwVbaStyle::getParagraphFormat() throw (uno::RuntimeException)
+{
+ if( word::WdStyleType::wdStyleTypeParagraph == getType() )
+ {
+ uno::Reference< text::XTextDocument > xTextDocument( mxModel, uno::UNO_QUERY_THROW );
+ return uno::Reference< word::XParagraphFormat >( new SwVbaParagraphFormat( this, mxContext, xTextDocument, mxStyleProps ) );
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+ return uno::Reference< word::XParagraphFormat >();
+}
+
+::sal_Bool SAL_CALL SwVbaStyle::getAutomaticallyUpdate() throw (uno::RuntimeException)
+{
+ sal_Bool isAutoUpdate = sal_False;
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoUpdate") ) ) >>= isAutoUpdate;
+ return isAutoUpdate;
+}
+
+void SAL_CALL SwVbaStyle::setAutomaticallyUpdate( ::sal_Bool _automaticallyupdate ) throw (uno::RuntimeException)
+{
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoUpdate") ), uno::makeAny( _automaticallyupdate ) );
+}
+
+uno::Any SAL_CALL SwVbaStyle::getBaseStyle() throw (uno::RuntimeException)
+{
+ // ParentStyle
+ rtl::OUString sBaseStyle;
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParentStyle") ) ) >>= sBaseStyle;
+ if( sBaseStyle.getLength() > 0 )
+ {
+ uno::Reference< XCollection > xCol( new SwVbaStyles( this, mxContext, mxModel ) );
+ return xCol->Item( uno::makeAny( sBaseStyle ), uno::Any() );
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+ return uno::Any();
+}
+
+void SAL_CALL SwVbaStyle::setBaseStyle( const uno::Any& _basestyle ) throw (uno::RuntimeException)
+{
+ uno::Reference< word::XStyle > xStyle;
+ _basestyle >>= xStyle;
+ if( xStyle.is() )
+ {
+ rtl::OUString sBaseStyle = xStyle->getName();
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParentStyle") ), uno::makeAny( sBaseStyle ) );
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+uno::Any SAL_CALL SwVbaStyle::getNextParagraphStyle() throw (uno::RuntimeException)
+{
+ //FollowStyle
+ rtl::OUString sFollowStyle;
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FollowStyle") ) ) >>= sFollowStyle;
+ if( sFollowStyle.getLength() > 0 )
+ {
+ uno::Reference< XCollection > xCol( new SwVbaStyles( this, mxContext, mxModel ) );
+ return xCol->Item( uno::makeAny( sFollowStyle ), uno::Any() );
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+ return uno::Any();
+}
+
+void SAL_CALL SwVbaStyle::setNextParagraphStyle( const uno::Any& _nextparagraphstyle ) throw (uno::RuntimeException)
+{
+ uno::Reference< word::XStyle > xStyle;
+ _nextparagraphstyle >>= xStyle;
+ if( xStyle.is() )
+ {
+ rtl::OUString sFollowStyle = xStyle->getName();
+ mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FollowStyle") ), uno::makeAny( sFollowStyle ) );
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+::sal_Int32 SAL_CALL SwVbaStyle::getListLevelNumber() throw (uno::RuntimeException)
+{
+ sal_Int16 nNumberingLevel = 0;
+ mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingLevel") ) ) >>= nNumberingLevel;
+ return nNumberingLevel;
+}
+
rtl::OUString&
SwVbaStyle::getServiceImplName()
{
@@ -147,3 +281,5 @@ SwVbaStyle::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbastyle.hxx b/sw/source/ui/vba/vbastyle.hxx
index 401baa5337a1..4052a6bd8162 100644
--- a/sw/source/ui/vba/vbastyle.hxx
+++ b/sw/source/ui/vba/vbastyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <ooo/vba/word/XFont.hpp>
+#include <ooo/vba/word/XListTemplate.hpp>
typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XStyle > SwVbaStyle_BASE;
@@ -40,13 +42,14 @@ typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XStyle > SwVbaStyle_BASE;
class SwVbaStyle : public SwVbaStyle_BASE
{
private:
+ css::uno::Reference< css::frame::XModel > mxModel;
css::uno::Reference< css::beans::XPropertySet > mxStyleProps;
css::uno::Reference< css::style::XStyle > mxStyle;
public:
- SwVbaStyle( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
+ SwVbaStyle( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
virtual ~SwVbaStyle(){}
- static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, const css::uno::Reference< ooo::vba::word::XStyle >& xStyle ) throw (css::uno::RuntimeException);
+ static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::uno::Any& xStyle ) throw (css::uno::RuntimeException);
static rtl::OUString getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType );
static sal_Int32 getLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps ) throw (css::uno::RuntimeException);
static void setLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, sal_Int32 _languageid ) throw (css::uno::RuntimeException);
@@ -58,6 +61,20 @@ public:
virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException);
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL LinkToListTemplate( const css::uno::Reference< ooo::vba::word::XListTemplate >& ListTemplate, const css::uno::Any& ListLevelNumber ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getNameLocal() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setNameLocal( const ::rtl::OUString& _namelocal ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAutomaticallyUpdate() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAutomaticallyUpdate( ::sal_Bool _automaticallyupdate ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getBaseStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBaseStyle( const css::uno::Any& _basestyle ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getNextParagraphStyle() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setNextParagraphStyle( const css::uno::Any& _nextparagraphstyle ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getListLevelNumber() throw (css::uno::RuntimeException);
+
+ //XDefaultProperty
+ virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); }
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
@@ -65,3 +82,5 @@ public:
};
#endif //SW_VBA_AXIS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbastyles.cxx b/sw/source/ui/vba/vbastyles.cxx
index 371c1225cafa..cd4f353d29d4 100644
--- a/sw/source/ui/vba/vbastyles.cxx
+++ b/sw/source/ui/vba/vbastyles.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@ struct BuiltinStyleTable
sal_Int32 wdStyleType;
};
-const BuiltinStyleTable aBuiltinStyleTable[] =
+static const BuiltinStyleTable aBuiltinStyleTable[] =
{
{ word::WdBuiltinStyle::wdStyleBlockQuotation, "", word::WdStyleType::wdStyleTypeParagraph },
{ word::WdBuiltinStyle::wdStyleBodyText, "Text body", word::WdStyleType::wdStyleTypeParagraph },
@@ -152,51 +153,36 @@ const BuiltinStyleTable aBuiltinStyleTable[] =
{ 0, 0, 0 }
};
+struct MSOStyleNameTable
+{
+ const sal_Char* pMSOStyleName;
+ const sal_Char* pOOoStyleName;
+ const sal_Char* pOOoStyleType;
+};
-static uno::Sequence< rtl::OUString > getStyleTypes()
+static const MSOStyleNameTable aMSOStyleNameTable[] =
{
- uno::Sequence< rtl::OUString > aRet(3);
- rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") );
- pArray[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharacterStyles") );
- pArray[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") );
- return aRet;
-}
+ { "Normal", "Default", "ParagraphStyles" },
+ { 0, 0, 0 }
+};
typedef ::cppu::WeakImplHelper1< container::XEnumeration > StyleEnumeration_BASE;
typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > StyleCollectionHelper_BASE;
-/*
-class StylesEnumeration : public StyleEnumeration_BASE
-{
-public:
- StylesEnumeration( const SheetMap& sMap ) : mSheetMap( sMap ), mIt( mSheetMap.begin() ) {}
- virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
- {
- return ( mIt != mSheetMap.end() );
- }
- virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if ( !hasMoreElements() )
- throw container::NoSuchElementException();
- uno::Reference< sheet::XSpreadsheet > xSheet( *mIt++ );
- return uno::makeAny( xSheet ) ;
- }
-};
-*/
+
class StyleCollectionHelper : public StyleCollectionHelper_BASE
{
private:
uno::Reference< frame::XModel > mxModel;
- uno::Reference< container::XNameAccess > mxStyleFamilies;
- uno::Reference< container::XNameContainer > mxCurrentStyleFamily;
+ uno::Reference< container::XNameAccess > mxParaStyles;
uno::Any cachePos;
public:
StyleCollectionHelper( const uno::Reference< frame::XModel >& _xModel ) : mxModel( _xModel )
{
+ // we only concern about the Paragraph styles
uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( _xModel, uno::UNO_QUERY_THROW);
- mxStyleFamilies = xStyleSupplier->getStyleFamilies();
+ uno::Reference< container::XNameAccess > xStyleFamilies = xStyleSupplier->getStyleFamilies();
+ mxParaStyles.set( xStyleFamilies->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ) ), uno::UNO_QUERY_THROW );
}
- uno::Reference< container::XNameContainer > getCurrentStyleFamily(){ return mxCurrentStyleFamily; }
// XElementAccess
virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return style::XStyle::static_type(0); }
virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0; }
@@ -209,32 +195,42 @@ public:
}
virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
{
- uno::Sequence< rtl::OUString > sNames( getCount() );
- rtl::OUString* pString = sNames.getArray();
- uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes();
- sal_Int32 nCount = 0;
- for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ )
+ return mxParaStyles->getElementNames();
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+ {
+ // search in the MSOStyleName table first
+ for( const MSOStyleNameTable* pTable = aMSOStyleNameTable; pTable->pMSOStyleName != NULL; pTable++ )
{
- uno::Reference< container::XNameAccess > xNameAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW );
- uno::Sequence< rtl::OUString > sElementNames = xNameAccess->getElementNames();
- for( sal_Int32 j = 0; j < sElementNames.getLength(); j++ )
+ if( aName.equalsIgnoreAsciiCaseAscii( pTable->pMSOStyleName ) )
{
- pString[nCount++] = sElementNames[j];
+ //Found it
+ rtl::OUString sStyleName = rtl::OUString::createFromAscii( pTable->pOOoStyleName );
+ if( mxParaStyles->hasByName( sStyleName ) )
+ {
+ cachePos = mxParaStyles->getByName( sStyleName );
+ return sal_True;
+ }
+ return sal_False;
}
}
- return sNames;
- }
- virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
- {
- uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes();
- for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ )
+
+ if( mxParaStyles->hasByName( aName ) )
{
- uno::Reference< container::XNameAccess > xNameAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW );
- if( xNameAccess->hasByName( aName ) )
+ cachePos = mxParaStyles->getByName( aName );
+ return sal_True;
+ }
+ else
+ {
+ uno::Sequence< rtl::OUString > sElementNames = mxParaStyles->getElementNames();
+ for( sal_Int32 j = 0; j < sElementNames.getLength(); j++ )
{
- cachePos = xNameAccess->getByName( aName );
- mxCurrentStyleFamily.set( xNameAccess, uno::UNO_QUERY_THROW );
- return sal_True;
+ rtl::OUString aStyleName = sElementNames[j];
+ if( aStyleName.equalsIgnoreAsciiCase( aName ) )
+ {
+ cachePos = mxParaStyles->getByName( aStyleName );
+ return sal_True;
+ }
}
}
return sal_False;
@@ -243,44 +239,43 @@ public:
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
- uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes();
- sal_Int32 nCount = 0;
- for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ )
- {
- uno::Reference< container::XIndexAccess > xIndexAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW );
- nCount += xIndexAccess->getCount();
- }
- return nCount;
+ uno::Reference< container::XIndexAccess > xIndexAccess( mxParaStyles, uno::UNO_QUERY_THROW );
+ return xIndexAccess->getCount();
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
if ( Index < 0 || Index >= getCount() )
throw lang::IndexOutOfBoundsException();
- // FIXME: need to make a alphabetically sorted list of style names
- uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes();
- for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ )
- {
- uno::Reference< container::XIndexAccess > xIndexAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW );
- sal_Int32 nCount = xIndexAccess->getCount();
- if( Index >= nCount )
- Index -= nCount;
- else
- {
- mxCurrentStyleFamily.set( xIndexAccess, uno::UNO_QUERY_THROW );
- return xIndexAccess->getByIndex( Index );
- }
- }
- throw lang::IndexOutOfBoundsException();
+ uno::Reference< container::XIndexAccess > xIndexAccess( mxParaStyles, uno::UNO_QUERY_THROW );
+ return xIndexAccess->getByIndex( Index );
}
// XEnumerationAccess
virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
{
- // FIXME:
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
}
};
+class StylesEnumWrapper : public EnumerationHelper_BASE
+{
+ SwVbaStyles* pStyles;
+ sal_Int32 nIndex;
+public:
+ StylesEnumWrapper( SwVbaStyles* _pStyles ) : pStyles( _pStyles ), nIndex( 1 ) {}
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex <= pStyles->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( nIndex <= pStyles->getCount() )
+ return pStyles->Item( uno::makeAny( nIndex++ ), uno::Any() );
+ throw container::NoSuchElementException();
+ }
+};
+
SwVbaStyles::SwVbaStyles( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw ( script::BasicErrorException ) : SwVbaStyles_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new StyleCollectionHelper( xModel ) ) ), mxModel( xModel )
{
mxMSF.set( mxModel, uno::UNO_QUERY_THROW );
@@ -290,7 +285,7 @@ uno::Any
SwVbaStyles::createCollectionObject(const uno::Any& aObject)
{
uno::Reference< beans::XPropertySet > xStyleProp( aObject, uno::UNO_QUERY_THROW );
- return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProp ) ) );
+ return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProp ) ) );
}
uno::Type SAL_CALL
@@ -302,7 +297,7 @@ SwVbaStyles::getElementType() throw (uno::RuntimeException)
uno::Reference< container::XEnumeration > SAL_CALL
SwVbaStyles::createEnumeration() throw (uno::RuntimeException)
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+ return new StylesEnumWrapper( this );
}
uno::Any SAL_CALL
@@ -319,7 +314,7 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno::
rtl::OUString aStyleName = rtl::OUString::createFromAscii( pTable->pOOoStyleName );
if( aStyleName.getLength() > 0 )
{
- rtl::OUString aStyleType = SwVbaStyle::getOOoStyleTypeFromMSWord( pTable->wdStyleType );
+ rtl::OUString aStyleType;
switch( pTable->wdStyleType )
{
case word::WdStyleType::wdStyleTypeParagraph:
@@ -335,7 +330,8 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno::
}
case word::WdStyleType::wdStyleTypeList:
{
- aStyleType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") );
+ // should use Paragraph style and set the property "NumberingStyleName"
+ aStyleType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") );
break;
}
default:
@@ -344,7 +340,12 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno::
uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxModel, uno::UNO_QUERY_THROW);
uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName( aStyleType ), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xStyleProps( xStylesAccess->getByName( aStyleName ), uno::UNO_QUERY_THROW );
- return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProps ) ) );
+ // set the property "NumberingStyleName" if it is a listbullet
+ if( pTable->wdStyleType == word::WdStyleType::wdStyleTypeList )
+ {
+ xStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName") ), uno::makeAny( aStyleName ) );
+ }
+ return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProps ) ) );
}
else
{
@@ -375,3 +376,5 @@ SwVbaStyles::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbastyles.hxx b/sw/source/ui/vba/vbastyles.hxx
index 9cd2e2ff5b1a..209d58a1caa9 100644
--- a/sw/source/ui/vba/vbastyles.hxx
+++ b/sw/source/ui/vba/vbastyles.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 42d1c09ccbac..de4d8fd137c9 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,11 @@
#include <tools/string.hxx>
#include <osl/file.hxx>
#include <tools/urlobj.hxx>
-#include <tools/string.hxx>
+
+#ifdef WNT
+#include <windows.h>
+#include <tchar.h>
+#endif
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -47,13 +52,79 @@ void PrivateProfileStringListener::Initialize( const rtl::OUString& rFileName, c
maGroupName = rGroupName;
maKey = rKey;
}
+#ifdef WNT
+void lcl_getRegKeyInfo( const ByteString& sKeyInfo, HKEY& hBaseKey, ByteString& sSubKey )
+{
+ sal_Int32 nBaseKeyIndex = sKeyInfo.Search('\\');
+ if( nBaseKeyIndex > 0 )
+ {
+ ByteString sBaseKey = sKeyInfo.Copy( 0, nBaseKeyIndex );
+ sSubKey = sKeyInfo.Copy( nBaseKeyIndex + 1 );
+ if( sBaseKey.Equals("HKEY_CURRENT_USER") )
+ {
+ hBaseKey = HKEY_CURRENT_USER;
+ }
+ else if( sBaseKey.Equals("HKEY_LOCAL_MACHINE") )
+ {
+ hBaseKey = HKEY_LOCAL_MACHINE;
+ }
+ else if( sBaseKey.Equals("HKEY_CLASSES_ROOT") )
+ {
+ hBaseKey = HKEY_CLASSES_ROOT;
+ }
+ else if( sBaseKey.Equals("HKEY_USERS") )
+ {
+ hBaseKey = HKEY_USERS;
+ }
+ else if( sBaseKey.Equals("HKEY_CURRENT_CONFIG") )
+ {
+ hBaseKey = HKEY_CURRENT_CONFIG;
+ }
+ }
+}
+#endif
uno::Any PrivateProfileStringListener::getValueEvent()
{
// get the private profile string
- Config aCfg( maFileName );
- aCfg.SetGroup( maGroupName );
- rtl::OUString sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW );
+ rtl::OUString sValue;
+ if(maFileName.getLength())
+ {
+ // get key/value from a file
+ Config aCfg( maFileName );
+ aCfg.SetGroup( maGroupName );
+ sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW );
+ }
+ else
+ {
+ // get key/value from windows register
+#ifdef WNT
+ HKEY hBaseKey = NULL;
+ ByteString sSubKey;
+ sal_Int32 nBaseKeyIndex = maGroupName.Search('\\');
+ lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
+ if( hBaseKey != NULL )
+ {
+ HKEY hKey = NULL;
+ LONG lResult;
+ LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer());
+ TCHAR szBuffer[1024];
+ DWORD cbData = sizeof( szBuffer );
+ lResult = RegOpenKeyEx( hBaseKey, lpSubKey, 0, KEY_QUERY_VALUE, &hKey );
+ if( ERROR_SUCCESS == lResult )
+ {
+ LPCTSTR lpValueName = TEXT(maKey.GetBuffer());
+ lResult = RegQueryValueEx( hKey, lpValueName, NULL, NULL, (LPBYTE)szBuffer, &cbData );
+ RegCloseKey( hKey );
+ sValue = rtl::OUString::createFromAscii(szBuffer);
+ }
+ }
+
+ return uno::makeAny( sValue );
+#endif
+ throw uno::RuntimeException( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("Only support on Windows")), uno::Reference< uno::XInterface >() );
+ }
return uno::makeAny( sValue );
}
@@ -61,12 +132,44 @@ uno::Any PrivateProfileStringListener::getValueEvent()
void PrivateProfileStringListener::setValueEvent( const css::uno::Any& value )
{
// set the private profile string
- Config aCfg( maFileName );
- aCfg.SetGroup( maGroupName );
-
rtl::OUString aValue;
value >>= aValue;
- aCfg.WriteKey( maKey, ByteString( aValue.getStr(), RTL_TEXTENCODING_DONTKNOW ) );
+ if(maFileName.getLength())
+ {
+ // set value into a file
+ Config aCfg( maFileName );
+ aCfg.SetGroup( maGroupName );
+ aCfg.WriteKey( maKey, ByteString( aValue.getStr(), RTL_TEXTENCODING_DONTKNOW ) );
+ }
+ else
+ {
+ //set value into windows register
+#ifdef WNT
+ HKEY hBaseKey = NULL;
+ ByteString sSubKey;
+ sal_Int32 nBaseKeyIndex = maGroupName.Search('\\');
+ lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
+ if( hBaseKey != NULL )
+ {
+ HKEY hKey = NULL;
+ LONG lResult;
+ LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer());
+ lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL );
+ if( ERROR_SUCCESS == lResult )
+ {
+ LPCTSTR szValue = TEXT( rtl::OUStringToOString( aValue, RTL_TEXTENCODING_UTF8 ).getStr() );
+ DWORD cbData = sizeof(TCHAR) * (_tcslen(szValue) + 1);
+ LPCTSTR lpValueName = TEXT(maKey.GetBuffer());
+ lResult = RegSetValueEx( hKey, lpValueName, NULL, REG_SZ, (LPBYTE)szValue, cbData );
+ RegCloseKey( hKey );
+ }
+ }
+ return;
+#endif
+ throw uno::RuntimeException( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("Not implemented")), uno::Reference< uno::XInterface >() );
+ }
+
}
SwVbaSystem::SwVbaSystem( uno::Reference<uno::XComponentContext >& xContext ): SwVbaSystem_BASE( uno::Reference< XHelperInterface >(), xContext )
@@ -146,19 +249,19 @@ SwVbaSystem::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException)
uno::Any SAL_CALL
SwVbaSystem::PrivateProfileString( const rtl::OUString& rFilename, const rtl::OUString& rSection, const rtl::OUString& rKey ) throw ( uno::RuntimeException )
{
- if( rFilename.getLength() == 0 )
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
-
// FIXME: need to detect whether it is a relative file path
// we need to detect if this is a URL, if not then assume its a file path
rtl::OUString sFileUrl;
- INetURLObject aObj;
- aObj.SetURL( rFilename );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- if ( bIsURL )
- sFileUrl = rFilename;
- else
- osl::FileBase::getFileURLFromSystemPath( rFilename, sFileUrl);
+ if( rFilename.getLength() )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( rFilename );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ if ( bIsURL )
+ sFileUrl = rFilename;
+ else
+ osl::FileBase::getFileURLFromSystemPath( rFilename, sFileUrl);
+ }
ByteString aGroupName = ByteString( rSection.getStr(), RTL_TEXTENCODING_DONTKNOW);
ByteString aKey = ByteString( rKey.getStr(), RTL_TEXTENCODING_DONTKNOW);
@@ -185,3 +288,5 @@ SwVbaSystem::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbasystem.hxx b/sw/source/ui/vba/vbasystem.hxx
index deeb6f00fdf4..043f35f56440 100644
--- a/sw/source/ui/vba/vbasystem.hxx
+++ b/sw/source/ui/vba/vbasystem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_SYSTEM_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatable.cxx b/sw/source/ui/vba/vbatable.cxx
index 11969d6717a0..b60e9249b34e 100644
--- a/sw/source/ui/vba/vbatable.cxx
+++ b/sw/source/ui/vba/vbatable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "vbatable.hxx"
#include "vbarange.hxx"
#include <com/sun/star/frame/XModel.hpp>
@@ -9,11 +10,13 @@
#include <com/sun/star/container/XNamed.hpp>
#include "vbaborders.hxx"
#include "vbapalette.hxx"
+#include "vbarows.hxx"
+#include "vbacolumns.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-SwVbaTable::SwVbaTable( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const uno::Reference< css::text::XTextTable >& xTextTable) throw ( uno::RuntimeException ) : SwVbaTable_BASE( rParent, rContext ), mxTextDocument( rDocument )
+SwVbaTable::SwVbaTable( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& rDocument, const uno::Reference< text::XTextTable >& xTextTable) throw ( uno::RuntimeException ) : SwVbaTable_BASE( rParent, rContext ), mxTextDocument( rDocument )
{
mxTextTable.set( xTextTable, uno::UNO_QUERY_THROW );
}
@@ -75,6 +78,26 @@ SwVbaTable::Borders( const uno::Any& index ) throw (uno::RuntimeException)
return uno::makeAny( xCol );
}
+uno::Any SAL_CALL
+SwVbaTable::Rows( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< table::XTableRows > xTableRows( mxTextTable->getRows(), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaRows( this, mxContext, mxTextTable, xTableRows ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
+uno::Any SAL_CALL
+SwVbaTable::Columns( const uno::Any& index ) throw (uno::RuntimeException)
+{
+ uno::Reference< table::XTableColumns > xTableColumns( mxTextTable->getColumns(), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xCol( new SwVbaColumns( this, mxContext, mxTextTable, xTableColumns ) );
+ if ( index.hasValue() )
+ return xCol->Item( index, uno::Any() );
+ return uno::makeAny( xCol );
+}
+
// XHelperInterface
rtl::OUString&
SwVbaTable::getServiceImplName()
@@ -95,3 +118,4 @@ SwVbaTable::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatable.hxx b/sw/source/ui/vba/vbatable.hxx
index 7d913d718895..16345024381d 100644
--- a/sw/source/ui/vba/vbatable.hxx
+++ b/sw/source/ui/vba/vbatable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef SW_VBA_TABLE_HXX
#define SW_VBA_TABLE_HXX
#include <vbahelper/vbahelperinterface.hxx>
@@ -14,15 +15,20 @@ class SwVbaTable : public SwVbaTable_BASE
css::uno::Reference< css::text::XTextTable > mxTextTable;
public:
SwVbaTable( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextTable >& xTextTable) throw ( css::uno::RuntimeException);
- css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; };
+ css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; };
virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL Range( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Select( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL ConvertToText( const css::uno::Any& Separator, const css::uno::Any& NestedTables ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual rtl::OUString SAL_CALL getName( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Columns( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
new file mode 100644
index 000000000000..de37466c1853
--- /dev/null
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -0,0 +1,295 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbatablehelper.hxx"
+#include <swtable.hxx>
+#include <unotbl.hxx>
+#include <docsh.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+#define UNO_TABLE_COLUMN_SUM 10000
+
+SwVbaTableHelper::SwVbaTableHelper( const uno::Reference< text::XTextTable >& xTextTable ) throw (uno::RuntimeException) : mxTextTable( xTextTable ), pDoc( NULL )
+{
+ pTable = GetSwTable( mxTextTable );
+}
+
+SwTable* SwVbaTableHelper::GetSwTable( const uno::Reference< text::XTextTable >& xTextTable ) throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XUnoTunnel > xTunnel( xTextTable, uno::UNO_QUERY_THROW );
+ SwXTextTable* pXTextTable = reinterpret_cast< SwXTextTable * >( sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextTable::getUnoTunnelId())));
+ if( !pXTextTable )
+ throw uno::RuntimeException();
+
+ SwFrmFmt* pFrmFmt = pXTextTable->GetFrmFmt();
+ if( !pFrmFmt )
+ throw uno::RuntimeException();
+
+ SwTable* pTable = SwTable::FindTable( pFrmFmt );
+ return pTable;
+}
+
+sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRet = 0;
+ if(!pTable->IsTblComplex())
+ {
+ SwTableLines& rLines = pTable->GetTabLines();
+ SwTableLine* pLine = rLines.GetObject( nRowIndex );
+ nRet = pLine->GetTabBoxes().Count();
+ }
+ return nRet;
+}
+
+sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRet = 0;
+ //sal_Int32 nRowCount = mxTextTable->getRows()->getCount();
+ sal_Int32 nRowCount = pTable->GetTabLines().Count();
+ for( sal_Int32 index = 0; index < nRowCount; index++ )
+ {
+ sal_Int32 nColCount = getTabColumnsCount( index );
+ if( nRet < nColCount )
+ nRet = nColCount;
+ }
+ return nRet;
+}
+
+sal_Int32 SwVbaTableHelper::getTabRowIndex( const rtl::OUString& CellName ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRet = 0;
+ String sCellName(CellName);
+ SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName );
+ if( !pBox )
+ throw uno::RuntimeException();
+
+ const SwTableLine* pLine = pBox->GetUpper();
+ const SwTableLines* pLines = pLine->GetUpper()
+ ? &pLine->GetUpper()->GetTabLines() : &pTable->GetTabLines();
+ nRet = pLines->GetPos( pLine );
+ return nRet;
+}
+
+sal_Int32 SwVbaTableHelper::getTabColIndex( const rtl::OUString& CellName ) throw (uno::RuntimeException)
+{
+ sal_Int32 nRet = 0;
+ String sCellName(CellName);
+ const SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName );
+ if( !pBox )
+ throw uno::RuntimeException();
+ const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes();
+ nRet = pBoxes->GetPos( pBox );
+ return nRet;
+}
+
+rtl::OUString SwVbaTableHelper::getColumnStr( sal_Int32 nCol )
+{
+ const sal_Int32 coDiff = 52; // 'A'-'Z' 'a' - 'z'
+ sal_Int32 nCalc = 0;
+
+ String sRet;
+ do{
+ nCalc = nCol % coDiff;
+ if( nCalc >= 26 )
+ sRet.Insert( sal_Unicode('a' - 26 + nCalc ), 0 );
+ else
+ sRet.Insert( sal_Unicode('A' + nCalc ), 0 );
+
+ if( 0 == ( nCol = nCol - nCalc ) )
+ break;
+ nCol /= coDiff;
+ --nCol;
+ }while(1);
+ return sRet;
+}
+
+sal_Int32 SwVbaTableHelper::getTableWidth( ) throw (uno::RuntimeException)
+{
+ sal_Int32 nWidth = 0;
+ sal_Bool isWidthRelatvie = sal_False;
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsWidthRelative") ) ) >>= isWidthRelatvie;
+ if( isWidthRelatvie )
+ {
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RelativeWidth") ) ) >>= nWidth;
+ }
+ else
+ {
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
+ }
+ return nWidth;
+}
+
+void SwVbaTableHelper::setTableWidth( sal_Int32 _width ) throw (uno::RuntimeException)
+{
+ sal_Bool isWidthRelatvie = sal_False;
+ uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
+ xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsWidthRelative") ) ) >>= isWidthRelatvie;
+ if( isWidthRelatvie )
+ {
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RelativeWidth") ), uno::makeAny( _width ));
+ }
+ else
+ {
+ xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( _width ) );
+ }
+}
+
+SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw (css::uno::RuntimeException)
+{
+ SwTableLines& rLines = pTable->GetTabLines();
+ sal_Int32 nRowCount = rLines.Count();
+ if( nRowCount < nRow )
+ throw uno::RuntimeException();
+
+ SwTableBox* pStart = NULL;
+ SwTableLine* pLine = rLines.GetObject( nRow );
+ if( pLine->GetTabBoxes().Count() < nCol )
+ throw uno::RuntimeException();
+
+ pStart = pLine->GetTabBoxes()[ nCol ];
+
+ if( !pStart )
+ throw uno::RuntimeException();
+
+ return pStart;
+}
+
+void SwVbaTableHelper::InitTabCols( SwTabCols& rCols, const SwTableBox *pStart, sal_Bool /*bCurRowOnly*/ )
+{
+ rCols.SetLeftMin ( 0 );
+ rCols.SetLeft ( 0 );
+ rCols.SetRight ( UNO_TABLE_COLUMN_SUM );
+ rCols.SetRightMax( UNO_TABLE_COLUMN_SUM );
+ pTable->GetTabCols( rCols, pStart, sal_False, sal_False );
+}
+
+sal_Int32 SwVbaTableHelper::GetColCount( SwTabCols& rCols ) const
+{
+ sal_Int32 nCount = 0;
+ for(sal_Int32 i = 0; i < rCols.Count(); i++ )
+ if(rCols.IsHidden(i))
+ nCount ++;
+ return rCols.Count() - nCount;
+}
+
+sal_Int32 SwVbaTableHelper::GetRightSeparator( SwTabCols& rCols, sal_Int32 nNum) const
+{
+ OSL_ENSURE( nNum < (sal_Int32)GetColCount( rCols ) ,"Index out of range");
+ sal_Int32 i = 0;
+ while( nNum >= 0 )
+ {
+ if( !rCols.IsHidden( static_cast< sal_uInt16 >(i)) )
+ nNum--;
+ i++;
+ }
+ return i - 1;
+}
+
+sal_Int32 SwVbaTableHelper::GetColWidth( sal_Int32 nCol, sal_Int32 nRow, sal_Bool bCurRowOnly ) throw (uno::RuntimeException)
+{
+ SwTableBox* pStart = GetTabBox( nCol, nRow );
+ SwTabCols aCols;
+ InitTabCols( aCols, pStart, bCurRowOnly );
+ sal_Int32 nWidth = GetColWidth( aCols, nCol );
+
+ sal_Int32 nTableWidth = getTableWidth( );
+ double dAbsWidth = ( (double)nWidth / UNO_TABLE_COLUMN_SUM ) * (double) nTableWidth;
+ return ( sal_Int32 )Millimeter::getInPoints( static_cast<int>(dAbsWidth) );
+}
+
+sal_Int32 SwVbaTableHelper::GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) throw (uno::RuntimeException)
+{
+ SwTwips nWidth = 0;
+
+ if( rCols.Count() > 0 )
+ {
+ if(rCols.Count() == GetColCount( rCols ))
+ {
+ nWidth = (SwTwips)((nNum == rCols.Count()) ?
+ rCols.GetRight() - rCols[nNum-1] :
+ nNum == 0 ? rCols[nNum] - rCols.GetLeft() :
+ rCols[nNum] - rCols[nNum-1]);
+ }
+ else
+ {
+ SwTwips nRValid = nNum < GetColCount( rCols ) ?
+ rCols[(sal_uInt16)GetRightSeparator( rCols, nNum)]:
+ rCols.GetRight();
+ SwTwips nLValid = nNum ?
+ rCols[(sal_uInt16)GetRightSeparator( rCols, nNum - 1)]:
+ rCols.GetLeft();
+ nWidth = nRValid - nLValid;
+ }
+ }
+ else
+ nWidth = rCols.GetRight();
+
+ return nWidth;
+}
+
+void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow, sal_Bool bCurRowOnly ) throw (css::uno::RuntimeException)
+{
+ double dAbsWidth = Millimeter::getInHundredthsOfOneMillimeter( _width );
+ sal_Int32 nTableWidth = getTableWidth( );
+ sal_Int32 nNewWidth = (sal_Int32)( dAbsWidth/nTableWidth * UNO_TABLE_COLUMN_SUM );
+
+ SwTableBox* pStart = GetTabBox( nCol, nRow );
+ SwTabCols aOldCols;
+ InitTabCols( aOldCols, pStart, bCurRowOnly );
+
+ SwTabCols aCols( aOldCols );
+ if ( aCols.Count() > 0 )
+ {
+ SwTwips nWidth = GetColWidth( aCols, nCol);
+
+ int nDiff = (int)(nNewWidth - nWidth);
+ if( !nCol )
+ aCols[ static_cast< sal_uInt16 >(GetRightSeparator(aCols, 0)) ] += nDiff;
+ else if( nCol < GetColCount( aCols ) )
+ {
+ if(nDiff < GetColWidth( aCols, nCol + 1) - MINLAY)
+ aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol)) ] += nDiff;
+ else
+ {
+ int nDiffLeft = nDiff - (int)GetColWidth( aCols, nCol + 1) + (int)MINLAY;
+ aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol)) ] += (nDiff - nDiffLeft);
+ aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol - 1)) ] -= nDiffLeft;
+ }
+ }
+ else
+ aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol-1)) ] -= nDiff;
+ }
+ else
+ aCols.SetRight( Min( (long)nNewWidth, aCols.GetRightMax()) );
+
+ pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatablehelper.hxx b/sw/source/ui/vba/vbatablehelper.hxx
new file mode 100644
index 000000000000..0dcd630d07b8
--- /dev/null
+++ b/sw/source/ui/vba/vbatablehelper.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_WORD_VBA_TABLEHELPER_HXX
+#define SW_WORD_VBA_TABLEHELPER_HXX
+
+#include <com/sun/star/text/XTextTable.hpp>
+#include "wordvbahelper.hxx"
+#include <swtable.hxx>
+#include <tabcol.hxx>
+#include <doc.hxx>
+
+class SwVbaTableHelper
+{
+private:
+ css::uno::Reference< css::text::XTextTable > mxTextTable;
+ SwTable* pTable;
+ SwDoc* pDoc;
+
+private:
+ SwTableBox* GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw (css::uno::RuntimeException);
+ void InitTabCols( SwTabCols& rCols, const SwTableBox *pStart, sal_Bool bCurRowOnly = sal_False );
+ sal_Int32 GetRightSeparator( SwTabCols& rCols, sal_Int32 nNum) const;
+ sal_Int32 GetColCount( SwTabCols& rCols ) const;
+ sal_Int32 GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) throw (css::uno::RuntimeException);
+
+public:
+ SwVbaTableHelper( const css::uno::Reference< css::text::XTextTable >& xTextTable ) throw (css::uno::RuntimeException);
+ ~SwVbaTableHelper() {}
+ sal_Int32 getTabColumnsCount( sal_Int32 nRowIndex ) throw (css::uno::RuntimeException);
+ sal_Int32 getTabColumnsMaxCount( ) throw (css::uno::RuntimeException);
+ sal_Int32 getTabRowIndex( const rtl::OUString& sCellName ) throw (css::uno::RuntimeException);
+ sal_Int32 getTabColIndex( const rtl::OUString& sCellName ) throw (css::uno::RuntimeException);
+ sal_Int32 getTableWidth( ) throw (css::uno::RuntimeException);
+ void setTableWidth( sal_Int32 _width ) throw (css::uno::RuntimeException);
+
+ sal_Int32 GetColWidth( sal_Int32 nCol, sal_Int32 nRow = 0, sal_Bool bCurRowOnly = sal_False ) throw (css::uno::RuntimeException);
+ void SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow = 0, sal_Bool bCurRowOnly = sal_False ) throw (css::uno::RuntimeException);
+
+ static SwTable* GetSwTable( const css::uno::Reference< css::text::XTextTable >& xTextTable ) throw (css::uno::RuntimeException);
+ static rtl::OUString getColumnStr( sal_Int32 nCol );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatableofcontents.cxx b/sw/source/ui/vba/vbatableofcontents.cxx
new file mode 100644
index 000000000000..09a29238bafe
--- /dev/null
+++ b/sw/source/ui/vba/vbatableofcontents.cxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbatableofcontents.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <ooo/vba/word/WdTabLeader.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaTableOfContents::SwVbaTableOfContents( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xDoc, const uno::Reference< text::XDocumentIndex >& xDocumentIndex ) throw ( uno::RuntimeException ) :
+ SwVbaTableOfContents_BASE( rParent, rContext ), mxTextDocument( xDoc ), mxDocumentIndex( xDocumentIndex )
+{
+ mxTocProps.set( mxDocumentIndex, uno::UNO_QUERY_THROW );
+}
+
+
+SwVbaTableOfContents::~SwVbaTableOfContents()
+{
+}
+
+::sal_Int32 SAL_CALL SwVbaTableOfContents::getLowerHeadingLevel() throw (uno::RuntimeException)
+{
+ sal_Int16 nLevel = 0;
+ mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Level") ) ) >>= nLevel;
+ return nLevel;
+}
+
+void SAL_CALL SwVbaTableOfContents::setLowerHeadingLevel( ::sal_Int32 _lowerheadinglevel ) throw (uno::RuntimeException)
+{
+ mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Level") ), uno::makeAny( sal_Int8( _lowerheadinglevel ) ) );
+}
+
+::sal_Int32 SAL_CALL SwVbaTableOfContents::getTabLeader() throw (uno::RuntimeException)
+{
+ // not support in Writer
+ return word::WdTabLeader::wdTabLeaderDots;
+}
+
+void SAL_CALL SwVbaTableOfContents::setTabLeader( ::sal_Int32 /*_tableader*/ ) throw (uno::RuntimeException)
+{
+ // not support in Writer
+}
+
+::sal_Bool SAL_CALL SwVbaTableOfContents::getUseFields() throw (css::uno::RuntimeException)
+{
+ sal_Bool bUseFields = sal_False;
+ mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromMarks") ) ) >>= bUseFields;
+ return bUseFields;
+}
+
+void SAL_CALL SwVbaTableOfContents::setUseFields( ::sal_Bool _useFields ) throw (css::uno::RuntimeException)
+{
+ mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromMarks") ), uno::makeAny( _useFields ) );
+}
+
+::sal_Bool SAL_CALL SwVbaTableOfContents::getUseOutlineLevels() throw (css::uno::RuntimeException)
+{
+ sal_Bool bUseOutlineLevels = sal_False;
+ mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromOutline") ) ) >>= bUseOutlineLevels;
+ return bUseOutlineLevels;
+}
+
+void SAL_CALL SwVbaTableOfContents::setUseOutlineLevels( ::sal_Bool _useOutlineLevels ) throw (css::uno::RuntimeException)
+{
+ mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromOutline") ), uno::makeAny( _useOutlineLevels ) );
+}
+
+void SAL_CALL SwVbaTableOfContents::Delete( ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextContent > xTextContent( mxDocumentIndex, uno::UNO_QUERY_THROW );
+ mxTextDocument->getText()->removeTextContent( xTextContent );
+}
+
+void SAL_CALL SwVbaTableOfContents::Update( ) throw (uno::RuntimeException)
+{
+ mxDocumentIndex->update();
+}
+
+rtl::OUString&
+SwVbaTableOfContents::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTableOfContents") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaTableOfContents::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TableOfContents" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatableofcontents.hxx b/sw/source/ui/vba/vbatableofcontents.hxx
new file mode 100644
index 000000000000..27b39a5da234
--- /dev/null
+++ b/sw/source/ui/vba/vbatableofcontents.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_TABLEOFCONTENTS_HXX
+#define SW_VBA_TABLEOFCONTENTS_HXX
+
+#include <ooo/vba/word/XTableOfContents.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XDocumentIndex.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTableOfContents > SwVbaTableOfContents_BASE;
+
+class SwVbaTableOfContents : public SwVbaTableOfContents_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+ css::uno::Reference< css::text::XDocumentIndex > mxDocumentIndex;
+ css::uno::Reference< css::beans::XPropertySet > mxTocProps;
+
+public:
+ SwVbaTableOfContents( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xDoc, const css::uno::Reference< css::text::XDocumentIndex >& xDocumentIndex ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaTableOfContents();
+
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getLowerHeadingLevel() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLowerHeadingLevel( ::sal_Int32 _lowerheadinglevel ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTabLeader() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTabLeader( ::sal_Int32 _tableader ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getUseFields() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setUseFields( ::sal_Bool _useFields ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getUseOutlineLevels() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setUseOutlineLevels( ::sal_Bool _useOutlineLevels ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Update( ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_TABLEOFCONTENTS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx
index 9a10622400d3..b35624c3d176 100644
--- a/sw/source/ui/vba/vbatables.cxx
+++ b/sw/source/ui/vba/vbatables.cxx
@@ -1,9 +1,13 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "vbatables.hxx"
#include "vbatable.hxx"
#include "vbarange.hxx"
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
#include <comphelper/componentcontext.hxx>
using namespace ::ooo::vba;
@@ -26,7 +30,89 @@ uno::Any lcl_createTable( const uno::Reference< XHelperInterface >& xParent, con
return uno::makeAny( xTable );
}
+sal_Bool lcl_isInHeaderFooter( const uno::Reference< text::XTextTable >& xTable )
+{
+ uno::Reference< text::XTextContent > xTextContent( xTable, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XText > xText = xTextContent->getAnchor()->getText();
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW );
+ rtl::OUString aImplName = xServiceInfo->getImplementationName();
+ if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) )
+ return sal_True;
+ return sal_False;
+}
+
typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumBase;
+typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XNameAccess > TableCollectionHelper_Base;
+typedef std::vector< uno::Reference< text::XTextTable > > XTextTableVec;
+
+class TableCollectionHelper : public TableCollectionHelper_Base
+{
+ XTextTableVec mxTables;
+ XTextTableVec::iterator cachePos;
+
+public:
+ TableCollectionHelper( const uno::Reference< frame::XModel >& xDocument )
+ {
+ // only count the tables in the body text, not in the header/footer
+ uno::Reference< container::XIndexAccess > xTables = lcl_getTables( xDocument );
+ sal_Int32 nCount = xTables->getCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ uno::Reference< text::XTextTable > xTable( xTables->getByIndex( i ) , uno::UNO_QUERY_THROW );
+ if( !lcl_isInHeaderFooter( xTable ) )
+ mxTables.push_back( xTable );
+ }
+ cachePos = mxTables.begin();
+ }
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return mxTables.size();
+ }
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw lang::IndexOutOfBoundsException();
+ uno::Reference< text::XTextTable > xTable( mxTables[ Index ], uno::UNO_QUERY_THROW );
+ return uno::makeAny( xTable );
+ }
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return text::XTextTable::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0 ; }
+ // XNameAcess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( !hasByName(aName) )
+ throw container::NoSuchElementException();
+ uno::Reference< text::XTextTable > xTable( *cachePos, uno::UNO_QUERY_THROW );
+ return uno::makeAny( xTable );
+ }
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > sNames( mxTables.size() );
+ rtl::OUString* pString = sNames.getArray();
+ XTextTableVec::iterator it = mxTables.begin();
+ XTextTableVec::iterator it_end = mxTables.end();
+ for ( ; it != it_end; ++it, ++pString )
+ {
+ uno::Reference< container::XNamed > xName( *it, uno::UNO_QUERY_THROW );
+ *pString = xName->getName();
+ }
+ return sNames;
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+ {
+ cachePos = mxTables.begin();
+ XTextTableVec::iterator it_end = mxTables.end();
+ for ( ; cachePos != it_end; ++cachePos )
+ {
+ uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW );
+ if ( aName.equalsIgnoreAsciiCase( xName->getName() ) )
+ break;
+ }
+ return ( cachePos != it_end );
+ }
+};
class TableEnumerationImpl : public EnumBase
{
@@ -52,7 +138,7 @@ public:
};
-SwVbaTables::SwVbaTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument ) : SwVbaTables_BASE( xParent, xContext , lcl_getTables( xDocument ) ), mxDocument( xDocument )
+SwVbaTables::SwVbaTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument ) : SwVbaTables_BASE( xParent, xContext , uno::Reference< container::XIndexAccess >( new TableCollectionHelper( xDocument ) ) ), mxDocument( xDocument )
{
}
@@ -74,17 +160,19 @@ SwVbaTables::Add( const uno::Reference< word::XRange >& Range, const uno::Any& N
uno::Reference< text::XTextRange > xTextRange = pVbaRange->getXTextRange();
uno::Reference< text::XTextTable > xTable;
- xTable.set( xMsf->createInstance( rtl::OUString::createFromAscii("com.sun.star.text.TextTable") ), uno::UNO_QUERY_THROW );
-/*
- comphelper::ComponentContext aCtx( xMsf );
- if ( !aCtx.createComponent( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ), xTable ) );
- throw uno::RuntimeException(); // #FIXME better exception??
-*/
+ xTable.set( xMsf->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable")) ), uno::UNO_QUERY_THROW );
+
xTable->initialize( nRows, nCols );
uno::Reference< text::XText > xText = xTextRange->getText();
uno::Reference< text::XTextContent > xContext( xTable, uno::UNO_QUERY_THROW );
xText->insertTextContent( xTextRange, xContext, true );
+
+ // move the current cursor to the first table cell
+ uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
+ word::getXTextViewCursor( mxDocument )->gotoRange( xFirstCellText->getStart(), sal_False );
+
uno::Reference< word::XTable > xVBATable( new SwVbaTable( mxParent, mxContext, pVbaRange->getDocument(), xTable ) );
return xVBATable;
}
@@ -129,3 +217,4 @@ SwVbaTables::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatables.hxx b/sw/source/ui/vba/vbatables.hxx
index a789337a2839..e2f002f5c5fc 100644
--- a/sw/source/ui/vba/vbatables.hxx
+++ b/sw/source/ui/vba/vbatables.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef SW_VBA_TABLES_HXX
#define SW_VBA_TABLES_HXX
@@ -26,3 +27,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatablesofcontents.cxx b/sw/source/ui/vba/vbatablesofcontents.cxx
new file mode 100644
index 000000000000..0401e8add560
--- /dev/null
+++ b/sw/source/ui/vba/vbatablesofcontents.cxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbatablesofcontents.hxx"
+#include "vbatableofcontents.hxx"
+#include "vbarange.hxx"
+#include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > TableOfContentsCollectionHelper_Base;
+typedef std::vector< uno::Reference< text::XDocumentIndex > > XTocVec;
+
+class TablesOfContentsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::Reference< container::XIndexAccess > mxIndexAccess;
+ sal_Int32 nIndex;
+
+public:
+ TablesOfContentsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( nIndex < mxIndexAccess->getCount() )
+ {
+ return mxIndexAccess->getByIndex( nIndex++ );
+ }
+ throw container::NoSuchElementException();
+ }
+};
+
+class TableOfContentsCollectionHelper : public TableOfContentsCollectionHelper_Base
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< text::XTextDocument > mxTextDocument;
+ XTocVec maToc;
+
+public:
+ TableOfContentsCollectionHelper( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDoc ) throw ( uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxTextDocument( xDoc )
+ {
+ uno::Reference< text::XDocumentIndexesSupplier > xDocIndexSupp( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xDocIndexes = xDocIndexSupp->getDocumentIndexes();
+ sal_Int32 nCount = xDocIndexes->getCount();
+ for( sal_Int32 i = 0; i < nCount; i++ )
+ {
+ uno::Reference< text::XDocumentIndex > xToc( xDocIndexes->getByIndex(i), uno::UNO_QUERY_THROW );
+ if( xToc->getServiceName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.ContentIndex")) )
+ {
+ maToc.push_back( xToc );
+ }
+ }
+ }
+
+ virtual ~TableOfContentsCollectionHelper() {}
+
+ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return maToc.size();
+ }
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw lang::IndexOutOfBoundsException();
+
+ uno::Reference< text::XDocumentIndex > xToc( maToc[Index], uno::UNO_QUERY_THROW );
+ return uno::makeAny( uno::Reference< word::XTableOfContents >( new SwVbaTableOfContents( mxParent, mxContext, mxTextDocument, xToc ) ) );
+ }
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return word::XTableOfContents::static_type(0);
+ }
+ virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return sal_True;
+ }
+ // XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new TablesOfContentsEnumWrapper( this );
+ }
+};
+
+SwVbaTablesOfContents::SwVbaTablesOfContents( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDoc ) throw (uno::RuntimeException) : SwVbaTablesOfContents_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TableOfContentsCollectionHelper( xParent, xContext, xDoc ) ) ), mxTextDocument( xDoc )
+{
+}
+
+uno::Reference< word::XTableOfContents > SAL_CALL
+SwVbaTablesOfContents::Add( const uno::Reference< word::XRange >& Range, const uno::Any& /*UseHeadingStyles*/, const uno::Any& /*UpperHeadingLevel*/, const uno::Any& LowerHeadingLevel, const uno::Any& UseFields, const uno::Any& /*TableID*/, const uno::Any& /*RightAlignPageNumbers*/, const uno::Any& /*IncludePageNumbers*/, const uno::Any& /*AddedStyles*/, const uno::Any& /*UseHyperlinks*/, const uno::Any& /*HidePageNumbersInWeb*/, const uno::Any& /*UseOutlineLevels*/ ) throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxTextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XDocumentIndex > xDocumentIndex( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ContentIndex")) ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< beans::XPropertySet > xTocProps( xDocumentIndex, uno::UNO_QUERY_THROW );
+ sal_Bool isProtected = sal_False;
+ xTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsProtected") ), uno::makeAny( isProtected ) );
+
+ uno::Reference< word::XTableOfContents > xToc( new SwVbaTableOfContents( this, mxContext, mxTextDocument, xDocumentIndex ) );
+
+ sal_Int32 nLowerHeadingLevel = 9;
+ if( LowerHeadingLevel.hasValue() )
+ LowerHeadingLevel >>= nLowerHeadingLevel;
+ xToc->setLowerHeadingLevel( nLowerHeadingLevel );
+
+ sal_Bool bUseFields = sal_False;
+ if( UseFields.hasValue() )
+ UseFields >>= bUseFields;
+ xToc->setUseFields( bUseFields );
+
+ sal_Bool bUseOutlineLevels = sal_True;
+ xToc->setUseOutlineLevels( bUseOutlineLevels );
+
+ SwVbaRange* pVbaRange = dynamic_cast<SwVbaRange*>( Range.get() );
+ if( !pVbaRange )
+ throw uno::RuntimeException();
+
+ uno::Reference< text::XTextRange > xTextRange = pVbaRange->getXTextRange();
+ uno::Reference< text::XText > xText = pVbaRange->getXText();
+ uno::Reference< text::XTextContent > xTextContent( xDocumentIndex, uno::UNO_QUERY_THROW );
+ xText->insertTextContent( xTextRange, xTextContent, sal_False );
+ xToc->Update();
+
+ return xToc;
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaTablesOfContents::getElementType() throw (uno::RuntimeException)
+{
+ return word::XTableOfContents::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaTablesOfContents::createEnumeration() throw (uno::RuntimeException)
+{
+ return new TablesOfContentsEnumWrapper( m_xIndexAccess );
+}
+
+uno::Any
+SwVbaTablesOfContents::createCollectionObject( const uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaTablesOfContents::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTablesOfContents") );
+ return sImplName;
+}
+
+uno::Sequence<rtl::OUString>
+SwVbaTablesOfContents::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TablesOfContents") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatablesofcontents.hxx b/sw/source/ui/vba/vbatablesofcontents.hxx
new file mode 100644
index 000000000000..04b30d0b12db
--- /dev/null
+++ b/sw/source/ui/vba/vbatablesofcontents.hxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_TABLESOFCONTENTS_HXX
+#define SW_VBA_TABLESOFCONTENTS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XTablesOfContents.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <ooo/vba/word/XTableOfContents.hpp>
+#include <ooo/vba/word/XRange.hpp>
+
+typedef CollTestImplHelper< ooo::vba::word::XTablesOfContents > SwVbaTablesOfContents_BASE;
+
+class SwVbaTablesOfContents : public SwVbaTablesOfContents_BASE
+{
+private:
+ css::uno::Reference< css::text::XTextDocument > mxTextDocument;
+
+public:
+ SwVbaTablesOfContents( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xDoc ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaTablesOfContents() {}
+
+ // Methods
+ virtual css::uno::Reference< ::ooo::vba::word::XTableOfContents > SAL_CALL Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, const css::uno::Any& UseHeadingStyles, const css::uno::Any& UpperHeadingLevel, const css::uno::Any& LowerHeadingLevel, const css::uno::Any& UseFields, const css::uno::Any& TableID, const css::uno::Any& RightAlignPageNumbers, const css::uno::Any& IncludePageNumbers, const css::uno::Any& AddedStyles, const css::uno::Any& UseHyperlinks, const css::uno::Any& HidePageNumbersInWeb, const css::uno::Any& UseOutlineLevels ) throw (css::uno::RuntimeException);
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaTablesOfContents_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_TABLESOFCONTENTS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatabstop.cxx b/sw/source/ui/vba/vbatabstop.cxx
new file mode 100644
index 000000000000..4ed72202bc95
--- /dev/null
+++ b/sw/source/ui/vba/vbatabstop.cxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbatabstop.hxx"
+#include <vbahelper/vbahelper.hxx>
+#include <tools/diagnose_ex.h>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+SwVbaTabStop::SwVbaTabStop( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< beans::XPropertySet >& xParaProps, const style::TabStop& aTabStop ) throw ( uno::RuntimeException ) : SwVbaTabStop_BASE( rParent, rContext ), mxParaProps( xParaProps ), maTabStop( aTabStop )
+{
+}
+
+SwVbaTabStop::~SwVbaTabStop()
+{
+}
+
+rtl::OUString&
+SwVbaTabStop::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTabStop") );
+ return sImplName;
+}
+
+uno::Sequence< rtl::OUString >
+SwVbaTabStop::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TabStop" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatabstop.hxx b/sw/source/ui/vba/vbatabstop.hxx
new file mode 100644
index 000000000000..0de7c0d7e4ba
--- /dev/null
+++ b/sw/source/ui/vba/vbatabstop.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_TABSTOP_HXX
+#define SW_VBA_TABSTOP_HXX
+
+#include <ooo/vba/word/XTabStop.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/style/TabStop.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTabStop > SwVbaTabStop_BASE;
+
+class SwVbaTabStop : public SwVbaTabStop_BASE
+{
+private:
+ css::uno::Reference< css::beans::XPropertySet > mxParaProps;
+ css::style::TabStop maTabStop;
+
+public:
+ SwVbaTabStop( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::style::TabStop& aTabStop ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaTabStop();
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif /* SW_VBA_TABSTOP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatabstops.cxx b/sw/source/ui/vba/vbatabstops.cxx
new file mode 100644
index 000000000000..a8b0abd5cb12
--- /dev/null
+++ b/sw/source/ui/vba/vbatabstops.cxx
@@ -0,0 +1,280 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "vbatabstops.hxx"
+#include "vbatabstop.hxx"
+#include <com/sun/star/style/TabAlign.hpp>
+#include <ooo/vba/word/WdTabLeader.hpp>
+#include <ooo/vba/word/WdTabAlignment.hpp>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+
+uno::Sequence< style::TabStop > lcl_getTabStops( const uno::Reference< beans::XPropertySet >& xParaProps ) throw (uno::RuntimeException)
+{
+ uno::Sequence< style::TabStop > aSeq;
+ xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaTabStops") ) ) >>= aSeq;
+ return aSeq;
+}
+
+void lcl_setTabStops( const uno::Reference< beans::XPropertySet >& xParaProps, const uno::Sequence< style::TabStop >& aSeq ) throw (uno::RuntimeException)
+{
+ xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaTabStops") ), uno::makeAny( aSeq ) );
+}
+
+typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > TabStopCollectionHelper_Base;
+
+class TabStopsEnumWrapper : public EnumerationHelper_BASE
+{
+ uno::Reference< container::XIndexAccess > mxIndexAccess;
+ sal_Int32 nIndex;
+
+public:
+ TabStopsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
+ {
+ return ( nIndex < mxIndexAccess->getCount() );
+ }
+
+ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if( nIndex < mxIndexAccess->getCount() )
+ {
+ return mxIndexAccess->getByIndex( nIndex++ );
+ }
+ throw container::NoSuchElementException();
+ }
+};
+
+class TabStopCollectionHelper : public TabStopCollectionHelper_Base
+{
+private:
+ uno::Reference< XHelperInterface > mxParent;
+ uno::Reference< uno::XComponentContext > mxContext;
+ uno::Reference< beans::XPropertySet > mxParaProps;
+ uno::Sequence< style::TabStop > maTabStops;
+
+public:
+ TabStopCollectionHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps ) throw ( css::uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxParaProps( xParaProps )
+ {
+ maTabStops = lcl_getTabStops( xParaProps );
+ }
+
+ virtual ~TabStopCollectionHelper() {}
+
+ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ return maTabStops.getLength();
+ }
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw css::lang::IndexOutOfBoundsException();
+
+ const style::TabStop* pTabs = maTabStops.getConstArray();
+ return uno::makeAny( uno::Reference< word::XTabStop >( new SwVbaTabStop( mxParent, mxContext, mxParaProps, pTabs[ Index ] ) ) );
+ }
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
+ {
+ return word::XTabStop::static_type(0);
+ }
+ virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ return sal_True;
+ }
+ // XEnumerationAccess
+ virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
+ {
+ return new TabStopsEnumWrapper( this );
+ }
+};
+
+SwVbaTabStops::SwVbaTabStops( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& xParaProps ) throw (uno::RuntimeException) : SwVbaTabStops_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TabStopCollectionHelper( xParent, xContext, xParaProps ) ) ), mxParaProps( xParaProps )
+{
+}
+
+uno::Reference< word::XTabStop > SAL_CALL SwVbaTabStops::Add( float Position, const uno::Any& Alignment, const uno::Any& Leader ) throw (uno::RuntimeException)
+{
+ sal_Int32 nPosition = Millimeter::getInHundredthsOfOneMillimeter( Position );
+
+ style::TabAlign nAlign = style::TabAlign_LEFT;
+ if( Alignment.hasValue() )
+ {
+ sal_Int32 wdAlign = word::WdTabAlignment::wdAlignTabLeft;
+ Alignment >>= wdAlign;
+ switch( wdAlign )
+ {
+ case word::WdTabAlignment::wdAlignTabLeft:
+ {
+ nAlign = style::TabAlign_LEFT;
+ break;
+ }
+ case word::WdTabAlignment::wdAlignTabRight:
+ {
+ nAlign = style::TabAlign_RIGHT;
+ break;
+ }
+ case word::WdTabAlignment::wdAlignTabCenter:
+ {
+ nAlign = style::TabAlign_CENTER;
+ break;
+ }
+ case word::WdTabAlignment::wdAlignTabDecimal:
+ {
+ nAlign = style::TabAlign_DECIMAL;
+ break;
+ }
+ case word::WdTabAlignment::wdAlignTabBar:
+ case word::WdTabAlignment::wdAlignTabList:
+ {
+ DebugHelper::exception( SbERR_NOT_IMPLEMENTED, rtl::OUString() );
+ break;
+ }
+ default:
+ {
+ //left
+ }
+ }
+ }
+
+ sal_Char cLeader = ' '; // default is space
+ if( Leader.hasValue() )
+ {
+ sal_Int32 wdLeader = word::WdTabLeader::wdTabLeaderSpaces;
+ Leader >>= wdLeader;
+ switch( wdLeader )
+ {
+ case word::WdTabLeader::wdTabLeaderSpaces:
+ {
+ cLeader = ' ';
+ break;
+ }
+ case word::WdTabLeader::wdTabLeaderMiddleDot:
+ {
+ cLeader = 183;
+ break;
+ }
+ case word::WdTabLeader::wdTabLeaderDots:
+ {
+ cLeader = '.';
+ break;
+ }
+ case word::WdTabLeader::wdTabLeaderDashes:
+ case word::WdTabLeader::wdTabLeaderHeavy:
+ case word::WdTabLeader::wdTabLeaderLines:
+ {
+ cLeader = '_';
+ break;
+ }
+ default:
+ {
+ //left
+ }
+ }
+ }
+
+ sal_Char cDecimal = '.'; // default value
+
+ style::TabStop aTab;
+ aTab.Position = nPosition;
+ aTab.Alignment = nAlign;
+ aTab.DecimalChar = cDecimal;
+ aTab.FillChar = cLeader;
+
+ uno::Sequence< style::TabStop > aOldTabs = lcl_getTabStops( mxParaProps );
+ sal_Bool bOverWriter = sal_False;
+
+ sal_Int32 nTabs = aOldTabs.getLength();
+ uno::Sequence< style::TabStop > aNewTabs( nTabs + 1 );
+
+ style::TabStop* pOldTab = aOldTabs.getArray();
+ style::TabStop* pNewTab = aNewTabs.getArray();
+ pNewTab[0] = aTab;
+ for( sal_Int32 nIndex = 0; nIndex < nTabs && !bOverWriter; nIndex++ )
+ {
+ if( pOldTab[nIndex].Position == nPosition )
+ {
+ bOverWriter = sal_True;
+ pOldTab[nIndex] = aTab;
+ break;
+ }
+ pNewTab[ nIndex+1 ] = pOldTab[ nIndex ];
+ }
+ if( bOverWriter )
+ lcl_setTabStops( mxParaProps, aOldTabs );
+ else
+ lcl_setTabStops( mxParaProps, aNewTabs );
+
+ return uno::Reference< word::XTabStop >( new SwVbaTabStop( this, mxContext, mxParaProps, aTab ) );
+}
+
+void SAL_CALL SwVbaTabStops::ClearAll() throw (uno::RuntimeException)
+{
+ uno::Sequence< style::TabStop > aSeq;
+ lcl_setTabStops( mxParaProps, aSeq );
+}
+
+// XEnumerationAccess
+uno::Type
+SwVbaTabStops::getElementType() throw (uno::RuntimeException)
+{
+ return word::XTabStop::static_type(0);
+}
+uno::Reference< container::XEnumeration >
+SwVbaTabStops::createEnumeration() throw (uno::RuntimeException)
+{
+ return new TabStopsEnumWrapper( m_xIndexAccess );
+}
+
+uno::Any
+SwVbaTabStops::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+rtl::OUString&
+SwVbaTabStops::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTabStops") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+SwVbaTabStops::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > sNames;
+ if ( sNames.getLength() == 0 )
+ {
+ sNames.realloc( 1 );
+ sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TabStops") );
+ }
+ return sNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatabstops.hxx b/sw/source/ui/vba/vbatabstops.hxx
new file mode 100644
index 000000000000..f5b000131ebe
--- /dev/null
+++ b/sw/source/ui/vba/vbatabstops.hxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_VBA_TABSTOPS_HXX
+#define SW_VBA_TABSTOPS_HXX
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/word/XTabStops.hpp>
+#include <ooo/vba/word/XTabStop.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef CollTestImplHelper< ooo::vba::word::XTabStops > SwVbaTabStops_BASE;
+
+class SwVbaTabStops : public SwVbaTabStops_BASE
+{
+private:
+ css::uno::Reference< css::beans::XPropertySet > mxParaProps;
+
+public:
+ SwVbaTabStops( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps ) throw ( css::uno::RuntimeException );
+ virtual ~SwVbaTabStops() {}
+
+ // Methods
+ virtual css::uno::Reference< ::ooo::vba::word::XTabStop > SAL_CALL Add( float Position, const css::uno::Any& Alignment, const css::uno::Any& Leader ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ClearAll( ) throw (css::uno::RuntimeException);
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // SwVbaTabStops_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif /* SW_VBA_TABSTOPS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx
index 68476b301a17..6216b853ee3e 100644
--- a/sw/source/ui/vba/vbatemplate.cxx
+++ b/sw/source/ui/vba/vbatemplate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,12 +31,35 @@
#include "vbaautotextentry.hxx"
#include <comphelper/processfactory.hxx>
#include <com/sun/star/text/XAutoTextContainer.hpp>
+#include <tools/urlobj.hxx>
+#include <osl/file.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rName )
- : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msName( rName )
+String lcl_CheckGroupName( const String& rGroupName )
+{
+ String sRet;
+ //group name should contain only A-Z and a-z and spaces
+ for( xub_StrLen i = 0; i < rGroupName.Len(); i++ )
+ {
+ sal_Unicode cChar = rGroupName.GetChar(i);
+ if( (cChar >= 'A' && cChar <= 'Z') ||
+ (cChar >= 'a' && cChar <= 'z') ||
+ (cChar >= '0' && cChar <= '9') ||
+ cChar == '_' || cChar == 0x20 )
+ {
+ sRet += cChar;
+ }
+ }
+ sRet.EraseLeadingChars();
+ sRet.EraseTrailingChars();
+ return sRet;
+}
+
+
+SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rFullUrl )
+ : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msFullUrl( rFullUrl )
{
}
@@ -47,7 +71,27 @@ SwVbaTemplate::~SwVbaTemplate()
rtl::OUString
SwVbaTemplate::getName() throw ( css::uno::RuntimeException )
{
- return msName;
+ rtl::OUString sName;
+ if( msFullUrl.getLength() )
+ {
+ INetURLObject aURL( msFullUrl );
+ ::osl::File::getSystemPathFromFileURL( aURL.GetLastName(), sName );
+ }
+ return sName;
+}
+
+rtl::OUString
+SwVbaTemplate::getPath() throw ( css::uno::RuntimeException )
+{
+ rtl::OUString sPath;
+ if( msFullUrl.getLength() )
+ {
+ INetURLObject aURL( msFullUrl );
+ rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
+ sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
+ ::osl::File::getSystemPathFromFileURL( sURL, sPath );
+ }
+ return sPath;
}
uno::Any SAL_CALL
@@ -58,22 +102,22 @@ SwVbaTemplate::AutoTextEntries( const uno::Any& index ) throw (uno::RuntimeExcep
// the default template is "Normal.dot" in Word.
rtl::OUString sGroup( RTL_CONSTASCII_USTRINGPARAM("Normal") );
- sal_Int32 nIndex = msName.lastIndexOf( sal_Unicode('.') );
+ rtl::OUString sName = getName();
+ sal_Int32 nIndex = sName.lastIndexOf( sal_Unicode('.') );
if( nIndex > 0 )
{
- sGroup = msName.copy( 0, msName.lastIndexOf( sal_Unicode('.') ) );
- // OSL_TRACE("SwVbaTemplate::AutoTextEntries: %s", rtl::OUStringToOString( sGroup, RTL_TEXTENCODING_UTF8 ).getStr() );
+ sGroup = sName.copy( 0, sName.lastIndexOf( sal_Unicode('.') ) );
}
+ String sNewGroup = lcl_CheckGroupName( sGroup );
uno::Reference< container::XIndexAccess > xGroup;
- if( xAutoTextContainer->hasByName( sGroup ) )
+ if( xAutoTextContainer->hasByName( sNewGroup ) )
{
- xGroup.set( xAutoTextContainer->getByName( sGroup ), uno::UNO_QUERY_THROW );
+ xGroup.set( xAutoTextContainer->getByName( sNewGroup ), uno::UNO_QUERY_THROW );
}
else
{
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Auto Text Entry doesn't exist") ), uno::Reference< uno::XInterface >() );
- //xGroup.set( xAutoTextContainer->insertNewByName( sGroup ), uno::UNO_QUERY_THROW );
}
uno::Reference< XCollection > xCol( new SwVbaAutoTextEntries( this, mxContext, xGroup ) );
@@ -101,3 +145,4 @@ SwVbaTemplate::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbatemplate.hxx b/sw/source/ui/vba/vbatemplate.hxx
index 073e5cc5db1e..138841855560 100644
--- a/sw/source/ui/vba/vbatemplate.hxx
+++ b/sw/source/ui/vba/vbatemplate.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@ class SwVbaTemplate : public SwVbaTemplate_BASE
{
private:
css::uno::Reference< css::frame::XModel > mxModel;
- rtl::OUString msName;
+ rtl::OUString msFullUrl;
public:
SwVbaTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext,
const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& );
@@ -44,9 +45,12 @@ public:
// XTemplate
virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getPath() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL AutoTextEntries( const css::uno::Any& index ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_TEMPLATE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbavariable.cxx b/sw/source/ui/vba/vbavariable.cxx
index b62dc5642114..4004fa6aba35 100644
--- a/sw/source/ui/vba/vbavariable.cxx
+++ b/sw/source/ui/vba/vbavariable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,4 @@ SwVbaVariable::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbavariable.hxx b/sw/source/ui/vba/vbavariable.hxx
index af076804ef17..bee3654f3b4e 100644
--- a/sw/source/ui/vba/vbavariable.hxx
+++ b/sw/source/ui/vba/vbavariable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_VARIABLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbavariables.cxx b/sw/source/ui/vba/vbavariables.cxx
index 6aa662702a12..1886707fd365 100644
--- a/sw/source/ui/vba/vbavariables.cxx
+++ b/sw/source/ui/vba/vbavariables.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,5 @@ SwVbaVariables::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbavariables.hxx b/sw/source/ui/vba/vbavariables.hxx
index 4933ef6e75a4..9897709bc9a4 100644
--- a/sw/source/ui/vba/vbavariables.hxx
+++ b/sw/source/ui/vba/vbavariables.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ public:
};
#endif /* SW_VBA_VARIABLES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaview.cxx b/sw/source/ui/vba/vbaview.cxx
index 9cb8bf1490ce..e17fd7a0d766 100644
--- a/sw/source/ui/vba/vbaview.cxx
+++ b/sw/source/ui/vba/vbaview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,32 +87,32 @@ SwVbaView::getSeekView() throw (css::uno::RuntimeException)
}
uno::Reference< lang::XServiceInfo > xServiceInfo( xCurrentText, uno::UNO_QUERY_THROW );
rtl::OUString aImplName = xServiceInfo->getImplementationName();
- if( aImplName.equalsAscii("SwXBodyText") )
+ if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXBodyText")) )
{
return word::WdSeekView::wdSeekMainDocument;
}
- else if( aImplName.equalsAscii("SwXHeadFootText") )
+ else if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) )
{
- if( HeaderFooterHelper::isHeader( mxModel, xCurrentText ) )
+ if( HeaderFooterHelper::isHeader( mxModel ) )
{
- if( HeaderFooterHelper::isFirstPageHeader( mxModel, xCurrentText ) )
+ if( HeaderFooterHelper::isFirstPageHeader( mxModel ) )
return word::WdSeekView::wdSeekFirstPageHeader;
- else if( HeaderFooterHelper::isEvenPagesHeader( mxModel, xCurrentText ) )
+ else if( HeaderFooterHelper::isEvenPagesHeader( mxModel ) )
return word::WdSeekView::wdSeekEvenPagesHeader;
else
return word::WdSeekView::wdSeekPrimaryHeader;
}
else
{
- if( HeaderFooterHelper::isFirstPageFooter( mxModel, xCurrentText ) )
+ if( HeaderFooterHelper::isFirstPageFooter( mxModel ) )
return word::WdSeekView::wdSeekFirstPageFooter;
- else if( HeaderFooterHelper::isEvenPagesFooter( mxModel, xCurrentText ) )
+ else if( HeaderFooterHelper::isEvenPagesFooter( mxModel ) )
return word::WdSeekView::wdSeekEvenPagesFooter;
else
return word::WdSeekView::wdSeekPrimaryFooter;
}
}
- else if( aImplName.equalsAscii("SwXFootnote") )
+ else if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXFootnote")) )
{
if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Endnote") ) ) )
return word::WdSeekView::wdSeekEndnotes;
@@ -129,9 +130,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview ) throw (css::uno::RuntimeExceptio
// document, so we can jump back to this position, if the macro sets
// the ViewMode back to wdSeekMainDocument
- // if( _seekview == getSeekView() )
- // return;
-
+ word::gotoSelectedObjectAnchor( mxModel );
switch( _seekview )
{
case word::WdSeekView::wdSeekFirstPageFooter:
@@ -181,7 +180,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview ) throw (css::uno::RuntimeExceptio
{
uno::Reference< text::XTextDocument > xTextDocument( mxModel, uno::UNO_QUERY_THROW );
uno::Reference< text::XText > xText = xTextDocument->getText();
- mxViewCursor->gotoRange( getFirstObjectPosition( xText ), sal_False );
+ mxViewCursor->gotoRange( word::getFirstObjectPosition( xText ), sal_False );
break;
}
}
@@ -314,7 +313,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType )
uno::Reference< beans::XPropertySet > xCursorProps( mxViewCursor, uno::UNO_QUERY_THROW );
rtl::OUString aPageStyleName;
xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName;
- if( aPageStyleName.equalsAscii("First Page") )
+ if( aPageStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("First Page")) )
{
// go to the beginning of where the next style is used
sal_Bool hasNextPage = sal_False;
@@ -376,28 +375,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType )
{
DebugHelper::exception( SbERR_INTERNAL_ERROR, rtl::OUString() );
}
- uno::Reference< text::XTextRange > xTextRange = getFirstObjectPosition( xText );
- return xTextRange;
-}
-
-uno::Reference< text::XTextRange > SwVbaView::getFirstObjectPosition( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException)
-{
- // if the first object is table, get the position of first cell
- uno::Reference< text::XTextRange > xTextRange;
- uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW );
- uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration();
- if( xParaEnum->hasMoreElements() )
- {
- uno::Reference< lang::XServiceInfo > xServiceInfo( xParaEnum->nextElement(), uno::UNO_QUERY_THROW );
- if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ) ) )
- {
- uno::Reference< table::XCellRange > xCellRange( xServiceInfo, uno::UNO_QUERY_THROW );
- uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
- xTextRange = xFirstCellText->getStart();
- }
- }
- if( !xTextRange.is() )
- xTextRange = xText->getStart();
+ uno::Reference< text::XTextRange > xTextRange = word::getFirstObjectPosition( xText );
return xTextRange;
}
@@ -420,3 +398,4 @@ SwVbaView::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaview.hxx b/sw/source/ui/vba/vbaview.hxx
index 03e183ec38a3..bfe77313489b 100644
--- a/sw/source/ui/vba/vbaview.hxx
+++ b/sw/source/ui/vba/vbaview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SW_VBA_VIEW_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index d74e25b39686..43cf4764d223 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,12 +26,17 @@
*
************************************************************************/
#include <vbahelper/helperdecl.hxx>
+#include <ooo/vba/word/WdWindowState.hpp>
+#include <vcl/wrkwin.hxx>
+
#include "vbawindow.hxx"
#include "vbaglobals.hxx"
#include "vbadocument.hxx"
#include "vbaview.hxx"
#include "vbapanes.hxx"
#include "vbapane.hxx"
+#include "wordvbahelper.hxx"
+#include <view.hxx>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -78,6 +84,44 @@ void SAL_CALL SwVbaWindow::setView( const uno::Any& _view ) throw (uno::RuntimeE
}
uno::Any SAL_CALL
+SwVbaWindow::getWindowState() throw (uno::RuntimeException)
+{
+ sal_Int32 nwindowState = word::WdWindowState::wdWindowStateNormal;
+ SwView* pView = word::getView( m_xModel );
+ SfxViewFrame* pViewFrame = pView -> GetViewFrame();
+ WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow();
+ if ( pWork )
+ {
+ if ( pWork -> IsMaximized())
+ nwindowState = word::WdWindowState::wdWindowStateMaximize;
+ else if (pWork -> IsMinimized())
+ nwindowState = word::WdWindowState::wdWindowStateMinimize;
+ }
+ return uno::makeAny( nwindowState );
+}
+
+void SAL_CALL
+SwVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeException)
+{
+ sal_Int32 nwindowState = word::WdWindowState::wdWindowStateMaximize;
+ _windowstate >>= nwindowState;
+ SwView* pView = word::getView( m_xModel );
+ SfxViewFrame* pViewFrame = pView -> GetViewFrame();
+ WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow();
+ if ( pWork )
+ {
+ if ( nwindowState == word::WdWindowState::wdWindowStateMaximize )
+ pWork -> Maximize();
+ else if (nwindowState == word::WdWindowState::wdWindowStateMinimize)
+ pWork -> Minimize();
+ else if (nwindowState == word::WdWindowState::wdWindowStateNormal)
+ pWork -> Restore();
+ else
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid Parameter" ) ), uno::Reference< uno::XInterface >() );
+ }
+}
+
+uno::Any SAL_CALL
SwVbaWindow::Panes( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
uno::Reference< XCollection > xPanes( new SwVbaPanes( this, mxContext, m_xModel ) );
@@ -111,3 +155,5 @@ SwVbaWindow::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbawindow.hxx b/sw/source/ui/vba/vbawindow.hxx
index 4893aa818399..99b259631324 100644
--- a/sw/source/ui/vba/vbawindow.hxx
+++ b/sw/source/ui/vba/vbawindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,8 @@ public:
// Attributes
virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException);
virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException);
// Methods
virtual void SAL_CALL Activate( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& RouteDocument ) throw (css::uno::RuntimeException);
@@ -59,3 +62,5 @@ public:
};
#endif //SW_VBA_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbawrapformat.cxx b/sw/source/ui/vba/vbawrapformat.cxx
index 4125cc00aaa0..5320e0a2af32 100644
--- a/sw/source/ui/vba/vbawrapformat.cxx
+++ b/sw/source/ui/vba/vbawrapformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -250,3 +251,4 @@ extern sdecl::ServiceDecl const serviceDecl(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbawrapformat.hxx b/sw/source/ui/vba/vbawrapformat.hxx
index 71520d78aaae..ed00df65a8c1 100644
--- a/sw/source/ui/vba/vbawrapformat.hxx
+++ b/sw/source/ui/vba/vbawrapformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ public:
};
#endif//SW_VBA_XWRAPFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx
index cb0f5ce90091..fa1f5092c88d 100644
--- a/sw/source/ui/vba/wordvbahelper.cxx
+++ b/sw/source/ui/vba/wordvbahelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,16 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <unotxdoc.hxx>
#include <doc.hxx>
+#include <view.hxx>
#include <viewsh.hxx>
using namespace ::com::sun::star;
@@ -72,8 +78,13 @@ uno::Reference< text::XTextViewCursor > getXTextViewCursor( const uno::Reference
uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xCursorProps( getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
+ return getCurrentPageStyle( xModel, xCursorProps );
+}
+
+uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xProps ) throw (uno::RuntimeException)
+{
rtl::OUString aPageStyleName;
- xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName;
uno::Reference< style::XStyleFamiliesSupplier > xSytleFamSupp( xModel, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xSytleFamNames( xSytleFamSupp->getStyleFamilies(), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xPageStyles( xSytleFamNames->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyles") ) ), uno::UNO_QUERY_THROW );
@@ -89,6 +100,94 @@ sal_Int32 getPageCount( const uno::Reference< frame::XModel>& xModel ) throw (un
return pViewSh ? pViewSh->GetPageCount() : 0;
}
+uno::Reference< style::XStyle > getDefaultParagraphStyle( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+{
+ uno::Reference< style::XStyleFamiliesSupplier > xSytleFamSupp( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xSytleFamNames( xSytleFamSupp->getStyleFamilies(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xParaStyles( xSytleFamNames->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< style::XStyle > xStyle( xParaStyles->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) ), uno::UNO_QUERY_THROW );
+
+ return xStyle;
+}
+
+uno::Reference< text::XTextRange > getFirstObjectPosition( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException)
+{
+ // if the first object is table, get the position of first cell
+ uno::Reference< text::XTextRange > xTextRange;
+ uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration();
+ if( xParaEnum->hasMoreElements() )
+ {
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xParaEnum->nextElement(), uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ) ) )
+ {
+ uno::Reference< table::XCellRange > xCellRange( xServiceInfo, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
+ xTextRange = xFirstCellText->getStart();
+ }
+ }
+ if( !xTextRange.is() )
+ xTextRange = xText->getStart();
+ return xTextRange;
+}
+
+uno::Reference< text::XText > getCurrentXText( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
+{
+ uno::Reference< text::XTextRange > xTextRange;
+ uno::Reference< text::XTextContent > xTextContent( xModel->getCurrentSelection(), uno::UNO_QUERY );
+ if( !xTextContent.is() )
+ {
+ uno::Reference< container::XIndexAccess > xIndexAccess( xModel->getCurrentSelection(), uno::UNO_QUERY );
+ if( xIndexAccess.is() )
+ {
+ xTextContent.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY );
+ }
+ }
+
+ if( xTextContent.is() )
+ xTextRange.set( xTextContent->getAnchor(), uno::UNO_QUERY );
+
+ if( !xTextRange.is() )
+ xTextRange.set( getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW );
+
+ uno::Reference< text::XText > xText;
+ try
+ {
+ xText.set( xTextRange->getText(), uno::UNO_QUERY );
+ }
+ catch( uno::RuntimeException& )
+ {
+ //catch exception "no text selection"
+ }
+ uno::Reference< beans::XPropertySet > xVCProps( xTextRange, uno::UNO_QUERY_THROW );
+ while( xVCProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextContent )
+ {
+ xText = xTextContent->getAnchor()->getText();
+ xVCProps.set( xText->createTextCursor(), uno::UNO_QUERY_THROW );
+ }
+
+ if( !xText.is() )
+ throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), uno::Reference< uno::XInterface >() );
+
+ return xText;
+}
+
+sal_Bool gotoSelectedObjectAnchor( const uno::Reference< frame::XModel>& xModel ) throw (uno::RuntimeException)
+{
+ sal_Bool isObjectSelected = sal_False;
+ uno::Reference< text::XTextContent > xTextContent( xModel->getCurrentSelection(), uno::UNO_QUERY );
+ if( xTextContent.is() )
+ {
+ uno::Reference< text::XTextRange > xTextRange( xTextContent->getAnchor(), uno::UNO_QUERY_THROW );
+ uno::Reference< view::XSelectionSupplier > xSelectSupp( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSelectSupp->select( uno::makeAny( xTextRange ) );
+ isObjectSelected = sal_True;
+ }
+ return isObjectSelected;
+}
+
} // word
} //
} //
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/wordvbahelper.hxx b/sw/source/ui/vba/wordvbahelper.hxx
index 0629d613a724..fd91822649a1 100644
--- a/sw/source/ui/vba/wordvbahelper.hxx
+++ b/sw/source/ui/vba/wordvbahelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,8 @@
#include <com/sun/star/text/XTextViewCursor.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
class SwDocShell;
class SwView;
@@ -46,9 +49,24 @@ namespace ooo
SwView* getView( const css::uno::Reference< css::frame::XModel>& xModel );
css::uno::Reference< css::text::XTextViewCursor > getXTextViewCursor( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
css::uno::Reference< css::style::XStyle > getCurrentPageStyle( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::style::XStyle > getCurrentPageStyle( const css::uno::Reference< css::frame::XModel>& xModel, const css::uno::Reference< css::beans::XPropertySet >& xProps ) throw (css::uno::RuntimeException);
sal_Int32 getPageCount( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::style::XStyle > getDefaultParagraphStyle( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::text::XTextRange > getFirstObjectPosition( const css::uno::Reference< css::text::XText >& xText ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::text::XText > getCurrentXText( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException);
+ sal_Bool gotoSelectedObjectAnchor( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException);
+
+ enum E_DIRECTION
+ {
+ MOVE_LEFT = 1,
+ MOVE_RIGHT,
+ MOVE_UP,
+ MOVE_DOWN
+ };
} // word
} // vba
} // ooo
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wdocsh.cxx b/sw/source/ui/web/wdocsh.cxx
index 4953e715fe45..82344aeafb3c 100644
--- a/sw/source/ui/web/wdocsh.cxx
+++ b/sw/source/ui/web/wdocsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <svl/srchitem.hxx>
#include <sfx2/app.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <sot/clsids.hxx>
#include <sfx2/objface.hxx>
@@ -64,20 +63,12 @@ TYPEINIT1(SwWebDocShell, SwDocShell);
SFX_IMPL_OBJECTFACTORY(SwWebDocShell, SvGlobalName(SO3_SWWEB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/web" )
-/*-----------------22.01.97 09.29-------------------
-
---------------------------------------------------*/
-
SwWebDocShell::SwWebDocShell(SfxObjectCreateMode eMode ) :
SwDocShell(eMode),
nSourcePara(0)
{
}
-/*-----------------22.01.97 09.29-------------------
-
---------------------------------------------------*/
-
SwWebDocShell::~SwWebDocShell()
{
}
@@ -93,7 +84,7 @@ void SwWebDocShell::FillClass( SvGlobalName * pClassName,
sal_Bool bTemplate /* = sal_False */) const
{
(void)bTemplate;
- DBG_ASSERT( bTemplate == sal_False, "No template for Writer Web" );
+ OSL_ENSURE( bTemplate == sal_False, "No template for Writer Web" );
if (nVersion == SOFFICE_FILEFORMAT_60)
{
@@ -112,3 +103,4 @@ void SwWebDocShell::FillClass( SvGlobalName * pClassName,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wformsh.cxx b/sw/source/ui/web/wformsh.cxx
index 0ce34812216f..4f05755330c2 100644
--- a/sw/source/ui/web/wformsh.cxx
+++ b/sw/source/ui/web/wformsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <sfx2/msg.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <svl/srchitem.hxx>
#include <sfx2/objface.hxx>
#include <tools/globname.hxx>
@@ -64,8 +63,9 @@ SwWebDrawFormShell::SwWebDrawFormShell(SwView& rVw) :
{
}
-__EXPORT SwWebDrawFormShell::~SwWebDrawFormShell()
+SwWebDrawFormShell::~SwWebDrawFormShell()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wfrmsh.cxx b/sw/source/ui/web/wfrmsh.cxx
index df391080d467..900dd380d9c5 100644
--- a/sw/source/ui/web/wfrmsh.cxx
+++ b/sw/source/ui/web/wfrmsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,11 +51,6 @@
#include <sfx2/msg.hxx>
#include "swslots.hxx"
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SFX_IMPL_INTERFACE(SwWebFrameShell, SwFrameShell, SW_RES(STR_SHELLNAME_WEBFRAME))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_FRM_POPUPMENU));
@@ -65,24 +61,12 @@ SFX_IMPL_INTERFACE(SwWebFrameShell, SwFrameShell, SW_RES(STR_SHELLNAME_WEBFRAME)
TYPEINIT1(SwWebFrameShell, SwFrameShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwWebFrameShell::SwWebFrameShell(SwView &_rView) :
SwFrameShell(_rView)
{
SetHelpId(SW_WEBFRAMESHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
SwWebFrameShell::~SwWebFrameShell()
{
}
@@ -93,3 +77,4 @@ SwWebFrameShell::~SwWebFrameShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wgrfsh.cxx b/sw/source/ui/web/wgrfsh.cxx
index a8c85f5b0627..7b8917ab017e 100644
--- a/sw/source/ui/web/wgrfsh.cxx
+++ b/sw/source/ui/web/wgrfsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,4 @@ SwWebGrfShell::~SwWebGrfShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wlistsh.cxx b/sw/source/ui/web/wlistsh.cxx
index 3c2c578ea628..eaa9500f36c2 100644
--- a/sw/source/ui/web/wlistsh.cxx
+++ b/sw/source/ui/web/wlistsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,8 +61,9 @@ SwWebListShell::SwWebListShell(SwView &_rView) :
SetHelpId(SW_LISTSHELL);
}
-__EXPORT SwWebListShell::~SwWebListShell()
+SwWebListShell::~SwWebListShell()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wolesh.cxx b/sw/source/ui/web/wolesh.cxx
index db23229adb36..47e1d959ad04 100644
--- a/sw/source/ui/web/wolesh.cxx
+++ b/sw/source/ui/web/wolesh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,8 +62,9 @@ SwWebOleShell::SwWebOleShell(SwView &_rView) :
SetHelpId(SW_OLESHELL);
}
-__EXPORT SwWebOleShell::~SwWebOleShell()
+SwWebOleShell::~SwWebOleShell()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wtabsh.cxx b/sw/source/ui/web/wtabsh.cxx
index ebf8d18a5dd7..3d5e01b2101a 100644
--- a/sw/source/ui/web/wtabsh.cxx
+++ b/sw/source/ui/web/wtabsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,9 +69,10 @@ SwWebTableShell::SwWebTableShell(SwView &_rView) :
SetHelpId(SW_TABSHELL);
}
-__EXPORT SwWebTableShell::~SwWebTableShell()
+SwWebTableShell::~SwWebTableShell()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wtextsh.cxx b/sw/source/ui/web/wtextsh.cxx
index 6a77edb155b8..12912b55cc3c 100644
--- a/sw/source/ui/web/wtextsh.cxx
+++ b/sw/source/ui/web/wtextsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <sfx2/app.hxx>
#include <svl/srchitem.hxx> //***
#include <basic/sbxvar.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include "swtypes.hxx"
#include "cmdid.h"
@@ -61,11 +60,6 @@
#include <sfx2/msg.hxx>
#include "swslots.hxx"
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SFX_IMPL_INTERFACE(SwWebTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_WEBTEXT))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TEXT_POPUPMENU));
@@ -76,24 +70,16 @@ SFX_IMPL_INTERFACE(SwWebTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_WEBTEXT))
TYPEINIT1(SwWebTextShell, SwTextShell)
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwWebTextShell::SwWebTextShell(SwView &_rView) :
SwTextShell(_rView)
{
SetHelpId(SW_WEBTEXTSHELL);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwWebTextShell::~SwWebTextShell()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx
index 9f8c73faf152..6ab11faad338 100644
--- a/sw/source/ui/web/wview.cxx
+++ b/sw/source/ui/web/wview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,30 +104,15 @@ SFX_IMPL_INTERFACE( SwWebView, SwView, SW_RES(RID_WEBTOOLS_TOOLBOX) )
TYPEINIT1(SwWebView,SwView)
-/*-----------------22.01.97 14.27-------------------
-
---------------------------------------------------*/
-
-
SwWebView::SwWebView(SfxViewFrame* _pFrame, SfxViewShell* _pShell) :
SwView(_pFrame, _pShell)
{
}
-/*-----------------22.01.97 14.27-------------------
-
---------------------------------------------------*/
-
-
SwWebView::~SwWebView()
{
}
-/*-----------------23.01.97 09.01-------------------
-
---------------------------------------------------*/
-
-
void SwWebView::SelectShell()
{
// Entscheidung, ob UpdateTable gerufen werden muss
@@ -152,8 +138,6 @@ void SwWebView::SelectShell()
}
else
{
-
- // DELETEZ(pxSelectionObj); //Selektionsobjekt loeschen
SfxDispatcher &rDispatcher = *GetViewFrame()->GetDispatcher();
SwToolbarConfigItem *pBarCfg = SW_MOD()->GetWebToolbarConfig();
@@ -176,7 +160,7 @@ void SwWebView::SelectShell()
break;
}
pSfxShell = rDispatcher.GetShell( --i );
- ASSERT( pSfxShell, "My Shell ist lost in space" );
+ OSL_ENSURE( pSfxShell, "My Shell ist lost in space" );
rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE);
}
@@ -328,3 +312,4 @@ void SwWebView::SelectShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index d307f75af908..977948074f24 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,14 +34,9 @@
#include <crsskip.hxx>
#include <swcrsr.hxx>
#include <editeng/lrspitem.hxx> // #i23725#
-// --> OD 2006-07-10 #134369#
-#ifndef _VIEW_HXX
+// #134369#
#include <view.hxx>
-#endif
-#ifndef _DRAWBASE_HXX
#include <drawbase.hxx>
-#endif
-// <--
inline void SwWrtShell::OpenMark()
{
@@ -115,9 +111,7 @@ long SwWrtShell::DelLine()
SwCrsrShell::LeftMargin();
SetMark();
SwCrsrShell::RightMargin();
-//Warum soll hier noch ein Zeichen in der naechsten Zeile geloescht werden?
-// if(!IsEndOfPara())
-// SwCrsrShell::Right();
+
long nRet = Delete();
Pop(sal_False);
if( nRet )
@@ -208,12 +202,11 @@ long SwWrtShell::DelLeft()
if( SwCrsrShell::IsSttPara())
{
- // --> FME 2007-02-15 #i4032# Don't actually call a 'delete' if we
+ // #i4032# Don't actually call a 'delete' if we
// changed the table cell, compare DelRight().
const SwStartNode * pSNdOld = pWasInTblNd ?
GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
0;
- // <--
/* If the cursor is at the beginning of a paragraph, try to step
backwards. On failure we are done. */
@@ -230,11 +223,10 @@ long SwWrtShell::DelLeft()
GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
0;
- // --> FME 2007-02-15 #i4032# Don't actually call a 'delete' if we
+ // #i4032# Don't actually call a 'delete' if we
// changed the table cell, compare DelRight().
if ( pSNdOld != pSNdNew )
return 0;
- // <--
OpenMark();
SwCrsrShell::Right(1,CRSR_SKIP_CHARS);
@@ -334,13 +326,12 @@ long SwWrtShell::DelRight()
if ( SwCrsrShell::IsEndPara() )
{
- // --> FME 2005-01-28 #i41424# Introduced a couple of
+ // #i41424# Introduced a couple of
// Push()-Pop() pairs here. The reason for this is that a
// Right()-Left() combination does not make sure, that
// the cursor will be in its initial state, because there
// may be a numbering in front of the next paragraph.
SwCrsrShell::Push();
- // <--
if ( SwCrsrShell::Right(1, CRSR_SKIP_CHARS) )
{
@@ -390,11 +381,10 @@ long SwWrtShell::DelRight()
LeaveSelFrmMode();
UnSelectFrm();
- // --> OD 2006-07-06 #134369#
- ASSERT( !IsFrmSelected(),
- "<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all objects" )
- // <--
- // --> OD 2006-07-10 #134369#
+ // #134369#
+ OSL_ENSURE( !IsFrmSelected(),
+ "<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all objects" );
+ // #134369#
// leave draw mode, if necessary.
{
if (GetView().GetDrawFuncPtr())
@@ -407,12 +397,10 @@ long SwWrtShell::DelRight()
GetView().LeaveDrawCreate();
}
}
- // <--
}
- // --> OD 2006-07-07 #134369#
+ // #134369#
// <IsFrmSelected()> can't be true - see above.
- // <--
{
nSelection = GetSelectionType();
if ( nsSelectionType::SEL_FRM & nSelection ||
@@ -510,9 +498,9 @@ long SwWrtShell::DelNxtWord()
EnterStdMode();
SetMark();
if(IsEndWrd() && !IsSttWrd())
- _NxtWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _NxtWrdForDelete(); // #i92468#
if(IsSttWrd() || IsEndPara())
- _NxtWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _NxtWrdForDelete(); // #i92468#
else
_EndWrd();
@@ -536,11 +524,11 @@ long SwWrtShell::DelPrvWord()
EnterStdMode();
SetMark();
if ( !IsSttWrd() ||
- !_PrvWrdForDelete() ) // --> OD 2008-08-06 #i92468#
+ !_PrvWrdForDelete() ) // #i92468#
{
if( IsEndWrd() )
{
- if ( _PrvWrdForDelete() ) // --> OD 2008-08-06 #i92468#
+ if ( _PrvWrdForDelete() ) // #i92468#
{
// skip over all-1 spaces
short n = -1;
@@ -552,7 +540,7 @@ long SwWrtShell::DelPrvWord()
}
}
else if( IsSttPara())
- _PrvWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _PrvWrdForDelete(); // #i92468#
else
_SttWrd();
}
@@ -568,3 +556,4 @@ long SwWrtShell::DelPrvWord()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx
index 34a9b5554c36..0e04be3665d5 100644
--- a/sw/source/ui/wrtsh/move.cxx
+++ b/sw/source/ui/wrtsh/move.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <sfx2/bindings.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <viewopt.hxx>
#include <crsskip.hxx>
@@ -523,7 +522,6 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
if( bIsFrmSel )
{
-// CallChgLnk();
// bei Frames immer nur die obere Ecke nehmen, damit dieser
// wieder selektiert werden kann
aOldRect.SSize( 5, 5 );
@@ -670,7 +668,97 @@ sal_Bool SwWrtShell::GotoPage(sal_uInt16 nPage, sal_Bool bRecord)
sal_Bool SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart )
{
ShellMoveCrsr aTmp( this, bSelect );
- return SwCrsrShell::GotoMark( pMark, bStart );
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoMark( pMark, bStart );
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bSelFrame )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwFEShell::GotoFly(rName, eType, bSelFrame);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoINetAttr(rAttr);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+void SwWrtShell::GotoOutline( sal_uInt16 nIdx )
+{
+ addCurrentPosition();
+ return SwCrsrShell::GotoOutline (nIdx);
+}
+
+sal_Bool SwWrtShell::GotoOutline( const String& rName )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoOutline (rName);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoRegion( const String& rName )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoRegion (rName);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+ }
+
+sal_Bool SwWrtShell::GotoRefMark( const String& rRefMark, sal_uInt16 nSubType,
+ sal_uInt16 nSeqNo )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoRefMark(rRefMark, nSubType, nSeqNo);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoNextTOXBase( const String* pName )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoNextTOXBase(pName);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoTable( const String& rName )
+{
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoTable(rName);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+sal_Bool SwWrtShell::GotoFld( const SwFmtFld& rFld ) {
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ bool bRet = SwCrsrShell::GotoFld(rFld);
+ if (bRet)
+ aNavigationMgr.addEntry(aPos);
+ return bRet;
+}
+
+const SwRedline* SwWrtShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect ) {
+ SwPosition aPos = *GetCrsr()->GetPoint();
+ const SwRedline *pRedline = SwCrsrShell::GotoRedline(nArrPos, bSelect);
+ if (pRedline)
+ aNavigationMgr.addEntry(aPos);
+ return pRedline;
}
@@ -689,3 +777,4 @@ sal_Bool SwWrtShell::SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx
new file mode 100644
index 000000000000..2ef5b17d5ef4
--- /dev/null
+++ b/sw/source/ui/wrtsh/navmgr.cxx
@@ -0,0 +1,224 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Maja Djordjevic < ovcica@gmail.com > ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com>
+ * Caolan McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "precompiled_sw.hxx"
+
+#include "navmgr.hxx"
+#include "wrtsh.hxx"
+#include <sfx2/bindings.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <cmdid.h>
+#include <view.hxx>
+
+/**
+ * If SMART is defined, the navigation history has recency with temporal ordering enhancement,
+ * as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/
+ */
+#define SMART 1
+
+/*
+ * This method positions the cursor to the position rPos
+ */
+void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) {
+ SwWrtShell& rSh = *_pMyShell;
+ /* EnterStdMode() prevents the cursor to 'block' the current shell when it should move from the image back to the normal shell */
+ rSh.EnterStdMode();
+ rSh.StartAllAction();
+ /*
+ * cursor consists of two SwPositions: Point and Mark.
+ * Such a pair is called a PaM. SwPaM is derived from SwRing.
+ * The Ring contains the single regions of a multi-selection.
+ */
+ SwPaM* pPaM = rSh.GetCrsr();
+
+ if(pPaM->HasMark())
+ pPaM->DeleteMark(); // If there was a selection, get rid of it
+ *pPaM->GetPoint() = rPos; // Position Cursor
+
+ rSh.EndAllAction();
+}
+/*
+ * Ctor for the SwNavigationMgr class
+ * Sets the shell to the current shell
+ * and the index of the current position to 0
+ */
+
+SwNavigationMgr::SwNavigationMgr(SwWrtShell* pShell)
+ : _nCurrent(0), _pMyShell(pShell) {
+}
+/*
+ * This method is used by the navigation shell - defined in sw/source/ui/inc/navsh.hxx
+ * and implemented in sw/source/ui/shells/navsh.cxx
+ * It is called when we want to check if the back button should be enabled or not.
+ * The back button should be enabled only if there are some entries in the navigation history
+ */
+sal_Bool SwNavigationMgr::backEnabled() {
+ return (_nCurrent > 0);
+}
+/*
+ * Similar to backEnabled() method.
+ * The forward button should be enabled if we ever clicked back
+ * Due to the implementation of the navigation class, this is when the
+ * current position within the navigation history entries in not the last one
+ * i.e. when the _nCurrent index is not at the end of the _entries vector
+ */
+sal_Bool SwNavigationMgr::forwardEnabled() {
+ return _nCurrent+1 < _entries.size();
+}
+
+
+/*
+ * The goBack() method positions the cursor to the previous entry in the navigation history
+ * If there was no history to go forward to, it adds the current position of the cursor
+ * to the history so we could go forward to where we came from
+ */
+void SwNavigationMgr::goBack() {
+ /*
+ * Although the button should be disabled whenever the backEnabled() returns false,
+ * the UI is sometimes not as responsive as we would like it to be :)
+ * this check prevents segmentation faults and in this way the class is not relying on the UI
+ */
+ if (backEnabled()) {
+ SwWrtShell& rSh = *_pMyShell;
+ /* Trying to get the current cursor */
+ SwPaM* pPaM = rSh.GetCrsr();
+ if (!pPaM) {
+ return;
+ }
+
+ /* This flag will be used to manually refresh the buttons */
+ bool bForwardWasDisabled = !forwardEnabled();
+ /*
+ * If we're going backwards in our history, but the current location is not
+ * in the history then we need to add *here* to it so that we can "go
+ * forward" to here again.
+ */
+
+ if (bForwardWasDisabled) {
+ /*
+ * the cursor consists of two SwPositions: Point and Mark.
+ * We are adding the current Point to the navigation history
+ * so we could later navigate forward to it
+ */
+ /* The addEntry() method returns true iff we should decrement the index before navigating back */
+ if (addEntry(*pPaM->GetPoint()) ) {
+ _nCurrent--;
+ }
+ }
+ _nCurrent--;
+ /* Position cursor to appropriate navigation history entry */
+ GotoSwPosition(_entries[_nCurrent]);
+ /* Refresh the buttons */
+ if (bForwardWasDisabled)
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
+ if (!backEnabled())
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
+ }
+}
+/*
+ * The goForward() method positions the cursor to the next entry in the navigation history
+ */
+
+void SwNavigationMgr::goForward() {
+ /*
+ * Although the button should be disabled whenever the backForward() returns false,
+ * the UI is sometimes not as responsive as we would like it to be :)
+ * this check prevents segmentation faults and in this way the class is not relying on the UI
+ */
+
+ if (forwardEnabled()) {
+ /* This flag will be used to manually refresh the buttons */
+ bool bBackWasDisabled = !backEnabled();
+ /*
+ * The current index is positioned at the current entry in the navigation history
+ * We have to increment it to go to the next entry
+ */
+ _nCurrent++;
+ GotoSwPosition(_entries[_nCurrent]);
+ /* Refresh the buttons */
+ if (bBackWasDisabled)
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
+ if (!forwardEnabled())
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
+ }
+}
+/*
+ * This method adds the SwPosition rPos to the navigation history
+ * rPos is usually the current position of the cursor in the document
+ */
+bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
+ /* Flags that will be used for refreshing the buttons */
+ bool bBackWasDisabled = !backEnabled();
+ bool bForwardWasEnabled = forwardEnabled();
+
+ bool bRet = false; // return value of the function.
+ // Indicates weather the index should be decremented before jumping back or not
+#if SMART
+ /* If any forward history exists, twist the tail of the list from the current position to the end */
+ if (bForwardWasEnabled) {
+
+ size_t number_of_entries = _entries.size(); /* To avoid calling _entries.size() multiple times */
+ int curr = _nCurrent; /* Index from which we'll twist the tail. */
+ int n = (number_of_entries - curr) / 2; /* Number of entries that will swap places */
+ for (int i = 0; i < n; i++) {
+ SwPosition temp = _entries[curr + i];
+ _entries[curr + i] = _entries[number_of_entries -1 - i];
+ _entries[number_of_entries -1 - i] = temp;
+ }
+
+ if (_entries.back() != rPos)
+ _entries.push_back(rPos);
+
+
+ bRet = true;
+ }
+ else {
+ if ( (_entries.size() > 0 && _entries.back() != rPos) || (_entries.size() == 0) ) {
+ _entries.push_back(rPos);
+ bRet = true;
+ }
+ if (_entries.size() > 1 && _entries.back() == rPos)
+ bRet = true;
+ if (_entries.size() == 1 && _entries.back() == rPos)
+ bRet = false;
+ }
+#else
+ _entries.erase(_entries.begin() + _nCurrent, _entries.end());
+ _entries.push_back(rPos);
+ bRet = true;
+#endif
+ _nCurrent = _entries.size();
+
+ /* Refresh buttons */
+ if (bBackWasDisabled)
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
+ if (bForwardWasEnabled)
+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
+ return bRet;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index f0f1d8f88ff4..d0c10642c358 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -619,7 +620,6 @@ long SwWrtShell::SttLeaveSelect(const Point *, sal_Bool )
if(SwCrsrShell::HasSelection() && !IsSelTblCells() && bClearMark) {
return 0;
}
-// if( IsSelTblCells() ) aSelTblLink.Call(this);
ClearMark();
return 1;
}
@@ -773,7 +773,7 @@ void SwWrtShell::LeaveSelFrmMode()
IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt )
{
const SwFrmFmt *pFmt = pFlyFmt ? (SwFrmFmt*)pFlyFmt : GetFlyFrmFmt();
- ASSERT(pFmt, kein FrameFormat.);
+ OSL_ENSURE(pFmt, "no frame format");
const SvxMacroItem &rFmtMac = pFmt->GetMacro();
if(rFmtMac.HasMacro(SW_EVENT_OBJECT_SELECT))
@@ -881,7 +881,7 @@ long SwWrtShell::EndDrag(const Point * /*pPt*/, sal_Bool )
return 1;
}
-// --> FME 2004-07-30 #i32329# Enhanced table selection
+// #i32329# Enhanced table selection
sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag )
{
MV_KONTEXT(this);
@@ -894,7 +894,6 @@ sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, boo
}
return sal_False;
}
-// <--
/*------------------------------------------------------------------------
Beschreibung: Selektion einer Tabellenzeile / Spalte
@@ -1070,3 +1069,4 @@ sal_Bool SwWrtShell::SelectNextPrevHyperlink( sal_Bool bNext )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 21abeadfa5b1..97c1ca230b79 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/util/XModifiable.hpp>
-#if STLPORT_VERSION>=321
-#include <math.h> // prevent conflict between exception and std::exception
-#endif
+#include <math.h>
#include <hintids.hxx>
#include <svx/svdview.hxx>
#include <sot/factory.hxx>
@@ -108,8 +107,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/viewfrm.hxx>
-#include <editeng/acorrcfg.hxx>
-
#include "PostItMgr.hxx"
#include <sfx2/msgpool.hxx>
@@ -125,6 +122,7 @@ using namespace com::sun::star;
ePageMove(MV_NO),\
pCrsrStack(0), \
rView(rShell),\
+ aNavigationMgr(this), \
bDestOnStack(sal_False), \
fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
@@ -146,7 +144,7 @@ using namespace com::sun::star;
SvxAutoCorrect* lcl_IsAutoCorr()
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
@@ -259,18 +257,6 @@ void SwWrtShell::Insert( const String &rStr )
bDeleted = DelRight() != 0;
}
- /*
-JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
- naechste Zeichen.
- if( bHasSel && !bIns && 1 < rStr.Len() )
- {
- // falls mehrere Zeichen anstehen, nur das erste einfuegen,
- // der Rest muss dann aber Ueberschrieben werden.
- SwEditShell::Insert( rStr.GetChar( 0 ) );
- SwEditShell::Overwrite( rStr.Copy( 1 ) );
- }
- else
-*/
bCallIns ?
SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
@@ -280,7 +266,6 @@ JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
EndAllAction();
EndUndo();
}
-// delete pChgFlg;
}
/* Begrenzung auf maximale Hoehe geht nicht, da die maximale Hoehe
@@ -423,27 +408,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
// TODO/LATER: recording! Convert properties to items
case SID_INSERT_PLUGIN:
- /*
- if(pReq)
- {
- INetURLObject* pURL = aDlg.GetURL();
- if(pURL)
- pReq->AppendItem(SfxStringItem(FN_PARAM_2, pURL->GetMainURL(INetURLObject::NO_DECODE)));
- pReq->AppendItem(SfxStringItem(FN_PARAM_3 , aDlg.GetCommands()));
- } */
case SID_INSERT_FLOATINGFRAME:
- /*
- if(pReq && xFloatingFrame.Is())
- {
- const SfxFrameDescriptor* pDescriptor = xFloatingFrame->GetFrameDescriptor();
- pReq->AppendItem(SfxStringItem(FN_PARAM_1, pDescriptor->GetName()));
- pReq->AppendItem(
- SfxStringItem( FN_PARAM_2,
- pDescriptor->GetURL().GetMainURL(INetURLObject::NO_DECODE)));
- pReq->AppendItem(SvxSizeItem(FN_PARAM_3, pDescriptor->GetMargin()));
- pReq->AppendItem(SfxByteItem(FN_PARAM_4, pDescriptor->GetScrollingMode()));
- pReq->AppendItem(SfxBoolItem(FN_PARAM_5, pDescriptor->HasFrameBorder()));
- }*/
{
SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
@@ -503,8 +468,6 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
pClient->DoVerb( SVVERB_SHOW );
// TODO/LATER: set document name - should be done in Client
- //if ( !ERRCODE_TOERROR( nErr ) )
- // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() );
}
}
}
@@ -560,7 +523,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
{
try
{
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("Formula"), uno::makeAny( ::rtl::OUString( aMathData ) ) );
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Formula")), uno::makeAny( ::rtl::OUString( aMathData ) ) );
bActivate = sal_False;
}
catch ( uno::Exception& )
@@ -600,7 +563,6 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
// --> #i972#
if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
AlignFormulaToBaseline( xRef.GetObject() );
- // <--
if (pFlyFrmFmt)
*pFlyFrmFmt = pFmt;
@@ -660,7 +622,7 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
!GetView().GetViewFrame()->GetFrame().IsInPlace() )
{
svt::EmbeddedObjectRef& xRef = GetOLEObject();
- ASSERT( xRef.is(), "OLE not found" );
+ OSL_ENSURE( xRef.is(), "OLE not found" );
SfxInPlaceClient* pCli=0;
pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
@@ -701,12 +663,13 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
- const SwRect *pFlyPrtRect,
- const SwRect *pFlyFrmRect )
+ const SwRect *pFlyPrtRect,
+ const SwRect *pFlyFrmRect,
+ const bool bNoTxtFrmPrtAreaChanged )
{
//Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
//zwischen der VisArea des Objektes und der ObjArea.
- ASSERT( xObj.is(), "ObjectRef not valid" );
+ OSL_ENSURE( xObj.is(), "ObjectRef not valid" );
sal_Int64 nAspect = xObj.GetViewAspect();
if ( nAspect == embed::Aspects::MSOLE_ICON )
@@ -739,7 +702,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( nAspect, aSz );
- // --> OD 2005-05-02 #i48419# - action 'UpdateReplacement' doesn't
+ // #i48419# - action 'UpdateReplacement' doesn't
// have to change the modified state of the document.
// This is only a workaround for the defect, that this action
// modifies a document after load, because unnecessarily the
@@ -767,7 +730,6 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
GetDoc()->GetDocShell()->EnableSetModified( sal_True );
}
}
- // <--
}
// TODO/LATER: this is only a workaround,
@@ -784,12 +746,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
if ( !pCli )
{
- if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
+ if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
+ || bLinkingChart
// TODO/LATER: ResizeOnPrinterChange
//|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
- || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
- // set the size back by this method
- )
+ // --> OD #i117189# - refine condition for non-resizable objects
+ // non-resizable objects need to be set the size back by this method
+ || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
{
pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
}
@@ -807,13 +770,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
catch( embed::NoVisualAreaSizeException& )
{
- DBG_ERROR( "Can't get visual area size!\n" );
+ OSL_FAIL("Can't get visual area size!\n" );
// the scaling will not be done
}
catch( uno::Exception& )
{
// TODO/LATER: handle the error
- DBG_ERROR( "Can't get visual area size!\n" );
+ OSL_FAIL("Can't get visual area size!\n" );
return;
}
@@ -901,7 +864,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
{
// --> this moves non-resizable object so that when adding borders the baseline remains the same
const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
- ASSERT( pFlyFrmFmt, "Could not find fly frame." );
+ OSL_ENSURE( pFlyFrmFmt, "Could not find fly frame." );
if ( pFlyFrmFmt )
{
const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
@@ -909,7 +872,6 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
: GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
}
- // <--
aArea.Width ( _aVisArea.Width() );
aArea.Height( _aVisArea.Height() );
RequestObjectResize( aArea, xObj.GetObject() );
@@ -954,6 +916,8 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
if(HasSelection())
DelRight();
SwFEShell::SplitNode();
+ // delete the numbered attribute of the last line if the last line is empty
+ GetDoc()->ClearLineNumAttrs( *GetCrsr()->GetPoint() );
}
const SwPageDesc *pDesc = pPageDesc
@@ -1035,7 +999,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool
SwapPam();
ClearMark();
}
-
+ SwPosition aPos = *GetCrsr()->GetPoint();
SwFmtFtn aFootNote( bEndNote );
if(rStr.Len())
aFootNote.SetNumStr( rStr );
@@ -1048,6 +1012,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool
Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
GotoFtnTxt();
}
+ aNavigationMgr.addEntry(aPos);
}
}
/*------------------------------------------------------------------------
@@ -1090,7 +1055,6 @@ void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
// extern void SetNumChrFmt( SwWrtShell*, SwNumRules& );
// -> #i40041#
-// --> OD 2005-10-25 #b6340308#
// Preconditions (as far as OD has figured out):
// - <SwEditShell::HasNumber()> is sal_False, if <bNum> is sal_True
// - <SwEditShell::HasBullet()> is sal_False, if <bNum> is sal_False
@@ -1105,7 +1069,6 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
const SwNumRule * pNumRule = pCurRule;
- // --> OD 2005-10-25 #b6340308#
// - activate outline rule respectively turning on outline rule for
// current text node. But, only for turning on a numbering (<bNum> == sal_True).
// - overwrite found numbering rule at current cursor position, if
@@ -1116,10 +1079,10 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
SwTxtFmtColl * pColl = GetCurTxtFmtColl();
if ( pColl )
{
- // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph
+ // retrieve numbering rule at paragraph
// style, which is found at current cursor position in the document.
SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
- // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
+ // #125993# - The outline numbering rule isn't allowed
// to be derived from a parent paragraph style to a derived one.
// Thus check, if the found outline numbering rule is directly
// set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
@@ -1132,29 +1095,15 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
pCollRule = 0;
}
}
- // --> OD 2006-11-20 #i71764#
- // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
- // any more.
-// if ( pCollRule == NULL &&
-// NO_NUMBERING != pColl->GetOutlineLevel() &&
-// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) )
-// {
-// pCollRule = GetDoc()->GetOutlineNumRule();
-// }
- // <--
-
- // <--
- // --> OD 2005-10-25 #b6340308#
+
if ( !pCollRule )
{
pNumRule = pCollRule;
}
- // --> OD 2006-06-12 #b6435904#
// no activation or continuation of outline numbering in Writer/Web document
else if ( bNum &&
!dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
pCollRule == GetDoc()->GetOutlineNumRule() )
- // <--
{
if ( pNumRule == pCollRule )
{
@@ -1168,9 +1117,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
- ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
+ OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei
+ if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
@@ -1185,7 +1134,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else
{
- // --> OD 2009-08-27 #i101234#
+ // #i101234#
// activate outline numbering, because from the precondition
// it's known, that <SwEdit::HasNumber()> == sal_False
bActivateOutlineRule = true;
@@ -1194,7 +1143,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else if ( !pNumRule )
{
- // --> OD 2009-08-27 #i101234#
+ // #i101234#
// Check, if corresponding list level of the outline numbering
// has already a numbering format set.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
@@ -1210,16 +1159,15 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// turning on outline numbering at current cursor position
bContinueFoundNumRule = true;
}
- // <--
}
else
{
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
- nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
- ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
+ nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
+ OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
+ if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
@@ -1236,7 +1184,6 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
}
- // --> OD 2005-10-25 #b6340308#
// Only automatic numbering/bullet rules should be changed.
// Note: The outline numbering rule is also an automatic one. It's only
// changed, if it has to be activated.
@@ -1252,11 +1199,8 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
pNumRule = 0;
}
}
- // <--
- // --> OD 2005-10-25 #b6340308#
// Search for a previous numbering/bullet rule to continue it.
- // --> OD 2008-03-18 #refactorlists#
String sContinuedListId;
if ( !pNumRule )
{
@@ -1265,13 +1209,11 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
sContinuedListId );
bContinueFoundNumRule = pNumRule != 0;
}
- // <--
if (pNumRule)
{
SwNumRule aNumRule(*pNumRule);
- // --> OD 2005-10-25 #b6340308#
// do not change found numbering/bullet rule, if it should only be continued.
if ( !bContinueFoundNumRule )
{
@@ -1279,12 +1221,10 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
if (pTxtNode)
{
- // --> OD 2005-10-26 #b6340308# - use above retrieve outline
- // level, if outline numbering has to be activated.
- int nLevel = bActivateOutlineRule ////#outline level,zhaojianwei,need more consideration
+ // use above retrieve outline level, if outline numbering has to be activated.
+ int nLevel = bActivateOutlineRule
? nActivateOutlineLvl
: pTxtNode->GetActualListLevel();
- // <--
if (nLevel < 0)
nLevel = 0;
@@ -1298,14 +1238,12 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aFmt.SetNumberingType(SVX_NUM_ARABIC);
else
{
- // --> OD 2008-06-03 #i63395#
- // Only apply user defined default bullet font
+ // #i63395# Only apply user defined default bullet font
if ( numfunc::IsDefBulletFontUserDefined() )
{
const Font* pFnt = &numfunc::GetDefBulletFont();
aFmt.SetBulletFont( pFnt );
}
- // <--
aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
// #i93908# clear suffix for bullet lists
@@ -1315,32 +1253,24 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt);
}
}
- // <--
- // --> OD 2008-02-08 #newlistlevelattrs#
// reset indent attribute on applying list style
- // --> OD 2008-03-27 #refactorlists#
SetCurNumRule( aNumRule, false, sContinuedListId, true );
- // <--
}
else
{
- // --> OD 2009-08-27 #i95907#
+ // #i95907#
const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
numfunc::GetDefaultPositionAndSpaceMode() );
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
- // <--
- // <--
// Zeichenvorlage an die Numerierung haengen
SwCharFmt* pChrFmt;
SwDocShell* pDocSh = GetView().GetDocShell();
- // --> OD 2008-06-03 #i63395#
+ // #i63395#
// Only apply user defined default bullet font
const Font* pFnt = numfunc::IsDefBulletFontUserDefined()
? &numfunc::GetDefBulletFont()
: 0;
- // <--
if (bNum)
{
@@ -1366,7 +1296,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
if (! bNum)
{
- // --> OD 2008-06-03 #i63395#
+ // #i63395#
// Only apply user defined default bullet font
if ( pFnt )
{
@@ -1379,7 +1309,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aFmt.SetSuffix(::rtl::OUString());
}
- // --> OD 2009-08-26 #i95907#
+ // #i95907#
if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
if(bHtml && nLvl)
@@ -1393,33 +1323,26 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
}
}
- // <--
- // --> FME 2005-01-21 #i38904# Default alignment for
+ // #i38904# Default alignment for
// numbering/bullet should be rtl in rtl paragraph:
if ( bRightToLeft )
{
aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
}
- // <--
aNumRule.Set( nLvl, aFmt );
}
- // --> OD 2009-08-26 #i95907#
+ // #i95907#
if ( pTxtNode &&
ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- // --> OD 2010-01-05 #b6884103#
-// short nTxtNodeFirstLineOffset( 0 );
-// pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset );
-// const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() +
-// nTxtNodeFirstLineOffset;
+
const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList();
- // <--
if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
{
- // --> OD 2010-05-05 #i111172#
+ // #i111172#
// If text node is already inside a list, assure that the indents
// are the same. Thus, adjust the indent change value by subtracting
// indents of to be applied list style.
@@ -1432,17 +1355,12 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
nIndentChange -= aFmt.GetIndentAt() + aFmt.GetFirstLineIndent();
}
}
- // <--
aNumRule.ChangeIndent( nIndentChange );
}
}
- // <--
- // --> OD 2008-02-08 #newlistlevelattrs#
// reset indent attribute on applying list style
- // --> OD 2008-03-17 #refactorlists#
// start new list
SetCurNumRule( aNumRule, true, String(), true );
- // <--
}
EndUndo(UNDO_NUMORNONUM);
@@ -1475,10 +1393,8 @@ void SwWrtShell::NumOrBulletOff()
aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE);
aNumRule.Set(nLevel, aFmt);
- // --> OD 2008-03-17 #refactorlists#
// no start or continuation of a list - the outline style is only changed.
SetCurNumRule( aNumRule, false );
- // <--
}
}
else
@@ -1486,10 +1402,9 @@ void SwWrtShell::NumOrBulletOff()
DelNumRules();
}
- // --> OD 2005-10-24 #126346# - Cursor can not be anymore in front of
+ // #126346# - Cursor can not be anymore in front of
// a label, because numbering/bullet is switched off.
SetInFrontOfLabel( sal_False );
- // <--
}
}
// <- #i29560#
@@ -1504,9 +1419,7 @@ void SwWrtShell::BulletOn()
}
-/*--------------------------------------------------
---------------------------------------------------*/
SelectionType SwWrtShell::GetSelectionType() const
{
// ContentType kann nicht ermittelt werden innerhalb einer
@@ -1517,9 +1430,6 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( BasicActionPend() )
return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT;
-// if ( IsTableMode() )
-// return nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS;
-
SwView &_rView = ((SwView&)GetView());
if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
return nsSelectionType::SEL_POSTIT;
@@ -1576,7 +1486,7 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( IsTableMode() )
nCnt |= (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS);
- // --> FME 2005-01-12 #i39855#
+ // #i39855#
// Do not pop up numbering toolbar, if the text node has a numbering
// of type SVX_NUM_NUMBER_NONE.
const SwNumRule* pNumRule = GetCurNumRule();
@@ -1585,16 +1495,13 @@ SelectionType SwWrtShell::GetSelectionType() const
const SwTxtNode* pTxtNd =
GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
- // --> OD 2008-03-19 #refactorlists#
if ( pTxtNd && pTxtNd->IsInList() )
- // <--
{
const SwNumFmt& rFmt = pNumRule->Get(sal::static_int_cast< sal_uInt8, sal_Int32>(pTxtNd->GetActualListLevel()));
if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() )
nCnt |= nsSelectionType::SEL_NUM;
}
}
- // <--
return nCnt;
}
@@ -1658,7 +1565,14 @@ SwFrmFmt *SwWrtShell::GetTblStyle(const String &rFmtName)
return 0;
}
+SwNavigationMgr& SwWrtShell::GetNavigationMgr() {
+ return aNavigationMgr;
+}
+void SwWrtShell::addCurrentPosition() {
+ SwPaM* pPaM = GetCrsr();
+ aNavigationMgr.addEntry(*pPaM->GetPoint());
+}
/*------------------------------------------------------------------------
Beschreibung: Anwenden der Vorlagen
------------------------------------------------------------------------*/
@@ -1747,10 +1661,6 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet
EndAction();
}
-/*-----------------12.03.97 12.24-------------------
-
---------------------------------------------------*/
-
void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet )
{
StartAction();
@@ -1819,6 +1729,12 @@ SwWrtShell::SwWrtShell( SwDoc& rDoc, Window *_pWin, SwView &rShell,
SET_CURR_SHELL( this );
SetSfxViewShell( (SfxViewShell *)&rShell );
SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
+
+ // place the cursor on the first field...
+ IFieldmark *pBM = NULL;
+ if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=NULL ) {
+ GotoFieldmark(pBM);
+ }
}
/*
@@ -1848,9 +1764,6 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldCrsr )
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
sal_Bool SwWrtShell::CanInsert()
{
return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
@@ -1910,3 +1823,4 @@ void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 297a9865722b..d5612caaceb6 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,11 +74,6 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
void SwWrtShell::Insert(SwField &rFld)
{
ResetCursorStack();
@@ -153,15 +149,12 @@ void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel )
sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton,
Window* pParentWin, ByteString* pWindowState )
{
-//JP 14.08.96: Bug 30332 - nach Umbau der modularietaet im SFX, muss jetzt
-// das TopWindow der Application benutzt werden.
-// SwFldInputDlg* pDlg = new SwFldInputDlg( GetWin(), *this, pFld );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT,
pParentWin, *this, pFld, bNextButton);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(pWindowState && pWindowState->Len())
pDlg->SetWindowState(*pWindowState);
sal_Bool bRet = RET_CANCEL == pDlg->Execute();
@@ -172,16 +165,14 @@ sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton,
GetWin()->Update();
return bRet;
}
-/* -----------------17.06.2003 10:18-----------------
- --------------------------------------------------*/
sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, ByteString* pWindowState)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractDropDownFieldDialog* pDlg = pFact->CreateDropDownFieldDialog( NULL, *this, pFld, DLG_FLD_DROPDOWN ,bNextButton );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(pWindowState && pWindowState->Len())
pDlg->SetWindowState(*pWindowState);
sal_uInt16 nRet = pDlg->Execute();
@@ -265,7 +256,6 @@ void SwWrtShell::ClickToField( const SwField& rFld )
case JE_FMT_GRAPHIC: nSlotId = SID_INSERT_GRAPHIC; break;
case JE_FMT_OLE: nSlotId = SID_INSERT_OBJECT; break;
-// case JE_FMT_TEXT:
}
Right( CRSR_SKIP_CHARS, sal_True, 1, sal_False ); // Feld selektieren
@@ -383,7 +373,7 @@ sal_Bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter )
void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter,
const String *pTargetFrameName )
{
- ASSERT( rURL.Len() && pVSh, "was soll hier geladen werden?" );
+ OSL_ENSURE( rURL.Len() && pVSh, "what should be loaded here?" );
if( !rURL.Len() || !pVSh )
return ;
@@ -398,7 +388,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter,
return;
SwDocShell* pDShell = pSh->GetView().GetDocShell();
- DBG_ASSERT( pDShell, "No DocShell?!");
+ OSL_ENSURE( pDShell, "No DocShell?!");
String sTargetFrame;
if( pTargetFrameName && pTargetFrameName->Len() )
sTargetFrame = *pTargetFrameName;
@@ -422,7 +412,6 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter,
SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False );
//#39076# Silent kann lt. SFX entfernt werden.
-// SfxBoolItem aSilent( SID_SILENT, sal_True );
SfxBoolItem aBrowse( SID_BROWSE, sal_True );
if( nFilter & URLLOAD_NEWVIEW )
@@ -496,3 +485,4 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx
index 9988d42abd2a..db5df142c9ce 100644
--- a/sw/source/ui/wrtsh/wrtsh3.cxx
+++ b/sw/source/ui/wrtsh/wrtsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_sw.hxx"
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <sfx2/app.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/bindings.hxx>
@@ -59,8 +58,7 @@ extern sal_Bool bNoInterrupt; // in mainwn.cxx
sal_Bool SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark)
{
-//JP 08.03.96: die Wizards brauchen die Selektion !!
-// EndSelect();
+ addCurrentPosition();
(this->*fnKillSel)( 0, sal_False );
sal_Bool bRet = sal_True;
@@ -129,7 +127,7 @@ bool SwWrtShell::GotoFieldmark(::sw::mark::IFieldmark const * const pMark)
void SwWrtShell::DrawSelChanged( )
{
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 const aInval[] =
{
SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, SID_ATTR_LINE_STYLE,
SID_ATTR_LINE_WIDTH, SID_ATTR_LINE_COLOR, 0
@@ -205,7 +203,7 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
- ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+ OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
if( !xControlModel.is() )
return bRet;
@@ -245,3 +243,5 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx
index abc1933560ca..0d0113bfc890 100644
--- a/sw/source/ui/wrtsh/wrtsh4.cxx
+++ b/sw/source/ui/wrtsh/wrtsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -152,7 +153,7 @@ sal_Bool SwWrtShell::_PrvWrd()
return bRet;
}
-// --> OD 2008-08-06 #i92468#
+// #i92468#
// method code of <SwWrtShell::_NxtWrd()> before fix for issue i72162
sal_Bool SwWrtShell::_NxtWrdForDelete()
{
@@ -198,8 +199,6 @@ sal_Bool SwWrtShell::_PrvWrdForDelete()
Combine();
return sal_True;
}
-// <--
-
sal_Bool SwWrtShell::_FwdSentence()
{
@@ -218,8 +217,6 @@ sal_Bool SwWrtShell::_FwdSentence()
return 1;
}
-
-
sal_Bool SwWrtShell::_BwdSentence()
{
Push();
@@ -229,12 +226,7 @@ sal_Bool SwWrtShell::_BwdSentence()
Pop(sal_False);
return 0;
}
- if(IsSttPara())
- {
- Pop();
- return 1;
- }
- if( !GoPrevSentence() && !IsSttPara() )
+ if( !GoStartSentence() && !IsSttPara() )
// nicht gefunden --> an den Absatz Anfang
SwCrsrShell::MovePara( fnParaCurr, fnParaStart );
ClearMark();
@@ -242,21 +234,10 @@ sal_Bool SwWrtShell::_BwdSentence()
return 1;
}
-
sal_Bool SwWrtShell::_FwdPara()
{
Push();
ClearMark();
- // --> OD 2009-01-06 #i81824#
- // going right and back again left not needed and causes too much
- // accessibility events due to the cursor movements.
-// if(!SwCrsrShell::Right(1,CRSR_SKIP_CHARS))
-// {
-// Pop(sal_False);
-// return 0;
-// }
-// SwCrsrShell::Left(1,CRSR_SKIP_CHARS);
- // <--
sal_Bool bRet = SwCrsrShell::MovePara(fnParaNext, fnParaStart);
ClearMark();
@@ -269,28 +250,12 @@ sal_Bool SwWrtShell::_BwdPara()
{
Push();
ClearMark();
- // --> OD 2009-01-06 #i81824#
- // going left and back again right not needed and causes too much
- // accessibility events due to the cursor movements.
-// if(!SwCrsrShell::Left(1,CRSR_SKIP_CHARS))
-// {
-// Pop(sal_False);
-// return 0;
-// }
-// SwCrsrShell::Right(1,CRSR_SKIP_CHARS);
- // <--
- // --> OD 2009-01-06 #i81824#
- // going to start of paragraph only needed, if move to previous paragraph
- // does not happen. Otherwise, useless accessibility events are triggered
- // due to cursor movements.
-// if(!IsSttOfPara())
-// SttPara();
+
sal_Bool bRet = SwCrsrShell::MovePara(fnParaPrev, fnParaStart);
if ( !bRet && !IsSttOfPara() )
{
SttPara();
}
- // <--
ClearMark();
Combine();
@@ -298,3 +263,4 @@ sal_Bool SwWrtShell::_BwdPara()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx
index 995315b5ada4..5ec7103246a7 100644
--- a/sw/source/ui/wrtsh/wrtundo.cxx
+++ b/sw/source/ui/wrtsh/wrtundo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -155,6 +156,7 @@ sal_uInt16 SwWrtShell::GetDoStrings( DoType eDoType, SfxStringListItem& rStrs )
OSL_ENSURE(comments[i].getLength(), "no Undo/Redo Text set");
buf.append(comments[i]);
buf.append(sal_Unicode('\n'));
+ OSL_ENSURE( !this, "no Undo/Redo Test set" );
}
rStrs.SetString(buf.makeStringAndClear());
return static_cast<sal_uInt16>(comments.size());
@@ -177,3 +179,4 @@ String SwWrtShell::GetRepeatString() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */